@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Retrieve a context document's content Returns the full text of a context document, or a slice of it when offset, limit, and unit are supplied. Both file-backed and inline documents are supported; the response shape is the same in either case. When slicing, set unit to "lines" (default) or "bytes". A line-based slice uses a 1-indexed offset; a byte-based slice uses a 0-indexed offset. If you omit offset, the full document text is returned and the slice-specific response fields (unit, offset, limit, start_line, end_line, start_byte, end_byte) are absent. The caller must be authenticated and the request must be scoped to an app that owns the document.

      Parameters

      • document: string

        Document ID (cdo_...) whose content to retrieve.

      • Optionalparams: { limit?: number; offset?: number; unit?: string }

        Query parameters.

        • Optionallimit?: number

          Maximum number of units to return when slicing. Defaults to 200 when unit is "lines" and 8192 when unit is "bytes".

        • Optionaloffset?: number

          Starting position for a content slice. When unit is "lines", this is a 1-indexed line number. When unit is "bytes", this is a 0-indexed byte offset. Omit to return the full document.

        • Optionalunit?: string

          Unit to use for offset and limit. One of "lines" (default) or "bytes".

      Returns Promise<ContextDocumentContent>

      The document's content, optionally sliced by offset and limit.

    • Delete a context document Permanently deletes a context document and all of its associated chunk items. This action is irreversible. The backing storage file, if any, is not deleted — storage files can be shared across multiple documents and are cleaned up separately by the platform's storage garbage collector. The caller must be authenticated and the request must be scoped to the app that owns the document.

      Parameters

      • document: string

        Document ID (cdo_...) to delete.

      Returns Promise<void>

      Empty body. Returns HTTP 204 on success.

    • Retrieve a context document Returns a single context document identified by its ID. The response includes document metadata such as title, size, and ownership fields, but not the document's text content. To read the full or partial content, use the content endpoint. The caller must be authenticated and the request must be scoped to the app that owns the document.

      Parameters

      • document: string

        Document ID (cdo_...) to retrieve.

      Returns Promise<ContextDocument>

      The requested context document's metadata.

    • List context documents Returns a paginated list of context documents visible to the authenticated caller within the scoped app. Results are ordered by creation time descending. Use q for a case-insensitive title prefix search. Use source, installation, or agent to narrow results to documents belonging to specific sources, installations, or agents. Multiple values within each filter are treated as OR conditions. Filters may be combined. The response includes page-level metadata so you can navigate through large result sets without cursor tokens.

      Parameters

      • Optionalparams: {
            agent?: string[];
            installation?: string[];
            page?: number;
            pageSize?: number;
            q?: string;
            source?: string[];
        }

        Query parameters.

        • Optionalagent?: string[]

          Return only documents owned by these agent IDs. Multiple values are OR'd.

        • Optionalinstallation?: string[]

          Return only documents belonging to these installation IDs. Multiple values are OR'd.

        • Optionalpage?: number

          Page number to return. Defaults to 1.

        • OptionalpageSize?: number

          Number of documents per page. Defaults to 25.

        • Optionalq?: string

          Case-insensitive prefix filter applied to the document title.

        • Optionalsource?: string[]

          Return only documents belonging to these source IDs (cso_...). Multiple values are OR'd.

      Returns Promise<
          {
              data: {
                  agent?: string;
                  created_at?: string;
                  file?: string;
                  id: string;
                  metadata?: Record<string, unknown>;
                  source?: string;
                  team?: string;
                  title?: string;
                  total_lines?: number;
                  total_size?: number;
                  updated_at?: string;
                  user?: string;
              }[];
              has_next: boolean;
              has_prev: boolean;
              page: number;
              page_size: number;
              total_entries: number;
              total_pages: number;
          },
      >

      Successful response