@airstore/sdk 0.1.1 → 0.1.4

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 (109) hide show
  1. package/README.md +108 -12
  2. package/dist/cjs/airstore.js +42 -69
  3. package/dist/cjs/airstore.js.map +1 -1
  4. package/dist/cjs/index.js +46 -3
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/resources/access-log.js +101 -0
  7. package/dist/cjs/resources/access-log.js.map +1 -0
  8. package/dist/cjs/resources/agents.js +28 -0
  9. package/dist/cjs/resources/agents.js.map +1 -0
  10. package/dist/cjs/resources/filesystem.js +5 -2
  11. package/dist/cjs/resources/filesystem.js.map +1 -1
  12. package/dist/cjs/resources/index.js +9 -3
  13. package/dist/cjs/resources/index.js.map +1 -1
  14. package/dist/cjs/resources/runs.js +36 -0
  15. package/dist/cjs/resources/runs.js.map +1 -0
  16. package/dist/cjs/resources/tasks.js +82 -0
  17. package/dist/cjs/resources/tasks.js.map +1 -0
  18. package/dist/cjs/resources/views.js +107 -0
  19. package/dist/cjs/resources/views.js.map +1 -0
  20. package/dist/cjs/resources/workspaces.js +1 -1
  21. package/dist/cjs/types/{smart-folders.js → access-log.js} +1 -1
  22. package/dist/cjs/types/access-log.js.map +1 -0
  23. package/dist/cjs/types/agents.js +3 -0
  24. package/dist/cjs/types/agents.js.map +1 -0
  25. package/dist/cjs/types/index.js +4 -1
  26. package/dist/cjs/types/index.js.map +1 -1
  27. package/dist/cjs/types/runs.js +3 -0
  28. package/dist/cjs/types/runs.js.map +1 -0
  29. package/dist/cjs/types/tasks.js +23 -0
  30. package/dist/cjs/types/tasks.js.map +1 -0
  31. package/dist/cjs/types/views.js +29 -0
  32. package/dist/cjs/types/views.js.map +1 -0
  33. package/dist/esm/airstore.js +42 -69
  34. package/dist/esm/airstore.js.map +1 -1
  35. package/dist/esm/index.js +8 -1
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/esm/resources/access-log.js +97 -0
  38. package/dist/esm/resources/access-log.js.map +1 -0
  39. package/dist/esm/resources/agents.js +24 -0
  40. package/dist/esm/resources/agents.js.map +1 -0
  41. package/dist/esm/resources/filesystem.js +5 -2
  42. package/dist/esm/resources/filesystem.js.map +1 -1
  43. package/dist/esm/resources/index.js +4 -1
  44. package/dist/esm/resources/index.js.map +1 -1
  45. package/dist/esm/resources/runs.js +32 -0
  46. package/dist/esm/resources/runs.js.map +1 -0
  47. package/dist/esm/resources/tasks.js +78 -0
  48. package/dist/esm/resources/tasks.js.map +1 -0
  49. package/dist/esm/resources/views.js +103 -0
  50. package/dist/esm/resources/views.js.map +1 -0
  51. package/dist/esm/resources/workspaces.js +1 -1
  52. package/dist/esm/types/access-log.js +2 -0
  53. package/dist/esm/types/access-log.js.map +1 -0
  54. package/dist/esm/types/agents.js +2 -0
  55. package/dist/esm/types/agents.js.map +1 -0
  56. package/dist/esm/types/index.js +4 -1
  57. package/dist/esm/types/index.js.map +1 -1
  58. package/dist/esm/types/runs.js +2 -0
  59. package/dist/esm/types/runs.js.map +1 -0
  60. package/dist/esm/types/tasks.js +20 -0
  61. package/dist/esm/types/tasks.js.map +1 -0
  62. package/dist/esm/types/views.js +26 -0
  63. package/dist/esm/types/views.js.map +1 -0
  64. package/dist/types/airstore.d.ts +37 -68
  65. package/dist/types/airstore.d.ts.map +1 -1
  66. package/dist/types/index.d.ts +12 -2
  67. package/dist/types/index.d.ts.map +1 -1
  68. package/dist/types/resources/access-log.d.ts +72 -0
  69. package/dist/types/resources/access-log.d.ts.map +1 -0
  70. package/dist/types/resources/agents.d.ts +13 -0
  71. package/dist/types/resources/agents.d.ts.map +1 -0
  72. package/dist/types/resources/filesystem.d.ts +4 -2
  73. package/dist/types/resources/filesystem.d.ts.map +1 -1
  74. package/dist/types/resources/index.d.ts +4 -1
  75. package/dist/types/resources/index.d.ts.map +1 -1
  76. package/dist/types/resources/runs.d.ts +17 -0
  77. package/dist/types/resources/runs.d.ts.map +1 -0
  78. package/dist/types/resources/tasks.d.ts +12 -0
  79. package/dist/types/resources/tasks.d.ts.map +1 -0
  80. package/dist/types/resources/views.d.ts +66 -0
  81. package/dist/types/resources/views.d.ts.map +1 -0
  82. package/dist/types/resources/workspaces.d.ts +1 -1
  83. package/dist/types/types/access-log.d.ts +123 -0
  84. package/dist/types/types/access-log.d.ts.map +1 -0
  85. package/dist/types/types/agents.d.ts +17 -0
  86. package/dist/types/types/agents.d.ts.map +1 -0
  87. package/dist/types/types/index.d.ts +4 -1
  88. package/dist/types/types/index.d.ts.map +1 -1
  89. package/dist/types/types/runs.d.ts +50 -0
  90. package/dist/types/types/runs.d.ts.map +1 -0
  91. package/dist/types/types/shared.d.ts +1 -1
  92. package/dist/types/types/shared.d.ts.map +1 -1
  93. package/dist/types/types/tasks.d.ts +104 -0
  94. package/dist/types/types/tasks.d.ts.map +1 -0
  95. package/dist/types/types/views.d.ts +207 -0
  96. package/dist/types/types/views.d.ts.map +1 -0
  97. package/dist/types/types/workspaces.d.ts +1 -1
  98. package/package.json +7 -2
  99. package/dist/cjs/resources/smart-folders.js +0 -102
  100. package/dist/cjs/resources/smart-folders.js.map +0 -1
  101. package/dist/cjs/types/smart-folders.js.map +0 -1
  102. package/dist/esm/resources/smart-folders.js +0 -98
  103. package/dist/esm/resources/smart-folders.js.map +0 -1
  104. package/dist/esm/types/smart-folders.js +0 -2
  105. package/dist/esm/types/smart-folders.js.map +0 -1
  106. package/dist/types/resources/smart-folders.d.ts +0 -70
  107. package/dist/types/resources/smart-folders.d.ts.map +0 -1
  108. package/dist/types/types/smart-folders.d.ts +0 -45
  109. package/dist/types/types/smart-folders.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @airstore/sdk
