Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

15.3 KB
Raw Blame
components:
  schemas:
    WorkItemKind:
      type: string
      enum: [issue, task]
    WorkItemState:
      type: string
      enum: [open, in_progress, resolved]
    WorkItemResolution:
      type: string
      enum: [completed, failed, not_planned, duplicate]
    WorkItemPriority:
      type: string
      enum: [low, medium, high, urgent]
    WorkItemAssignment:
      type: object
      additionalProperties: false
      required: [actor, assigned_by, assigned_at]
      properties:
        actor:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        assigned_by:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        assigned_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
    WorkItemAccessGrant:
      type: object
      additionalProperties: false
      required: [actor, granted_by, granted_at]
      properties:
        actor:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        granted_by:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        granted_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
    WorkItemTaskExecutionSummary:
      type: object
      additionalProperties: false
      required:
        - generation
        - status
        - execution_revision
        - desired_control
        - control_revision
        - control_settled_revision
        - pending_control
        - execution_updated_at
      properties:
        generation:
          type: integer
          format: int64
          minimum: 1
        status:
          $ref: "./task-executions.yaml#/components/schemas/TaskExecutionStatus"
        execution_revision:
          type: integer
          format: int64
          minimum: 1
        reason_code:
          type: string
          minLength: 1
        desired_control:
          type: string
          enum: [run, pause, terminate]
        control_revision:
          type: integer
          format: int64
          minimum: 0
        control_settled_revision:
          type: integer
          format: int64
          minimum: 0
        pending_control:
          type: boolean
          description: True while the desired control revision has not been settled.
        control_outcome:
          type: string
          enum: [applied, superseded, rejected]
        execution_updated_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
    WorkItem:
      type: object
      additionalProperties: false
      required:
        - id
        - tenant_id
        - number
        - kind
        - title
        - description
        - referenced_actors
        - priority
        - state
        - version
        - created_by
        - updated_by
        - assignees
        - explicit_access_grants
        - created_at
        - updated_at
      properties:
        id:
          $ref: "./common.yaml#/components/schemas/Id"
        tenant_id:
          $ref: "./common.yaml#/components/schemas/Id"
        number:
          type: integer
          format: int64
          minimum: 1
          description: Stable Tenant-scoped Work Item display number.
        kind:
          $ref: "#/components/schemas/WorkItemKind"
        title:
          type: string
          minLength: 1
          maxLength: 240
        description:
          type: string
          maxLength: 50000
        referenced_actors:
          type: array
          maxItems: 100
          items:
            $ref: "./common.yaml#/components/schemas/ActorRef"
        priority:
          $ref: "#/components/schemas/WorkItemPriority"
        state:
          $ref: "#/components/schemas/WorkItemState"
        resolution:
          $ref: "#/components/schemas/WorkItemResolution"
          description: Present only while state is resolved.
        version:
          type: integer
          format: int64
          minimum: 1
        created_by:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        updated_by:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        assignees:
          type: array
          maxItems: 100
          items:
            $ref: "#/components/schemas/WorkItemAssignment"
        explicit_access_grants:
          type: array
          maxItems: 100
          items:
            $ref: "#/components/schemas/WorkItemAccessGrant"
        origin_room_id:
          $ref: "./common.yaml#/components/schemas/Id"
        origin_message_id:
          $ref: "./common.yaml#/components/schemas/Id"
          description: Present only with origin_room_id and bound to that Room.
        work_room_id:
          $ref: "./common.yaml#/components/schemas/Id"
        task_execution:
          $ref: "#/components/schemas/WorkItemTaskExecutionSummary"
          description: Current PostgreSQL-authoritative execution projection for a Task.
        archived_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
        created_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
        updated_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
    WorkItemPage:
      type: object
      additionalProperties: false
      required: [items, page]
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/WorkItem"
        page:
          $ref: "./common.yaml#/components/schemas/PageMeta"
    WorkItemCreateRequest:
      type: object
      additionalProperties: false
      required: [kind, title]
      properties:
        kind:
          $ref: "#/components/schemas/WorkItemKind"
          description: Direct creation accepts issue only; Tasks use the managed Task creation flow.
        title:
          type: string
          minLength: 1
          maxLength: 240
        description:
          type: string
          maxLength: 50000
          default: ""
        referenced_actor_ids:
          type: array
          uniqueItems: true
          maxItems: 100
          items:
            $ref: "./common.yaml#/components/schemas/Id"
        priority:
          allOf:
            - $ref: "#/components/schemas/WorkItemPriority"
          default: medium
        assignee_actor_ids:
          type: array
          uniqueItems: true
          maxItems: 100
          items:
            $ref: "./common.yaml#/components/schemas/Id"
        origin_room_id:
          $ref: "./common.yaml#/components/schemas/Id"
    AgentWorkItemCreateRequest:
      type: object
      additionalProperties: false
      required: [kind, title]
      properties:
        kind:
          $ref: "#/components/schemas/WorkItemKind"
        title:
          type: string
          minLength: 1
          maxLength: 240
        description:
          type: string
          maxLength: 50000
          default: ""
        referenced_actor_ids:
          type: array
          uniqueItems: true
          maxItems: 100
          items:
            $ref: "./common.yaml#/components/schemas/Id"
        priority:
          allOf:
            - $ref: "#/components/schemas/WorkItemPriority"
          default: medium
        assignee_actor_ids:
          type: array
          uniqueItems: true
          maxItems: 100
          description: >-
            Initial assignees. When present, origin_room_id is required and every
            assignee must be a current member of that Origin Room in the rebound
            Agent's Tenant.
          items:
            $ref: "./common.yaml#/components/schemas/Id"
        origin_room_id:
          $ref: "./common.yaml#/components/schemas/Id"
    WorkItemUpdateRequest:
      type: object
      additionalProperties: false
      required: [expected_version]
      minProperties: 2
      properties:
        expected_version:
          type: integer
          format: int64
          minimum: 1
        title:
          type: string
          minLength: 1
          maxLength: 240
        description:
          type: string
          maxLength: 50000
        referenced_actor_ids:
          type: array
          uniqueItems: true
          maxItems: 100
          items:
            $ref: "./common.yaml#/components/schemas/Id"
        priority:
          $ref: "#/components/schemas/WorkItemPriority"
    WorkItemTransitionRequest:
      type: object
      additionalProperties: false
      required: [expected_version, state]
      properties:
        expected_version:
          type: integer
          format: int64
          minimum: 1
        state:
          $ref: "#/components/schemas/WorkItemState"
        resolution:
          $ref: "#/components/schemas/WorkItemResolution"
          description: Accepted only when entering resolved; reopening clears it.
    WorkItemVersionRequest:
      type: object
      additionalProperties: false
      required: [expected_version]
      properties:
        expected_version:
          type: integer
          format: int64
          minimum: 1
    WorkItemCommentTextSegment:
      type: object
      additionalProperties: false
      required: [type, content]
      properties:
        type:
          type: string
          const: text
        content:
          type: string
          minLength: 1
          maxLength: 50000
    WorkItemCommentReferenceSegment:
      type: object
      additionalProperties: false
      required: [type, content, actor_id]
      properties:
        type:
          type: string
          const: reference
        content:
          type: string
          minLength: 1
          maxLength: 50000
        actor_id:
          $ref: "./common.yaml#/components/schemas/Id"
          description: Same-Tenant Human or Agent Actor referenced by this segment.
    WorkItemCommentSegment:
      oneOf:
        - $ref: "#/components/schemas/WorkItemCommentTextSegment"
        - $ref: "#/components/schemas/WorkItemCommentReferenceSegment"
      discriminator:
        propertyName: type
        mapping:
          text: "#/components/schemas/WorkItemCommentTextSegment"
          reference: "#/components/schemas/WorkItemCommentReferenceSegment"
    WorkItemComment:
      type: object
      additionalProperties: false
      required:
        [
          id,
          tenant_id,
          work_item_id,
          author,
          body,
          segments,
          version,
          created_at,
          updated_at,
        ]
      properties:
        id:
          $ref: "./common.yaml#/components/schemas/Id"
        tenant_id:
          $ref: "./common.yaml#/components/schemas/Id"
        work_item_id:
          $ref: "./common.yaml#/components/schemas/Id"
        author:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        body:
          type: string
          maxLength: 50000
          description: Empty only for a soft-deleted Comment tombstone.
        segments:
          type: array
          maxItems: 1000
          items:
            $ref: "#/components/schemas/WorkItemCommentSegment"
          description: Empty only for a soft-deleted Comment tombstone.
        version:
          type: integer
          format: int64
          minimum: 1
        deleted_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
        created_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
        updated_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
    WorkItemCommentPage:
      type: object
      additionalProperties: false
      required: [items, page]
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/WorkItemComment"
        page:
          $ref: "./common.yaml#/components/schemas/PageMeta"
    WorkItemCommentCreateRequest:
      type: object
      additionalProperties: false
      required: [body, segments]
      properties:
        body:
          type: string
          minLength: 1
          maxLength: 50000
        segments:
          type: array
          minItems: 1
          maxItems: 1000
          items:
            $ref: "#/components/schemas/WorkItemCommentSegment"
      description: Concatenating segment content in order must equal body.
    WorkItemCommentUpdateRequest:
      type: object
      additionalProperties: false
      required: [expected_version, body, segments]
      properties:
        expected_version:
          type: integer
          format: int64
          minimum: 1
        body:
          type: string
          minLength: 1
          maxLength: 50000
        segments:
          type: array
          minItems: 1
          maxItems: 1000
          items:
            $ref: "#/components/schemas/WorkItemCommentSegment"
      description: Replaces the complete content; concatenating segment content must equal body.
    WorkItemActivityKind:
      type: string
      enum:
        - created
        - metadata_updated
        - state_transitioned
        - archived
        - unarchived
        - assignment_added
        - assignment_removed
        - access_grant_added
        - access_grant_removed
        - comment_edited
        - comment_deleted
        - work_room_created
        - execution_control_requested
        - task_recovery_decision
    WorkItemActivity:
      type: object
      additionalProperties: false
      required: [id, work_item_id, kind, actor, details, occurred_at]
      properties:
        id:
          $ref: "./common.yaml#/components/schemas/Id"
        work_item_id:
          $ref: "./common.yaml#/components/schemas/Id"
        kind:
          $ref: "#/components/schemas/WorkItemActivityKind"
        actor:
          $ref: "./common.yaml#/components/schemas/ActorRef"
        from_state:
          $ref: "#/components/schemas/WorkItemState"
        to_state:
          $ref: "#/components/schemas/WorkItemState"
        target_actor_id:
          $ref: "./common.yaml#/components/schemas/Id"
        comment_id:
          $ref: "./common.yaml#/components/schemas/Id"
        room_id:
          $ref: "./common.yaml#/components/schemas/Id"
        details:
          type: object
          additionalProperties: true
          description: >-
            Restricted activity-specific audit details. execution_control_requested includes
            action, control_revision, source_kind, source_id, and optional reason;
            task_recovery_decision includes action, generation, intervention identity/version, and
            source_kind.
        occurred_at:
          $ref: "./common.yaml#/components/schemas/Timestamp"
    WorkItemCommentTimelineEntry:
      type: object
      additionalProperties: false
      required: [type, comment]
      properties:
        type:
          type: string
          const: comment
        comment:
          $ref: "#/components/schemas/WorkItemComment"
    WorkItemActivityTimelineEntry:
      type: object
      additionalProperties: false
      required: [type, activity]
      properties:
        type:
          type: string
          const: activity
        activity:
          $ref: "#/components/schemas/WorkItemActivity"
    WorkItemTimelineEntry:
      oneOf:
        - $ref: "#/components/schemas/WorkItemCommentTimelineEntry"
        - $ref: "#/components/schemas/WorkItemActivityTimelineEntry"
      discriminator:
        propertyName: type
        mapping:
          comment: "#/components/schemas/WorkItemCommentTimelineEntry"
          activity: "#/components/schemas/WorkItemActivityTimelineEntry"
    WorkItemTimelinePage:
      type: object
      additionalProperties: false
      required: [items, page]
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/WorkItemTimelineEntry"
        page:
          $ref: "./common.yaml#/components/schemas/PageMeta"