@airstore/sdk 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +206 -285
  2. package/dist/cjs/airstore.js +33 -24
  3. package/dist/cjs/airstore.js.map +1 -1
  4. package/dist/cjs/index.js +6 -2
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/resources/access-log.js +3 -55
  7. package/dist/cjs/resources/access-log.js.map +1 -1
  8. package/dist/cjs/resources/agents.js +33 -2
  9. package/dist/cjs/resources/agents.js.map +1 -1
  10. package/dist/cjs/resources/channels.js +50 -0
  11. package/dist/cjs/resources/channels.js.map +1 -0
  12. package/dist/cjs/resources/connections.js +6 -37
  13. package/dist/cjs/resources/connections.js.map +1 -1
  14. package/dist/cjs/resources/filesystem.js +5 -53
  15. package/dist/cjs/resources/filesystem.js.map +1 -1
  16. package/dist/cjs/resources/helpers.js +52 -0
  17. package/dist/cjs/resources/helpers.js.map +1 -0
  18. package/dist/cjs/resources/hooks.js +98 -0
  19. package/dist/cjs/resources/hooks.js.map +1 -0
  20. package/dist/cjs/resources/index.js +5 -1
  21. package/dist/cjs/resources/index.js.map +1 -1
  22. package/dist/cjs/resources/members.js +3 -33
  23. package/dist/cjs/resources/members.js.map +1 -1
  24. package/dist/cjs/resources/oauth.js +4 -39
  25. package/dist/cjs/resources/oauth.js.map +1 -1
  26. package/dist/cjs/resources/runs.js +64 -10
  27. package/dist/cjs/resources/runs.js.map +1 -1
  28. package/dist/cjs/resources/tasks.js +103 -48
  29. package/dist/cjs/resources/tasks.js.map +1 -1
  30. package/dist/cjs/resources/tokens.js +5 -36
  31. package/dist/cjs/resources/tokens.js.map +1 -1
  32. package/dist/cjs/resources/views.js +5 -40
  33. package/dist/cjs/resources/views.js.map +1 -1
  34. package/dist/cjs/resources/workspaces.js +6 -48
  35. package/dist/cjs/resources/workspaces.js.map +1 -1
  36. package/dist/cjs/types/channels.js +3 -0
  37. package/dist/cjs/types/channels.js.map +1 -0
  38. package/dist/cjs/types/hooks.js +3 -0
  39. package/dist/cjs/types/hooks.js.map +1 -0
  40. package/dist/cjs/types/index.js +2 -0
  41. package/dist/cjs/types/index.js.map +1 -1
  42. package/dist/cjs/types/tasks.js.map +1 -1
  43. package/dist/esm/airstore.js +33 -24
  44. package/dist/esm/airstore.js.map +1 -1
  45. package/dist/esm/index.js +2 -0
  46. package/dist/esm/index.js.map +1 -1
  47. package/dist/esm/resources/access-log.js +3 -55
  48. package/dist/esm/resources/access-log.js.map +1 -1
  49. package/dist/esm/resources/agents.js +33 -2
  50. package/dist/esm/resources/agents.js.map +1 -1
  51. package/dist/esm/resources/channels.js +46 -0
  52. package/dist/esm/resources/channels.js.map +1 -0
  53. package/dist/esm/resources/connections.js +6 -37
  54. package/dist/esm/resources/connections.js.map +1 -1
  55. package/dist/esm/resources/filesystem.js +5 -53
  56. package/dist/esm/resources/filesystem.js.map +1 -1
  57. package/dist/esm/resources/helpers.js +47 -0
  58. package/dist/esm/resources/helpers.js.map +1 -0
  59. package/dist/esm/resources/hooks.js +94 -0
  60. package/dist/esm/resources/hooks.js.map +1 -0
  61. package/dist/esm/resources/index.js +2 -0
  62. package/dist/esm/resources/index.js.map +1 -1
  63. package/dist/esm/resources/members.js +3 -33
  64. package/dist/esm/resources/members.js.map +1 -1
  65. package/dist/esm/resources/oauth.js +4 -39
  66. package/dist/esm/resources/oauth.js.map +1 -1
  67. package/dist/esm/resources/runs.js +64 -10
  68. package/dist/esm/resources/runs.js.map +1 -1
  69. package/dist/esm/resources/tasks.js +100 -45
  70. package/dist/esm/resources/tasks.js.map +1 -1
  71. package/dist/esm/resources/tokens.js +5 -36
  72. package/dist/esm/resources/tokens.js.map +1 -1
  73. package/dist/esm/resources/views.js +5 -40
  74. package/dist/esm/resources/views.js.map +1 -1
  75. package/dist/esm/resources/workspaces.js +6 -48
  76. package/dist/esm/resources/workspaces.js.map +1 -1
  77. package/dist/esm/types/channels.js +2 -0
  78. package/dist/esm/types/channels.js.map +1 -0
  79. package/dist/esm/types/hooks.js +2 -0
  80. package/dist/esm/types/hooks.js.map +1 -0
  81. package/dist/esm/types/index.js +2 -0
  82. package/dist/esm/types/index.js.map +1 -1
  83. package/dist/esm/types/tasks.js.map +1 -1
  84. package/dist/types/airstore.d.ts +31 -24
  85. package/dist/types/airstore.d.ts.map +1 -1
  86. package/dist/types/index.d.ts +7 -3
  87. package/dist/types/index.d.ts.map +1 -1
  88. package/dist/types/resources/access-log.d.ts +3 -55
  89. package/dist/types/resources/access-log.d.ts.map +1 -1
  90. package/dist/types/resources/agents.d.ts +14 -2
  91. package/dist/types/resources/agents.d.ts.map +1 -1
  92. package/dist/types/resources/channels.d.ts +21 -0
  93. package/dist/types/resources/channels.d.ts.map +1 -0
  94. package/dist/types/resources/connections.d.ts +6 -37
  95. package/dist/types/resources/connections.d.ts.map +1 -1
  96. package/dist/types/resources/filesystem.d.ts +5 -53
  97. package/dist/types/resources/filesystem.d.ts.map +1 -1
  98. package/dist/types/resources/helpers.d.ts +5 -0
  99. package/dist/types/resources/helpers.d.ts.map +1 -0
  100. package/dist/types/resources/hooks.d.ts +23 -0
  101. package/dist/types/resources/hooks.d.ts.map +1 -0
  102. package/dist/types/resources/index.d.ts +2 -0
  103. package/dist/types/resources/index.d.ts.map +1 -1
  104. package/dist/types/resources/members.d.ts +3 -33
  105. package/dist/types/resources/members.d.ts.map +1 -1
  106. package/dist/types/resources/oauth.d.ts +4 -39
  107. package/dist/types/resources/oauth.d.ts.map +1 -1
  108. package/dist/types/resources/runs.d.ts +14 -6
  109. package/dist/types/resources/runs.d.ts.map +1 -1
  110. package/dist/types/resources/tasks.d.ts +36 -2
  111. package/dist/types/resources/tasks.d.ts.map +1 -1
  112. package/dist/types/resources/tokens.d.ts +5 -36
  113. package/dist/types/resources/tokens.d.ts.map +1 -1
  114. package/dist/types/resources/views.d.ts +5 -40
  115. package/dist/types/resources/views.d.ts.map +1 -1
  116. package/dist/types/resources/workspaces.d.ts +6 -48
  117. package/dist/types/resources/workspaces.d.ts.map +1 -1
  118. package/dist/types/types/agents.d.ts +25 -2
  119. package/dist/types/types/agents.d.ts.map +1 -1
  120. package/dist/types/types/channels.d.ts +20 -0
  121. package/dist/types/types/channels.d.ts.map +1 -0
  122. package/dist/types/types/hooks.d.ts +57 -0
  123. package/dist/types/types/hooks.d.ts.map +1 -0
  124. package/dist/types/types/index.d.ts +2 -0
  125. package/dist/types/types/index.d.ts.map +1 -1
  126. package/dist/types/types/runs.d.ts +20 -6
  127. package/dist/types/types/runs.d.ts.map +1 -1
  128. package/dist/types/types/tasks.d.ts +102 -1
  129. package/dist/types/types/tasks.d.ts.map +1 -1
  130. package/package.json +2 -1