2
2
 
3
- Official TypeScript SDK for the [Airstore](https://airstore.ai) API. Provision workspaces, manage connections, configure smart folders, and generate mount tokens — all from your backend.
3
+ Official TypeScript SDK for the [Airstore](https://airstore.ai) API. Provision workspaces, manage connections, configure source views, and generate mount tokens — all from your backend.
4
4
 
5
5
  ## Installation
6
6
 
@@ -51,8 +51,8 @@ async function provisionUser(
51
51
  refreshToken: gmailTokens.refreshToken,
52
52
  });
53
53
 
54
- // 4. Set up smart folders for what the agent should see
55
- await airstore.smartFolders.create(ws.external_id, {
54
+ // 4. Set up source views for what the agent should see
55
+ await airstore.views.create(ws.external_id, {
56
56
  integration: 'gmail',
57
57
  name: 'Recent Emails',
58
58
  guidance: 'Last 7 days of emails from the inbox',
@@ -143,32 +143,128 @@ const connections = await airstore.connections.list('ws_abc123');
143
143
  await airstore.connections.del('ws_abc123', 'conn_abc123');
144
144
  ```
145
145
 
146
- ### Smart Folders
146
+ ### Agents, Tasks, Runs
147
+
148
+ These APIs are workspace-scoped and split into:
149
+
150
+ - `agents`: persistent profile/config.
151
+ - `tasks`: accepted-first task ingress with idempotency.
152
+ - `runs`: execution lifecycle and snapshot/event introspection.
153
+
154
+ Flow is:
155
+
156
+ 1. submit a task,
157
+ 2. materialize a run,
158
+ 3. observe lifecycle via run state, snapshots, and events.
147
159
 
148
160
  ```typescript
149
- // Create
150
- const folder = await airstore.smartFolders.create('ws_abc123', {
161
+ // 1) Create an agent profile
162
+ const agent = await airstore.agents.create('ws_abc123', {
163
+ agentKey: 'support-agent',
164
+ name: 'Support Agent',
165
+ config: { model: 'claude-sonnet-4' },
166
+ });
167
+
168
+ // 2) Submit a task intent (not a direct worker execution)
169
+ const accepted = await airstore.tasks.create('ws_abc123', {
170
+ message: 'Summarize the latest support tickets',
171
+ // sessionId optional (server generates UUID when omitted)
172
+ agentId: agent.id,
173
+ // idempotencyKey optional (server generates UUID when omitted)
174
+ // provide one if you need deterministic replay semantics
175
+ idempotencyKey: 'idem-abc',
176
+ timeoutMs: 120_000,
177
+ policy: {
178
+ host: 'sandbox',
179
+ security: 'allowlist',
180
+ ask: 'off',
181
+ runtimeType: 'gvisor',
182
+ workspaceAccess: 'rw',
183
+ networkEnabled: true,
184
+ interactive: false,
185
+ resources: { cpu: 1000, memory: 2 * 1024 * 1024 * 1024 },
186
+ retry: { maxAttempts: 2, delayMs: 0 },
187
+ },
188
+ });
189
+
190
+ // 3) Resolve and poll the run
191
+ const runId = accepted.run_id ?? accepted.task.target_run_id;
192
+ if (runId) {
193
+ const run = await airstore.runs.retrieve('ws_abc123', runId);
194
+ const snapshots = await airstore.runs.listSnapshots('ws_abc123', runId);
195
+ const events = await airstore.runs.listEvents('ws_abc123', runId);
196
+ }
197
+ ```
198
+
199
+ `runs.input(...)` supports queue modes: `queue`, `followup`, `steer`, `steer-backlog`, `interrupt` (`steer-backlog` is normalized to `steer` server-side for MVP behavior).
200
+ `idempotencyKey` is optional for `runs.input(...)` and is generated by the backend when omitted.
201
+
202
+ ### Source Views
203
+
204
+ Source views come in two modes: **smart** (LLM-inferred from natural language) and **query** (structured per-integration filters).
205
+
206
+ ```typescript
207
+ // Smart mode — describe what you want in natural language
208
+ const view = await airstore.views.create('ws_abc123', {
151
209
  integration: 'gmail',
152
210
  name: 'Important Emails',
153
211
  guidance: 'Emails marked as important from the last month',
154
212
  outputFormat: 'folder', // or 'file'
155
213
  });
156
214
 
215
+ // Query mode — auto-detected when filter is provided
216
+ const view2 = await airstore.views.create('ws_abc123', {
217
+ integration: 'gmail',
218
+ name: 'Unread from boss',
219
+ filter: { from: 'boss@company.com', is_unread: true },
220
+ });
221
+
222
+ // Query mode with GitHub content types
223
+ const prView = await airstore.views.create('ws_abc123', {
224
+ integration: 'github',
225
+ name: 'Open PRs',
226
+ filter: {
227
+ repo: 'acme/api',
228
+ type: 'prs',
229
+ state: 'open',
230
+ content_type: 'diff', // 'markdown' | 'diff' | 'json' | 'raw'
231
+ },
232
+ });
233
+
157
234
  // List all
158
- const folders = await airstore.smartFolders.list('ws_abc123');
235
+ const views = await airstore.views.list('ws_abc123');
159
236
 
160
237
  // Retrieve by path
161
- const folder = await airstore.smartFolders.retrieve('ws_abc123', '/Sources/gmail/Important Emails');
238
+ const found = await airstore.views.retrieve('ws_abc123', '/sources/gmail/Important Emails');
162
239
 
163
240
  // Update
164
- const updated = await airstore.smartFolders.update('ws_abc123', 'query_abc', {
241
+ const updated = await airstore.views.update('ws_abc123', 'view_abc', {
165
242
  guidance: 'Updated guidance text',
166
243
  });
167
244
 
245
+ // Sync — re-execute the query and refresh cached files
246
+ const result = await airstore.views.sync('ws_abc123', 'view_abc');
247
+ console.log(`${result.results_count} total, ${result.new_results} new`);
248
+
168
249
  // Delete
169
- await airstore.smartFolders.del('ws_abc123', 'query_abc');
250
+ await airstore.views.del('ws_abc123', 'view_abc');
170
251
  ```
171
252
 
253
+ #### Per-integration filter fields
254
+
255
+ Each integration accepts a typed filter object:
256
+
257
+ | Integration | Key fields |
258
+ |---|---|
259
+ | `gmail` | `from`, `to`, `subject`, `label`, `newer_than`, `older_than`, `has_attachment`, `is_unread`, `is_starred` |
260
+ | `github` | `repo` (required), `type`, `state`, `label`, `author`, `content_type` |
261
+ | `gdrive` | `name_contains`, `mime_type`, `shared_with_me`, `starred`, `modified_after`, `modified_before`, `folder_id` |
262
+ | `notion` | `search` |
263
+ | `slack` | `channel`, `from`, `after`, `before`, `has_link`, `has_reaction` |
264
+ | `linear` | `type`, `team`, `state`, `assignee`, `priority`, `label` |
265
+ | `posthog` | `type`, `query`, `project_id` |
266
+ | `web` | `mode`, `url`, `query`, `include_paths` |
267
+
172
268
  ### Tokens
173
269
 
174
270
  ```typescript
@@ -237,7 +333,7 @@ const entries = await airstore.fs.list('ws_abc123', { path: '/' });
237
333
 
238
334
  // Read file contents
239
335
  const content = await airstore.fs.read('ws_abc123', {
240
- path: '/Sources/gmail/inbox/email.txt',
336
+ path: '/sources/gmail/inbox/email.txt',
241
337
  });
242
338
 
243
339
  // Get directory tree
@@ -247,7 +343,7 @@ const tree = await airstore.fs.tree('ws_abc123', {
247
343
  });
248
344
 
249
345
  // Stat a file
250
- const meta = await airstore.fs.stat('ws_abc123', '/Sources/gmail/inbox/email.txt');
346
+ const meta = await airstore.fs.stat('ws_abc123', '/sources/gmail/inbox/email.txt');
251
347
  ```
252
348
 
253
349
  ## Per-Request Options
@@ -4,122 +4,95 @@ exports.Airstore = void 0;
4
4
  const client_js_1 = require("./client.js");
5
5
  const workspaces_js_1 = require("./resources/workspaces.js");
6
6
  const connections_js_1 = require("./resources/connections.js");
7
- const smart_folders_js_1 = require("./resources/smart-folders.js");
7
+ const views_js_1 = require("./resources/views.js");
8
8
  const tokens_js_1 = require("./resources/tokens.js");
9
9
  const members_js_1 = require("./resources/members.js");
10
10
  const oauth_js_1 = require("./resources/oauth.js");
11
11
  const filesystem_js_1 = require("./resources/filesystem.js");
12
+ const access_log_js_1 = require("./resources/access-log.js");
13
+ const agents_js_1 = require("./resources/agents.js");
14
+ const tasks_js_1 = require("./resources/tasks.js");
15
+ const runs_js_1 = require("./resources/runs.js");
12
16
  /**
13
17
  * The Airstore SDK client.
14
18
  *
15
- * Create an instance with your API key to interact with workspaces,
16
- * connections, smart folders, tokens, members, the virtual filesystem,
17
- * and OAuth sessions.
18
- *
19
19
  * @example Basic provisioning flow
20
20
  * ```ts
21
21
  * import Airstore from '@airstore/sdk';
22
22
  *
23
23
  * const airstore = new Airstore({ apiKey: 'org_...' });
24
24
  *
25
- * // 1. Create a workspace for a new user
25
+ * // 1. Create a workspace
26
26
  * const ws = await airstore.workspaces.create({ name: 'user-123' });
27
27
  *
28
- * // 2. Connect their Gmail with existing OAuth tokens
28
+ * // 2. Connect Gmail
29
29
  * await airstore.connections.create(ws.external_id, {
30
30
  * integrationType: 'gmail',
31
31
  * accessToken: existingAccessToken,
32
32
  * refreshToken: existingRefreshToken,
33
33
  * });
34
34
  *
35
- * // 3. Set up a smart folder
36
- * await airstore.smartFolders.create(ws.external_id, {
35
+ * // 3. Create a source view (smart mode — LLM-inferred)
36
+ * const view = await airstore.views.create(ws.external_id, {
37
37
  * integration: 'gmail',
38
38
  * name: 'Recent Emails',
39
39
  * guidance: 'Last 7 days of emails from the inbox',
40
40
  * });
41
41
  *
42
- * // 4. Generate a mount token for the user's VM
42
+ * // 4. Or create a source view (query mode structured filter)
43
+ * await airstore.views.create(ws.external_id, {
44
+ * integration: 'gmail',
45
+ * name: 'Unread from boss',
46
+ * filter: { from: 'boss@company.com', is_unread: true },
47
+ * });
48
+ *
49
+ * // 5. Sync a view to refresh its metadata
50
+ * const result = await airstore.views.sync(ws.external_id, view.external_id);
51
+ * console.log(result.results_count, result.new_results);
52
+ *
53
+ * // 6. Generate a mount token
43
54
  * const token = await airstore.tokens.create(ws.external_id, {
44
55
  * email: 'agent@internal',
45
56
  * name: 'vm-mount',
46
57
  * });
47
- * // Pass token.token to: airstore start --token <token>
48
- * ```
49
- *
50
- * @example Per-request options
51
- * ```ts
52
- * const ws = await airstore.workspaces.list({
53
- * timeout: 10_000,
54
- * maxRetries: 5,
55
- * });
56
58
  * ```
57
59
  */
58
60
  class Airstore extends client_js_1.CoreClient {
59
- /**
60
- * Manage workspaces.
61
- *
62
- * Workspaces are the top-level container for connections, smart folders,
63
- * members, and the virtual filesystem.
64
- */
61
+ /** Manage workspaces. */
65
62
  workspaces;
66
- /**
67
- * Manage connections (integrations) within a workspace.
68
- *
69
- * Pass existing OAuth tokens or API keys to connect external services
70
- * like Gmail, GitHub, Notion, etc.
71
- */
63
+ /** Manage connections (integrations) within a workspace. */
72
64
  connections;
73
- /**
74
- * Manage smart folders (filesystem queries).
75
- *
76
- * Smart folders use LLM inference to automatically organize and filter
77
- * data from connected integrations into virtual folders or files.
78
- */
79
- smartFolders;
80
- /**
81
- * Manage workspace-scoped authentication tokens.
82
- *
83
- * Tokens are used for CLI mounting and per-workspace programmatic access.
84
- */
65
+ /** Manage source views — materialized queries over connected data sources. */
66
+ views;
67
+ /** Manage workspace-scoped authentication tokens. */
85
68
  tokens;
86
- /**
87
- * Manage workspace members.
88
- *
89
- * Members are users with roles (admin, member, viewer) in a workspace.
90
- */
69
+ /** Manage workspace members. */
91
70
  members;
92
- /**
93
- * OAuth session management for interactive connection setup.
94
- *
95
- * Use this for browser-redirect flows where users authorize
96
- * integrations themselves.
97
- */
71
+ /** OAuth session management for interactive connection setup. */
98
72
  oauth;
99
- /**
100
- * Read-only access to the workspace virtual filesystem.
101
- *
102
- * Browse directories, read files, and inspect metadata across
103
- * all connected integrations.
104
- */
73
+ /** Read-only access to the workspace virtual filesystem. */
105
74
  fs;
106
- /**
107
- * Create a new Airstore SDK client.
108
- *
109
- * @param opts - Client configuration. At minimum, provide an `apiKey`
110
- * or set the `AIRSTORE_API_KEY` environment variable.
111
- *
112
- * @throws {AirstoreError} If no API key is provided.
113
- */
75
+ /** Query the workspace access log. */
76
+ accessLog;
77
+ /** Manage workspace agent profiles. */
78
+ agents;
79
+ /** Manage tasks (intent). */
80
+ tasks;
81
+ /** Read and control run lifecycle state. */
82
+ runs;
114
83
  constructor(opts) {
115
84
  super(opts);
116
85
  this.workspaces = new workspaces_js_1.Workspaces(this);
117
86
  this.connections = new connections_js_1.Connections(this);
118
- this.smartFolders = new smart_folders_js_1.SmartFolders(this);
87
+ this.views = new views_js_1.Views(this);
119
88
  this.tokens = new tokens_js_1.Tokens(this);
120
89
  this.members = new members_js_1.Members(this);
121
90
  this.oauth = new oauth_js_1.OAuth(this);
122
91
  this.fs = new filesystem_js_1.Filesystem(this);
92
+ this.accessLog = new access_log_js_1.AccessLog(this);
93
+ this.agents = new agents_js_1.Agents(this);
94
+ this.tasks = new tasks_js_1.Tasks(this);
95
+ this.runs = new runs_js_1.Runs(this);
123
96
  }
124
97
  }
125
98
  exports.Airstore = Airstore;
@@ -1 +1 @@
1
- {"version":3,"file":"airstore.js","sourceRoot":"","sources":["../../src/airstore.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAC7D,6DAAuD;AACvD,+DAAyD;AACzD,mEAA4D;AAC5D,qDAA+C;AAC/C,uDAAiD;AACjD,mDAA6C;AAC7C,6DAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAa,QAAS,SAAQ,sBAAU;IACtC;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
1
  "use strict";
2
2
  /** @module @airstore/sdk */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.VERSION = exports.Filesystem = exports.OAuth = exports.Members = exports.Tokens = exports.SmartFolders = exports.Connections = exports.Workspaces = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.InternalServerError = exports.RateLimitError = exports.UnprocessableEntityError = exports.ConflictError = exports.NotFoundError = exports.PermissionDeniedError = exports.AuthenticationError = exports.APIError = exports.AirstoreError = exports.default = exports.Airstore = void 0;
4
+ exports.GDriveMimeTypes = exports.GitHubContentTypes = exports.GitHubStates = exports.GitHubResourceTypes = exports.GmailLabels = exports.Integrations = exports.ViewModes = exports.RETRY_DEFAULT_DELAY_MS = exports.RETRY_DEFAULT_MAX_ATTEMPTS = exports.WORKSPACE_ACCESS_RW = exports.WORKSPACE_ACCESS_RO = exports.WORKSPACE_ACCESS_NONE = exports.RUNTIME_TYPE_RUNC = exports.RUNTIME_TYPE_GVISOR = exports.EXEC_ASK_ALWAYS = exports.EXEC_ASK_ON_MISS = exports.EXEC_ASK_OFF = exports.EXEC_SECURITY_FULL = exports.EXEC_SECURITY_ALLOWLIST = exports.EXEC_SECURITY_DENY = exports.EXEC_HOST_SANDBOX = exports.QUEUE_MODE_QUEUE = exports.QUEUE_MODE_INTERRUPT = exports.QUEUE_MODE_FOLLOWUP = exports.QUEUE_MODE_STEER_BACKLOG = exports.QUEUE_MODE_STEER = exports.Runs = exports.Tasks = exports.Agents = exports.AccessLog = exports.Filesystem = exports.OAuth = exports.Members = exports.Tokens = exports.Views = exports.Connections = exports.Workspaces = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.InternalServerError = exports.RateLimitError = exports.UnprocessableEntityError = exports.ConflictError = exports.NotFoundError = exports.PermissionDeniedError = exports.AuthenticationError = exports.APIError = exports.AirstoreError = exports.default = exports.Airstore = void 0;
5
+ exports.VERSION = exports.WebModes = exports.PostHogResourceTypes = exports.LinearPriorities = exports.LinearStates = exports.LinearResourceTypes = void 0;
5
6
  // ── Main client ──────────────────────────────────────────────────────────────
6
7
  var airstore_js_1 = require("./airstore.js");
7
8
  Object.defineProperty(exports, "Airstore", { enumerable: true, get: function () { return airstore_js_1.Airstore; } });
@@ -24,8 +25,8 @@ var workspaces_js_1 = require("./resources/workspaces.js");
24
25
  Object.defineProperty(exports, "Workspaces", { enumerable: true, get: function () { return workspaces_js_1.Workspaces; } });
25
26
  var connections_js_1 = require("./resources/connections.js");
26
27
  Object.defineProperty(exports, "Connections", { enumerable: true, get: function () { return connections_js_1.Connections; } });
27
- var smart_folders_js_1 = require("./resources/smart-folders.js");
28
- Object.defineProperty(exports, "SmartFolders", { enumerable: true, get: function () { return smart_folders_js_1.SmartFolders; } });
28
+ var views_js_1 = require("./resources/views.js");
29
+ Object.defineProperty(exports, "Views", { enumerable: true, get: function () { return views_js_1.Views; } });
29
30
  var tokens_js_1 = require("./resources/tokens.js");
30
31
  Object.defineProperty(exports, "Tokens", { enumerable: true, get: function () { return tokens_js_1.Tokens; } });
31
32
  var members_js_1 = require("./resources/members.js");
@@ -34,6 +35,48 @@ var oauth_js_1 = require("./resources/oauth.js");
34
35
  Object.defineProperty(exports, "OAuth", { enumerable: true, get: function () { return oauth_js_1.OAuth; } });
35
36
  var filesystem_js_1 = require("./resources/filesystem.js");
36
37
  Object.defineProperty(exports, "Filesystem", { enumerable: true, get: function () { return filesystem_js_1.Filesystem; } });
38
+ var access_log_js_1 = require("./resources/access-log.js");
39
+ Object.defineProperty(exports, "AccessLog", { enumerable: true, get: function () { return access_log_js_1.AccessLog; } });
40
+ var agents_js_1 = require("./resources/agents.js");
41
+ Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_js_1.Agents; } });
42
+ var tasks_js_1 = require("./resources/tasks.js");
43
+ Object.defineProperty(exports, "Tasks", { enumerable: true, get: function () { return tasks_js_1.Tasks; } });
44
+ var runs_js_1 = require("./resources/runs.js");
45
+ Object.defineProperty(exports, "Runs", { enumerable: true, get: function () { return runs_js_1.Runs; } });
46
+ // ── Typed constants ───────────────────────────────────────────────────────────
47
+ var tasks_js_2 = require("./types/tasks.js");
48
+ Object.defineProperty(exports, "QUEUE_MODE_STEER", { enumerable: true, get: function () { return tasks_js_2.QUEUE_MODE_STEER; } });
49
+ Object.defineProperty(exports, "QUEUE_MODE_STEER_BACKLOG", { enumerable: true, get: function () { return tasks_js_2.QUEUE_MODE_STEER_BACKLOG; } });
50
+ Object.defineProperty(exports, "QUEUE_MODE_FOLLOWUP", { enumerable: true, get: function () { return tasks_js_2.QUEUE_MODE_FOLLOWUP; } });
51
+ Object.defineProperty(exports, "QUEUE_MODE_INTERRUPT", { enumerable: true, get: function () { return tasks_js_2.QUEUE_MODE_INTERRUPT; } });
52
+ Object.defineProperty(exports, "QUEUE_MODE_QUEUE", { enumerable: true, get: function () { return tasks_js_2.QUEUE_MODE_QUEUE; } });
53
+ Object.defineProperty(exports, "EXEC_HOST_SANDBOX", { enumerable: true, get: function () { return tasks_js_2.EXEC_HOST_SANDBOX; } });
54
+ Object.defineProperty(exports, "EXEC_SECURITY_DENY", { enumerable: true, get: function () { return tasks_js_2.EXEC_SECURITY_DENY; } });
55
+ Object.defineProperty(exports, "EXEC_SECURITY_ALLOWLIST", { enumerable: true, get: function () { return tasks_js_2.EXEC_SECURITY_ALLOWLIST; } });
56
+ Object.defineProperty(exports, "EXEC_SECURITY_FULL", { enumerable: true, get: function () { return tasks_js_2.EXEC_SECURITY_FULL; } });
57
+ Object.defineProperty(exports, "EXEC_ASK_OFF", { enumerable: true, get: function () { return tasks_js_2.EXEC_ASK_OFF; } });
58
+ Object.defineProperty(exports, "EXEC_ASK_ON_MISS", { enumerable: true, get: function () { return tasks_js_2.EXEC_ASK_ON_MISS; } });
59
+ Object.defineProperty(exports, "EXEC_ASK_ALWAYS", { enumerable: true, get: function () { return tasks_js_2.EXEC_ASK_ALWAYS; } });
60
+ Object.defineProperty(exports, "RUNTIME_TYPE_GVISOR", { enumerable: true, get: function () { return tasks_js_2.RUNTIME_TYPE_GVISOR; } });
61
+ Object.defineProperty(exports, "RUNTIME_TYPE_RUNC", { enumerable: true, get: function () { return tasks_js_2.RUNTIME_TYPE_RUNC; } });
62
+ Object.defineProperty(exports, "WORKSPACE_ACCESS_NONE", { enumerable: true, get: function () { return tasks_js_2.WORKSPACE_ACCESS_NONE; } });
63
+ Object.defineProperty(exports, "WORKSPACE_ACCESS_RO", { enumerable: true, get: function () { return tasks_js_2.WORKSPACE_ACCESS_RO; } });
64
+ Object.defineProperty(exports, "WORKSPACE_ACCESS_RW", { enumerable: true, get: function () { return tasks_js_2.WORKSPACE_ACCESS_RW; } });
65
+ Object.defineProperty(exports, "RETRY_DEFAULT_MAX_ATTEMPTS", { enumerable: true, get: function () { return tasks_js_2.RETRY_DEFAULT_MAX_ATTEMPTS; } });
66
+ Object.defineProperty(exports, "RETRY_DEFAULT_DELAY_MS", { enumerable: true, get: function () { return tasks_js_2.RETRY_DEFAULT_DELAY_MS; } });
67
+ var views_js_2 = require("./types/views.js");
68
+ Object.defineProperty(exports, "ViewModes", { enumerable: true, get: function () { return views_js_2.ViewModes; } });
69
+ Object.defineProperty(exports, "Integrations", { enumerable: true, get: function () { return views_js_2.Integrations; } });
70
+ Object.defineProperty(exports, "GmailLabels", { enumerable: true, get: function () { return views_js_2.GmailLabels; } });
71
+ Object.defineProperty(exports, "GitHubResourceTypes", { enumerable: true, get: function () { return views_js_2.GitHubResourceTypes; } });
72
+ Object.defineProperty(exports, "GitHubStates", { enumerable: true, get: function () { return views_js_2.GitHubStates; } });
73
+ Object.defineProperty(exports, "GitHubContentTypes", { enumerable: true, get: function () { return views_js_2.GitHubContentTypes; } });
74
+ Object.defineProperty(exports, "GDriveMimeTypes", { enumerable: true, get: function () { return views_js_2.GDriveMimeTypes; } });
75
+ Object.defineProperty(exports, "LinearResourceTypes", { enumerable: true, get: function () { return views_js_2.LinearResourceTypes; } });
76
+ Object.defineProperty(exports, "LinearStates", { enumerable: true, get: function () { return views_js_2.LinearStates; } });
77
+ Object.defineProperty(exports, "LinearPriorities", { enumerable: true, get: function () { return views_js_2.LinearPriorities; } });
78
+ Object.defineProperty(exports, "PostHogResourceTypes", { enumerable: true, get: function () { return views_js_2.PostHogResourceTypes; } });
79
+ Object.defineProperty(exports, "WebModes", { enumerable: true, get: function () { return views_js_2.WebModes; } });
37
80
  // ── Version ──────────────────────────────────────────────────────────────────
38
81
  var version_js_1 = require("./version.js");
39
82
  Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_js_1.VERSION; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;AAE5B,gFAAgF;AAChF,6CAA8D;AAArD,uGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAW;AAGtC,gFAAgF;AAChF,yCAYqB;AAXnB,0GAAA,aAAa,OAAA;AACb,qGAAA,QAAQ,OAAA;AACR,gHAAA,mBAAmB,OAAA;AACnB,kHAAA,qBAAqB,OAAA;AACrB,0GAAA,aAAa,OAAA;AACb,0GAAA,aAAa,OAAA;AACb,qHAAA,wBAAwB,OAAA;AACxB,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AACnB,+GAAA,kBAAkB,OAAA;AAClB,sHAAA,yBAAyB,OAAA;AAG3B,gFAAgF;AAChF,2DAAuD;AAA9C,2GAAA,UAAU,OAAA;AACnB,6DAAyD;AAAhD,6GAAA,WAAW,OAAA;AACpB,iEAA4D;AAAnD,gHAAA,YAAY,OAAA;AACrB,mDAA+C;AAAtC,mGAAA,MAAM,OAAA;AACf,qDAAiD;AAAxC,qGAAA,OAAO,OAAA;AAChB,iDAA6C;AAApC,iGAAA,KAAK,OAAA;AACd,2DAAuD;AAA9C,2GAAA,UAAU,OAAA;AAYnB,gFAAgF;AAChF,2CAAuC;AAA9B,qGAAA,OAAO,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names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A,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,6GAAA,iBAAiB,OAAA;AACjB,iHAAA,qBAAqB,OAAA;AACrB,+GAAA,mBAAmB,OAAA;AACnB,+GAAA,mBAAmB,OAAA;AACnB,sHAAA,0BAA0B,OAAA;AAC1B,kHAAA,sBAAsB,OAAA;AAkCxB,6CAa0B;AAZxB,qGAAA,SAAS,OAAA;AACT,wGAAA,YAAY,OAAA;AACZ,uGAAA,WAAW,OAAA;AACX,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,4GAAA,gBAAgB,OAAA;AAChB,gHAAA,oBAAoB,OAAA;AACpB,oGAAA,QAAQ,OAAA;AAyCV,gFAAgF;AAChF,2CAAuC;AAA9B,qGAAA,OAAO,OAAA"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccessLog = void 0;
4
+ /**
5
+ * Query the workspace access log.
6
+ *
7
+ * Every file read through the virtual filesystem is recorded with token
8
+ * counts, compression outcome, timing, and a `source_uri` that pins
9
+ * the content back to its upstream origin.
10
+ *
11
+ * @example List recent reads
12
+ * ```ts
13
+ * const page = await airstore.accessLog.list("ws-abc", {
14
+ * start: Date.now() - 3600_000, // last hour
15
+ * limit: 50,
16
+ * });
17
+ * for (const r of page.reads) {
18
+ * console.log(r.source_uri, r.original_tokens, "->", r.compressed_tokens);
19
+ * }
20
+ * ```
21
+ *
22
+ * @example Get a summary
23
+ * ```ts
24
+ * const s = await airstore.accessLog.summary("ws-abc", {
25
+ * start: Date.now() - 86400_000,
26
+ * });
27
+ * console.log(`${s.total_reads} reads, ${s.compression_ratio} ratio`);
28
+ * ```
29
+ *
30
+ * @example Replay a read by source URI
31
+ * ```ts
32
+ * const content = await airstore.accessLog.read("ws-abc", "github://abc123");
33
+ * ```
34
+ */
35
+ class AccessLog {
36
+ client;
37
+ constructor(client) {
38
+ this.client = client;
39
+ }
40
+ /**
41
+ * List access log reads for a workspace.
42
+ *
43
+ * Supports cursor-based pagination and optional time-window filtering.
44
+ *
45
+ * @param workspaceId - Workspace external ID (UUID).
46
+ * @param params - Filtering and pagination options.
47
+ * @param options - Per-request overrides.
48
+ */
49
+ async list(workspaceId, params, options) {
50
+ const query = {};
51
+ if (params?.start !== undefined)
52
+ query.start = String(params.start);
53
+ if (params?.end !== undefined)
54
+ query.end = String(params.end);
55
+ if (params?.cursor !== undefined)
56
+ query.cursor = params.cursor;
57
+ if (params?.limit !== undefined)
58
+ query.limit = String(params.limit);
59
+ if (params?.session !== undefined)
60
+ query.session = params.session;
61
+ return this.client.request('GET', `/workspaces/${workspaceId}/access-log`, undefined, query, options);
62
+ }
63
+ /**
64
+ * Get an aggregated summary of access log reads.
65
+ *
66
+ * Returns totals, compression ratio, per-integration breakdown,
67
+ * outcome distribution, and top paths by token consumption.
68
+ *
69
+ * @param workspaceId - Workspace external ID (UUID).
70
+ * @param params - Time window and session options.
71
+ * @param options - Per-request overrides.
72
+ */
73
+ async summary(workspaceId, params, options) {
74
+ const query = {};
75
+ if (params?.start !== undefined)
76
+ query.start = String(params.start);
77
+ if (params?.end !== undefined)
78
+ query.end = String(params.end);
79
+ if (params?.session !== undefined)
80
+ query.session = params.session;
81
+ return this.client.request('GET', `/workspaces/${workspaceId}/access-log/summary`, undefined, query, options);
82
+ }
83
+ /**
84
+ * Read content directly from an upstream source using a `source_uri`.
85
+ *
86
+ * This bypasses the source-view/query layer entirely. Even if the
87
+ * materialized view has changed, the source_uri lets you pull the
88
+ * exact content that was originally read.
89
+ *
90
+ * @param workspaceId - Workspace external ID (UUID).
91
+ * @param sourceUri - Source URI from an access log entry (e.g., "github://abc123").
92
+ * @param options - Per-request overrides.
93
+ * @returns The raw content as an ArrayBuffer.
94
+ */
95
+ async read(workspaceId, sourceUri, options) {
96
+ const resp = await this.client.rawRequest('GET', `/workspaces/${workspaceId}/access-log/read`, { params: { uri: sourceUri }, ...options });
97
+ return resp.arrayBuffer();
98
+ }
99
+ }
100
+ exports.AccessLog = AccessLog;
101
+ //# sourceMappingURL=access-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-log.js","sourceRoot":"","sources":["../../../src/resources/access-log.ts"],"names":[],"mappings":";;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAa,SAAS;IACS;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,KAAK,GAA2B,EAAE,CAAC;QACzC,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS;YAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpE,IAAI,MAAM,EAAE,GAAG,KAAK,SAAS;YAAE,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,MAAM,EAAE,MAAM,KAAK,SAAS;YAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/D,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS;YAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpE,IAAI,MAAM,EAAE,OAAO,KAAK,SAAS;YAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAElE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,WAAW,aAAa,EACvC,SAAS,EACT,KAAK,EACL,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,CACX,WAAmB,EACnB,MAA+B,EAC/B,OAAwB;QAExB,MAAM,KAAK,GAA2B,EAAE,CAAC;QACzC,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS;YAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpE,IAAI,MAAM,EAAE,GAAG,KAAK,SAAS;YAAE,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,MAAM,EAAE,OAAO,KAAK,SAAS;YAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAElE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,WAAW,qBAAqB,EAC/C,SAAS,EACT,KAAK,EACL,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,SAAiB,EACjB,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CACvC,KAAK,EACL,eAAe,WAAW,kBAAkB,EAC5C,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,GAAG,OAAO,EAAE,CAC3C,CAAC;QACF,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;CACF;AAtFD,8BAsFC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Agents = void 0;
4
+ /**
5
+ * Manage agent profiles in a workspace.
6
+ */
7
+ class Agents {
8
+ client;
9
+ constructor(client) {
10
+ this.client = client;
11
+ }
12
+ async create(workspaceId, params, options) {
13
+ return this.client.request('POST', `/workspaces/${workspaceId}/agents`, {
14
+ agent_key: params.agentKey,
15
+ name: params.name,
16
+ config: params.config ?? {},
17
+ active: params.active,
18
+ }, undefined, options);
19
+ }
20
+ async list(workspaceId, options) {
21
+ return this.client.request('GET', `/workspaces/${workspaceId}/agents`, undefined, undefined, options);
22
+ }
23
+ async retrieve(workspaceId, agentId, options) {
24
+ return this.client.request('GET', `/workspaces/${workspaceId}/agents/${agentId}`, undefined, undefined, options);
25
+ }
26
+ }
27
+ exports.Agents = Agents;
28
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/resources/agents.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,MAAM;IACY;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,MAAM,CACV,WAAmB,EACnB,MAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,eAAe,WAAW,SAAS,EACnC;YACE,SAAS,EAAE,MAAM,CAAC,QAAQ;YAC1B,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,EACD,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,WAAW,SAAS,EACnC,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,WAAmB,EACnB,OAAe,EACf,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,WAAW,WAAW,OAAO,EAAE,EAC9C,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAhDD,wBAgDC"}
@@ -5,13 +5,13 @@ exports.Filesystem = void 0;
5
5
  * Read-only access to the workspace virtual filesystem.
6
6
  *
7
7
  * The filesystem provides a unified view of all connected integrations,
8
- * smart folders, tools, and user-uploaded files.
8
+ * source views, tools, and user-uploaded files.
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
12
  * const listing = await airstore.fs.list("ws_abc", { path: "/" });
13
13
  * const content = await airstore.fs.read("ws_abc", {
14
- * path: "/Sources/gmail/inbox/email.txt",
14
+ * path: "/sources/gmail/inbox/email.txt",
15
15
  * });
16
16
  * ```
17
17
  */
@@ -44,6 +44,7 @@ class Filesystem {
44
44
  * @param opts.path - File path to read.
45
45
  * @param opts.offset - Byte offset to start reading from.
46
46
  * @param opts.length - Number of bytes to read.
47
+ * @param opts.compression - Compression strategy: 'strip', 'distill', or 'chain'. Omit to disable.
47
48
  * @param options - Per-request overrides.
48
49
  * @returns File contents as a string.
49
50
  *
@@ -55,6 +56,8 @@ class Filesystem {
55
56
  params['offset'] = String(opts.offset);
56
57
  if (opts.length !== undefined)
57
58
  params['length'] = String(opts.length);
59
+ if (opts.compression !== undefined)
60
+ params['compression'] = opts.compression;
58
61
  const resp = await this.client.rawRequest('GET', `/workspaces/${workspaceId}/fs/read`, { params, ...options });
59
62
  return resp.text();
60
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../../src/resources/filesystem.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;GAaG;AACH,MAAa,UAAU;IACQ;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,OAA0B,EAAE,EAC5B,OAAwB;QAExB,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAExD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,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ACxD,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,WAAW,UAAU,EACpC,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,IAAY,EACZ,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,WAAW,UAAU,EACpC,SAAS,EACT,EAAE,IAAI,EAAE,EACR,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAtHD,gCAsHC"}
1
+ {"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../../src/resources/filesystem.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;GAaG;AACH,MAAa,UAAU;IACQ;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,OAA0B,EAAE,EAC5B,OAAwB;QAExB,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAExD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACtC,KAAK,EACL,eAAe,WAAW,UAAU,EACpC,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;QACF,OAAQ,MAA2B,CAAC,OAAO,IAAI,EAAE,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,IAKC,EACD,OAAwB;QAExB,MAAM,MAAM,GAA2B,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;QAC3D,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC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,CACxB,KAAK,EACL,eAAe,WAAW,UAAU,EACpC,SAAS,EACT,EAAE,IAAI,EAAE,EACR,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA7HD,gCA6HC"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Filesystem = exports.OAuth = exports.Members = exports.Tokens = exports.SmartFolders = exports.Connections = exports.Workspaces = void 0;
3
+ exports.Runs = exports.Tasks = exports.Agents = exports.Filesystem = exports.OAuth = exports.Members = exports.Tokens = exports.Views = exports.Connections = exports.Workspaces = void 0;
4
4
  var workspaces_js_1 = require("./workspaces.js");
5
5
  Object.defineProperty(exports, "Workspaces", { enumerable: true, get: function () { return workspaces_js_1.Workspaces; } });
6
6
  var connections_js_1 = require("./connections.js");
7
7
  Object.defineProperty(exports, "Connections", { enumerable: true, get: function () { return connections_js_1.Connections; } });
8
- var smart_folders_js_1 = require("./smart-folders.js");
9
- Object.defineProperty(exports, "SmartFolders", { enumerable: true, get: function () { return smart_folders_js_1.SmartFolders; } });
8
+ var views_js_1 = require("./views.js");
9
+ Object.defineProperty(exports, "Views", { enumerable: true, get: function () { return views_js_1.Views; } });
10
10
  var tokens_js_1 = require("./tokens.js");
11
11
  Object.defineProperty(exports, "Tokens", { enumerable: true, get: function () { return tokens_js_1.Tokens; } });
12
12
  var members_js_1 = require("./members.js");
@@ -15,4 +15,10 @@ var oauth_js_1 = require("./oauth.js");
15
15
  Object.defineProperty(exports, "OAuth", { enumerable: true, get: function () { return oauth_js_1.OAuth; } });
16
16
  var filesystem_js_1 = require("./filesystem.js");
17
17
  Object.defineProperty(exports, "Filesystem", { enumerable: true, get: function () { return filesystem_js_1.Filesystem; } });
18
+ var agents_js_1 = require("./agents.js");
19
+ Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_js_1.Agents; } });
20
+ var tasks_js_1 = require("./tasks.js");
21
+ Object.defineProperty(exports, "Tasks", { enumerable: true, get: function () { return tasks_js_1.Tasks; } });
22
+ var runs_js_1 = require("./runs.js");
23
+ Object.defineProperty(exports, "Runs", { enumerable: true, get: function () { return runs_js_1.Runs; } });
18
24
  //# sourceMappingURL=index.js.map