@@ -6,67 +6,15 @@ import type { AccessLogListParams, AccessLogListResponse, AccessLogSummaryParams
6
6
  * Every file read through the virtual filesystem is recorded with token
7
7
  * counts, compression outcome, timing, and a `source_uri` that pins
8
8
  * the content back to its upstream origin.
9
- *
10
- * @example List recent reads
11
- * ```ts
12
- * const page = await airstore.accessLog.list("ws-abc", {
13
- * start: Date.now() - 3600_000, // last hour
14
- * limit: 50,
15
- * });
16
- * for (const r of page.reads) {
17
- * console.log(r.source_uri, r.original_tokens, "->", r.compressed_tokens);
18
- * }
19
- * ```
20
- *
21
- * @example Get a summary
22
- * ```ts
23
- * const s = await airstore.accessLog.summary("ws-abc", {
24
- * start: Date.now() - 86400_000,
25
- * });
26
- * console.log(`${s.total_reads} reads, ${s.compression_ratio} ratio`);
27
- * ```
28
- *
29
- * @example Replay a read by source URI
30
- * ```ts
31
- * const content = await airstore.accessLog.read("ws-abc", "github://abc123");
32
- * ```
33
9
  */
34
10
  export declare class AccessLog {
35
11
  private readonly client;
36
12
  constructor(client: CoreClient);
37
- /**
38
- * List access log reads for a workspace.
39
- *
40
- * Supports cursor-based pagination and optional time-window filtering.
41
- *
42
- * @param workspaceId - Workspace external ID (UUID).
43
- * @param params - Filtering and pagination options.
44
- * @param options - Per-request overrides.
45
- */
13
+ /** List access log reads with optional time-window and cursor pagination. */
46
14
  list(workspaceId: string, params?: AccessLogListParams, options?: RequestOptions): Promise<AccessLogListResponse>;
47
- /**
48
- * Get an aggregated summary of access log reads.
49
- *
50
- * Returns totals, compression ratio, per-integration breakdown,
51
- * outcome distribution, and top paths by token consumption.
52
- *
53
- * @param workspaceId - Workspace external ID (UUID).
54
- * @param params - Time window and session options.
55
- * @param options - Per-request overrides.
56
- */
15
+ /** Get an aggregated summary: totals, compression ratio, per-integration breakdown. */
57
16
  summary(workspaceId: string, params?: AccessLogSummaryParams, options?: RequestOptions): Promise<AccessLogSummary>;
58
- /**
59
- * Read content directly from an upstream source using a `source_uri`.
60
- *
61
- * This bypasses the source-view/query layer entirely. Even if the
62
- * materialized view has changed, the source_uri lets you pull the
63
- * exact content that was originally read.
64
- *
65
- * @param workspaceId - Workspace external ID (UUID).
66
- * @param sourceUri - Source URI from an access log entry (e.g., "github://abc123").
67
- * @param options - Per-request overrides.
68
- * @returns The raw content as an ArrayBuffer.
69
- */
17
+ /** Read content directly from an upstream source using a `source_uri`. */
70
18
  read(workspaceId: string, sourceUri: string, options?: RequestOptions): Promise<ArrayBuffer>;
71
19
  }
72
20
  //# sourceMappingURL=access-log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"access-log.d.ts","sourceRoot":"","sources":["../../../src/resources/access-log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;;;;;;OAQG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,qBAAqB,CAAC;IAiBjC;;;;;;;;;OASG;IACG,OAAO,CACX,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,sBAAsB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,gBAAgB,CAAC;IAe5B;;;;;;;;;;;OAWG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC;CAQxB"}
1
+ {"version":3,"file":"access-log.d.ts","sourceRoot":"","sources":["../../../src/resources/access-log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;GAMG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,6EAA6E;IACvE,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,qBAAqB,CAAC;IAiBjC,uFAAuF;IACjF,OAAO,CACX,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,sBAAsB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,gBAAgB,CAAC;IAe5B,0EAA0E;IACpE,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC;CAQxB"}
@@ -1,13 +1,25 @@
1
1
  import type { CoreClient, RequestOptions } from '../client.js';
2
- import type { AgentCreateParams, AgentProfile } from '../types/agents.js';
2
+ import type { AgentConfig, AgentCreateParams, AgentProfile, AgentUpdateParams } from '../types/agents.js';
3
3
  /**
4
- * Manage agent profiles in a workspace.
4
+ * CRUD operations for agent profiles within a workspace.
5
+ *
6
+ * An agent profile defines the runner, model, system prompt, and other
7
+ * configuration used when a task is dispatched to that agent.
5
8
  */
6
9
  export declare class Agents {
7
10
  private readonly client;
8
11
  constructor(client: CoreClient);
12
+ /** Retrieve the default agent config (system prompt, workspace dir) for a runner key. */
13
+ defaults(workspaceId: string, agentKey?: string, options?: RequestOptions): Promise<AgentConfig>;
14
+ /** Create a new agent profile. Returns the created profile with its server-assigned `id`. */
9
15
  create(workspaceId: string, params: AgentCreateParams, options?: RequestOptions): Promise<AgentProfile>;
16
+ /** List all agent profiles in a workspace. */
10
17
  list(workspaceId: string, options?: RequestOptions): Promise<AgentProfile[]>;
18
+ /** Retrieve a single agent profile by ID. */
11
19
  retrieve(workspaceId: string, agentId: string, options?: RequestOptions): Promise<AgentProfile>;
20
+ /** Update an agent profile. Only provided fields are changed (merge semantics for config). */
21
+ update(workspaceId: string, agentId: string, params: AgentUpdateParams, options?: RequestOptions): Promise<AgentProfile>;
22
+ /** Delete an agent profile and any hooks bound to it. */
23
+ delete(workspaceId: string, agentId: string, options?: RequestOptions): Promise<void>;
12
24
  }
13
25
  //# sourceMappingURL=agents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/resources/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE1E;;GAEG;AACH,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM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B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,YAAY,CAAC;IAcxB,yDAAyD;IACnD,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CASjB"}
@@ -0,0 +1,21 @@
1
+ import type { CoreClient, RequestOptions } from '../client.js';
2
+ import type { SendDirectAgentMessageParams, SendDirectAgentMessageResponse, SendDirectRunMessageParams, SendDirectRunMessageResponse } from '../types/channels.js';
3
+ /**
4
+ * Send direct messages to agents and runs via named channels.
5
+ *
6
+ * Use `sendDirectAgentMessage` to start a new task by messaging an agent, and
7
+ * `sendDirectRunMessage` to send follow-up input to an existing run (e.g.
8
+ * follow-up, steer, or interrupt).
9
+ */
10
+ export declare class Channels {
11
+ private readonly client;
12
+ constructor(client: CoreClient);
13
+ /** Send a message to an agent, creating a new task. Equivalent to tasks.create via the direct channel. */
14
+ sendDirectAgentMessage(workspaceId: string, agentId: string, params: SendDirectAgentMessageParams, options?: RequestOptions): Promise<SendDirectAgentMessageResponse>;
15
+ /**
16
+ * Send a follow-up message to an active run. The `queueMode` controls
17
+ * delivery: `followup`, `steer`, `interrupt`, or `queue`.
18
+ */
19
+ sendDirectRunMessage(workspaceId: string, runId: string, params: SendDirectRunMessageParams, options?: RequestOptions): Promise<SendDirectRunMessageResponse>;
20
+ }
21
+ //# sourceMappingURL=channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../../src/resources/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAG9B;;;;;;GAMG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,0GAA0G;IACpG,sBAAsB,CAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,8BAA8B,CAAC;IAyB1C;;;OAGG;IACG,oBAAoB,CACxB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,4BAA4B,CAAC;CAczC"}
@@ -1,50 +1,19 @@
1
1
  import type { CoreClient, RequestOptions } from '../client.js';
2
2
  import type { Connection, ConnectionCreateParams } from '../types/connections.js';
3
3
  /**
4
- * Manage connections (integrations) within a workspace.
4
+ * Manage integration connections within a workspace.
5
5
  *
6
- * Connections store OAuth tokens or API keys for external services like
7
- * Gmail, GitHub, Notion, etc. Pass existing tokens directly to avoid
8
- * requiring users to re-authenticate.
9
- *
10
- * @example
11
- * ```ts
12
- * await airstore.connections.create("ws_abc", {
13
- * integrationType: "gmail",
14
- * accessToken: existingAccessToken,
15
- * refreshToken: existingRefreshToken,
16
- * });
17
- * ```
6
+ * Connections store OAuth tokens or API keys for external services
7
+ * (Gmail, GitHub, Notion, etc.).
18
8
  */
19
9
  export declare class Connections {
20
10
  private readonly client;
21
11
  constructor(client: CoreClient);
22
- /**
23
- * Create a connection by passing existing OAuth credentials or API keys.
24
- *
25
- * @param workspaceId - Workspace external ID.
26
- * @param params - Connection creation parameters.
27
- * @param options - Per-request overrides.
28
- * @returns The created connection.
29
- */
12
+ /** Create a connection by passing existing OAuth credentials or an API key. */
30
13
  create(workspaceId: string, params: ConnectionCreateParams, options?: RequestOptions): Promise<Connection>;
31
- /**
32
- * List all connections in a workspace.
33
- *
34
- * @param workspaceId - Workspace external ID.
35
- * @param options - Per-request overrides.
36
- * @returns Array of connections.
37
- */
14
+ /** List all connections in a workspace. */
38
15
  list(workspaceId: string, options?: RequestOptions): Promise<Connection[]>;
39
- /**
40
- * Delete a connection.
41
- *
42
- * @param workspaceId - Workspace external ID.
43
- * @param connectionId - Connection external ID.
44
- * @param options - Per-request overrides.
45
- *
46
- * @throws {NotFoundError} If the connection doesn't exist.
47
- */
16
+ /** Delete a connection. */
48
17
  del(workspaceId: string, connectionId: string, options?: RequestOptions): Promise<void>;
49
18
  }
50
19
  //# sourceMappingURL=connections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/resources/connections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAElF;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;;;;;OAOG;IACG,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC;IAmBtB;;;;;;OAMG;IACG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAWhF;;;;;;;;OAQG;IACG,GAAG,CACP,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CASjB"}
1
+ {"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/resources/connections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAElF;;;;;GAKG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,+EAA+E;IACzE,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC;IAmBtB,2CAA2C;IACrC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAWhF,2BAA2B;IACrB,GAAG,CACP,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CASjB"}
@@ -5,43 +5,17 @@ import type { VirtualFile, TreeListing } from '../types/filesystem.js';
5
5
  *
6
6
  * The filesystem provides a unified view of all connected integrations,
7
7
  * source views, tools, and user-uploaded files.
8
- *
9
- * @example
10
- * ```ts
11
- * const listing = await airstore.fs.list("ws_abc", { path: "/" });
12
- * const content = await airstore.fs.read("ws_abc", {
13
- * path: "/sources/gmail/inbox/email.txt",
14
- * });
15
- * ```
16
8
  */
17
9
  export declare class Filesystem {
18
10
  private readonly client;
19
11
  constructor(client: CoreClient);
20
- /**
21
- * List directory contents.
22
- *
23
- * @param workspaceId - Workspace external ID.
24
- * @param opts - Listing options.
25
- * @param opts.path - Directory path to list. Defaults to root.
26
- * @param options - Per-request overrides.
27
- * @returns Array of files and directories.
28
- */
12
+ /** List directory contents at the given path (defaults to root). */
29
13
  list(workspaceId: string, opts?: {
30
14
  path?: string;
31
15
  }, options?: RequestOptions): Promise<VirtualFile[]>;
32
16
  /**
33
- * Read file contents as a string.
34
- *
35
- * @param workspaceId - Workspace external ID.
36
- * @param opts - Read options.
37
- * @param opts.path - File path to read.
38
- * @param opts.offset - Byte offset to start reading from.
39
- * @param opts.length - Number of bytes to read.
40
- * @param opts.compression - Compression strategy: 'strip', 'distill', or 'chain'. Omit to disable.
41
- * @param options - Per-request overrides.
42
- * @returns File contents as a string.
43
- *
44
- * @throws {NotFoundError} If the file doesn't exist.
17
+ * Read file contents as a string. Supports byte-range reads
18
+ * (`offset`/`length`) and server-side compression strategies.
45
19
  */
46
20
  read(workspaceId: string, opts: {
47
21
  path: string;
@@ -49,35 +23,13 @@ export declare class Filesystem {
49
23
  length?: number;
50
24
  compression?: 'strip' | 'distill' | 'chain';
51
25
  }, options?: RequestOptions): Promise<string>;
52
- /**
53
- * Get a directory tree for efficient prefetching.
54
- *
55
- * Returns a flat list of all entries under the given path. Supports
56
- * pagination via `continuationToken` for large directories.
57
- *
58
- * @param workspaceId - Workspace external ID.
59
- * @param opts - Tree options.
60
- * @param opts.path - Root path for the tree. Defaults to root.
61
- * @param opts.maxKeys - Maximum number of entries to return.
62
- * @param opts.continuationToken - Token from a previous truncated response.
63
- * @param options - Per-request overrides.
64
- * @returns Tree listing with entries and pagination info.
65
- */
26
+ /** Get a flat directory tree. Supports pagination via `continuationToken`. */
66
27
  tree(workspaceId: string, opts?: {
67
28
  path?: string;
68
29
  maxKeys?: number;
69
30
  continuationToken?: string;
70
31
  }, options?: RequestOptions): Promise<TreeListing>;
71
- /**
72
- * Get file or directory metadata.
73
- *
74
- * @param workspaceId - Workspace external ID.
75
- * @param path - Absolute path to stat.
76
- * @param options - Per-request overrides.
77
- * @returns File metadata.
78
- *
79
- * @throws {NotFoundError} If the path doesn't exist.
80
- */
32
+ /** Get file or directory metadata. */
81
33
  stat(workspaceId: string, path: string, options?: RequestOptions): Promise<VirtualFile>;
82
34
  }
83
35
  //# sourceMappingURL=filesystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../src/resources/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UA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EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAoB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEzF;;;;;GAKG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,oEAAoE;IAC9D,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,EAAE,CAAC;IAczB;;;OAGG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;KAC7C,EACD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC;IAclB,8EAA8E;IACxE,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAO,EAC1E,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC;IAiBvB,sCAAsC;IAChC,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC;CASxB"}
@@ -0,0 +1,5 @@
1
+ import type { InputProvenance, RoutingContext, RunExecutionPolicy } from '../types/tasks.js';
2
+ export declare function toRoutingBody(routing: RoutingContext | undefined): Record<string, unknown>;
3
+ export declare function toInputProvenanceBody(provenance: InputProvenance | undefined): Record<string, unknown> | undefined;
4
+ export declare function toPolicyBody(policy: RunExecutionPolicy | undefined): Record<string, unknown> | undefined;
5
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/resources/helpers.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE7F,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAc1F;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,eAAe,GAAG,SAAS,GACtC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CASrC;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAgBrC"}
@@ -0,0 +1,23 @@
1
+ import type { CoreClient, RequestOptions } from '../client.js';
2
+ import type { Hook, HookCreateParams, HookUpdateParams } from '../types/hooks.js';
3
+ /**
4
+ * CRUD operations for file-system hooks within a workspace.
5
+ *
6
+ * A hook watches a source view folder for file events (create, write, delete)
7
+ * and automatically submits a task to an agent with the configured prompt.
8
+ */
9
+ export declare class Hooks {
10
+ private readonly client;
11
+ constructor(client: CoreClient);
12
+ /** Create a hook on a source view folder path. */
13
+ create(workspaceId: string, params: HookCreateParams, options?: RequestOptions): Promise<Hook>;
14
+ /** List all hooks in a workspace. */
15
+ list(workspaceId: string, options?: RequestOptions): Promise<Hook[]>;
16
+ /** Retrieve a single hook by ID. */
17
+ retrieve(workspaceId: string, hookId: string, options?: RequestOptions): Promise<Hook>;
18
+ /** Update a hook. Only provided fields are changed. Set `active: false` to disable. */
19
+ update(workspaceId: string, hookId: string, params: HookUpdateParams, options?: RequestOptions): Promise<Hook>;
20
+ /** Delete a hook permanently. */
21
+ delete(workspaceId: string, hookId: string, options?: RequestOptions): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/resources/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAElF;;;;;GAKG;AACH,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,kDAAkD;IAC5C,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IAmChB,qCAAqC;IAC/B,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,EAAE,CAAC;IAUlB,oCAAoC;IAC9B,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IAUhB,uFAAuF;IACjF,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IA8BhB,iCAAiC;IAC3B,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CASjB"}
@@ -8,4 +8,6 @@ export { Filesystem } from './filesystem.js';
8
8
  export { Agents } from './agents.js';
9
9
  export { Tasks } from './tasks.js';
10
10
  export { Runs } from './runs.js';
11
+ export { Channels } from './channels.js';
12
+ export { Hooks } from './hooks.js';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
@@ -5,45 +5,15 @@ import type { Member, MemberCreateParams } from '../types/members.js';
5
5
  *
6
6
  * Members are users with roles (admin, member, viewer) in a workspace.
7
7
  * Tokens are always associated with a member.
8
- *
9
- * @example
10
- * ```ts
11
- * const member = await airstore.members.create("ws_abc", {
12
- * email: "agent@internal",
13
- * name: "Agent",
14
- * role: "member",
15
- * });
16
- * ```
17
8
  */
18
9
  export declare class Members {
19
10
  private readonly client;
20
11
  constructor(client: CoreClient);
21
- /**
22
- * Add a member to a workspace.
23
- *
24
- * @param workspaceId - Workspace external ID.
25
- * @param params - Member creation parameters.
26
- * @param options - Per-request overrides.
27
- * @returns The created member.
28
- */
12
+ /** Add a member to a workspace. */
29
13
  create(workspaceId: string, params: MemberCreateParams, options?: RequestOptions): Promise<Member>;
30
- /**
31
- * List members of a workspace.
32
- *
33
- * @param workspaceId - Workspace external ID.
34
- * @param options - Per-request overrides.
35
- * @returns Array of members.
36
- */
14
+ /** List members of a workspace. */
37
15
  list(workspaceId: string, options?: RequestOptions): Promise<Member[]>;
38
- /**
39
- * Remove a member from a workspace.
40
- *
41
- * @param workspaceId - Workspace external ID.
42
- * @param memberId - Member external ID.
43
- * @param options - Per-request overrides.
44
- *
45
- * @throws {NotFoundError} If the member doesn't exist.
46
- */
16
+ /** Remove a member from a workspace. */
47
17
  del(workspaceId: string, memberId: string, options?: RequestOptions): Promise<void>;
48
18
  }
49
19
  //# sourceMappingURL=members.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;;;;;OAOG;IACG,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC;IAclB;;;;;;OAMG;IACG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAU5E;;;;;;;;OAQG;IACG,GAAG,CACP,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CASjB"}
1
+ {"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;;;GAKG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,mCAAmC;IAC7B,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC;IAclB,mCAAmC;IAC7B,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAU5E,wCAAwC;IAClC,GAAG,CACP,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CASjB"}
@@ -5,53 +5,18 @@ import type { OAuthSession, OAuthSessionCreateParams, OAuthSessionStatus, OAuthP
5
5
  *
6
6
  * Use this when you want users to authorize via browser redirect
7
7
  * rather than passing tokens directly.
8
- *
9
- * @example
10
- * ```ts
11
- * const session = await airstore.oauth.createSession({
12
- * integrationType: "gmail",
13
- * returnTo: "https://myapp.com/callback",
14
- * });
15
- * console.log(session.authorize_url); // redirect user here
16
- * const completed = await airstore.oauth.poll(session.session_id);
17
- * ```
18
8
  */
19
9
  export declare class OAuth {
20
10
  private readonly client;
21
11
  constructor(client: CoreClient);
22
12
  /**
23
- * Create an OAuth session to initiate the authorization flow.
24
- *
25
- * Returns a session with an `authorize_url` that the user should be
26
- * redirected to. Once they complete authorization, poll the session
27
- * for the resulting connection ID.
28
- *
29
- * @param params - Session creation parameters.
30
- * @param options - Per-request overrides.
31
- * @returns The session with authorize_url to redirect the user to.
13
+ * Create an OAuth session. Returns a session with an `authorize_url`
14
+ * that the user should be redirected to.
32
15
  */
33
16
  createSession(params: OAuthSessionCreateParams, options?: RequestOptions): Promise<OAuthSession>;
34
- /**
35
- * Get the current status of an OAuth session.
36
- *
37
- * @param sessionId - Session ID from createSession.
38
- * @param options - Per-request overrides.
39
- * @returns The session status.
40
- */
17
+ /** Get the current status of an OAuth session. */
41
18
  getSession(sessionId: string, options?: RequestOptions): Promise<OAuthSessionStatus>;
42
- /**
43
- * Poll an OAuth session until completion or timeout.
44
- *
45
- * Repeatedly checks session status at the specified interval until
46
- * the session completes, errors, or the timeout is reached.
47
- *
48
- * @param sessionId - Session ID from createSession.
49
- * @param pollOpts - Polling configuration (timeout, interval).
50
- * @param options - Per-request overrides.
51
- * @returns The completed session status with connection_id.
52
- *
53
- * @throws {AirstoreError} If the session errors or times out.
54
- */
19
+ /** Poll an OAuth session until completion, error, or timeout. */
55
20
  poll(sessionId: string, pollOpts?: OAuthPollOptions, options?: RequestOptions): Promise<OAuthSessionStatus>;
56
21
  }
57
22
  //# sourceMappingURL=oauth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/resources/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,YAAY,EACZ,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAG3B;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;;;;;;;;OAUG;IACG,aAAa,CACjB,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,YAAY,CAAC;IAgBxB;;;;;;OAMG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;IAU9B;;;;;;;;;;;;OAYG;IACG,IAAI,CACR,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;CAoB/B"}
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/resources/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,YAAY,EACZ,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAG3B;;;;;GAKG;AACH,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;OAGG;IACG,aAAa,CACjB,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,YAAY,CAAC;IAgBxB,kDAAkD;IAC5C,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;IAU9B,iEAAiE;IAC3D,IAAI,CACR,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;CAoB/B"}
@@ -1,17 +1,25 @@
1
- import type { CoreClient, RequestOptions } from '../client.js';
2
- import type { AgentRun, AgentRunSnapshot, RunCancelResponse, RunInputParams } from '../types/runs.js';
3
- import type { TaskAcceptedResponse } from '../types/tasks.js';
1
+ import { type CoreClient, type RequestOptions } from '../client.js';
2
+ import type { AgentRun, RunListParams, RunListResponse, AgentRunSnapshot, RunCancelResponse } from '../types/runs.js';
4
3
  /**
5
- * Read and control run lifecycle state (snapshots, events).
4
+ * Read and manage the lifecycle of agent runs.
5
+ *
6
+ * A run is the actual execution instance spawned by a task. Use this resource
7
+ * to inspect run status, list snapshots (intermediate state), retrieve
8
+ * execution events, or cancel a running execution.
6
9
  */
7
10
  export declare class Runs {
8
11
  private readonly client;
9
12
  constructor(client: CoreClient);
10
- list(workspaceId: string, options?: RequestOptions): Promise<AgentRun[]>;
13
+ /** List runs with optional filters (agent, status, session, date range) and cursor pagination. */
14
+ list(workspaceId: string, options?: RequestOptions): Promise<RunListResponse>;
15
+ list(workspaceId: string, params?: RunListParams, options?: RequestOptions): Promise<RunListResponse>;
16
+ /** Retrieve a single run by ID. */
11
17
  retrieve(workspaceId: string, runId: string, options?: RequestOptions): Promise<AgentRun>;
18
+ /** List snapshots (intermediate state captures) for a run, ordered by sequence number. */
12
19
  listSnapshots(workspaceId: string, runId: string, options?: RequestOptions): Promise<AgentRunSnapshot[]>;
20
+ /** List execution events emitted during a run. */
13
21
  listEvents(workspaceId: string, runId: string, options?: RequestOptions): Promise<Array<Record<string, unknown>>>;
14
- input(workspaceId: string, runId: string, params: RunInputParams, options?: RequestOptions): Promise<TaskAcceptedResponse>;
22
+ /** Cancel an active run. */
15
23
  cancel(workspaceId: string, runId: string, options?: RequestOptions): Promise<RunCancelResponse>;
16
24
  }
17
25
  //# sourceMappingURL=runs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../../src/resources/runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,qBAAa,IAAI;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAUxE,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC;IAUd,aAAa,CACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAUxB,UAAU,CACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAUpC,KAAK,CACT,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,oBAAoB,CAAC;IAc1B,MAAM,CACV,WAAW,EAAE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,EACb,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,iBAAiB,CAAC;CAS9B"}
@@ -1,12 +1,46 @@
1
1
  import type { CoreClient, RequestOptions } from '../client.js';
2
- import type { AgentCommandCreateParams, AgentTask, TaskAcceptedResponse } from '../types/tasks.js';
2
+ import type { AgentCommandCreateParams, AgentTask, TaskCancelResponse, TaskAcceptedResponse, TaskArchiveResponse, TaskListParams, TaskListResponse, TaskLogListParams, TaskLogListResponse, TaskEventStreamParams, TaskEventBatch, Schedule, ScheduleCreateParams, ScheduleUpdateParams } from '../types/tasks.js';
3
3
  /**
4
- * Task APIs for agents.
4
+ * Create, list, and manage agent tasks and their cron schedules.
5
+ *
6
+ * A task is a unit of intent sent to an agent. Creating a task triggers the
7
+ * orchestrator to dispatch a run. Tasks support idempotency, cancellation,
8
+ * archival, log streaming, and cron-based scheduling.
5
9
  */
6
10
  export declare class Tasks {
7
11
  private readonly client;
8
12
  constructor(client: CoreClient);
13
+ /**
14
+ * Submit a new task to an agent. Returns an accepted response containing the
15
+ * task and, when immediately dispatched, a `run_id`. Duplicate submissions
16
+ * with the same `idempotencyKey` return the original task.
17
+ */
9
18
  create(workspaceId: string, params: AgentCommandCreateParams, options?: RequestOptions): Promise<TaskAcceptedResponse>;
19
+ /** Retrieve a single task by ID. */
10
20
  retrieve(workspaceId: string, taskId: string, options?: RequestOptions): Promise<AgentTask>;
21
+ /** List tasks with optional filters (state, agent, date range) and cursor pagination. */
22
+ list(workspaceId: string, params?: TaskListParams, options?: RequestOptions): Promise<TaskListResponse>;
23
+ /** Fetch execution logs for a task. Pass `cursor` for incremental reads. */
24
+ listLogs(workspaceId: string, taskId: string, params?: TaskLogListParams, options?: RequestOptions): Promise<TaskLogListResponse>;
25
+ /**
26
+ * Poll a composite event stream for a task: the current task/run state,
27
+ * new log entries, run events, and pending inputs in a single batch.
28
+ */
29
+ streamEvents(workspaceId: string, taskId: string, params?: TaskEventStreamParams, options?: RequestOptions): Promise<TaskEventBatch>;
30
+ /** Cancel a running task and its active run. */
31
+ cancel(workspaceId: string, taskId: string, options?: RequestOptions): Promise<TaskCancelResponse>;
32
+ /** Archive an idle or terminal task so it no longer appears in active listings. */
33
+ archive(workspaceId: string, taskId: string, options?: RequestOptions): Promise<TaskArchiveResponse>;
34
+ private schedulePath;
35
+ /** Create a cron schedule that periodically submits a task to an agent. */
36
+ createSchedule(workspaceId: string, params: ScheduleCreateParams, options?: RequestOptions): Promise<Schedule>;
37
+ /** List all cron schedules in a workspace. */
38
+ listSchedules(workspaceId: string, options?: RequestOptions): Promise<Schedule[]>;
39
+ /** Retrieve a single schedule by ID. */
40
+ retrieveSchedule(workspaceId: string, scheduleId: string, options?: RequestOptions): Promise<Schedule>;
41
+ /** Update a schedule. Only provided fields are changed. Set `active: false` to pause. */
42
+ updateSchedule(workspaceId: string, scheduleId: string, params: ScheduleUpdateParams, options?: RequestOptions): Promise<Schedule>;
43
+ /** Permanently delete a schedule. */
44
+ deleteSchedule(workspaceId: string, scheduleId: string, options?: RequestOptions): Promise<void>;
11
45
  }
12
46
  //# sourceMappingURL=tasks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/resources/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAU/D,OAAO,KAAK,EACV,wBAAwB,EACxB,SAAS,EAET,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,oBAAoB,CAAC;IA0B1B,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,E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