lemma-sdk 0.2.46 → 0.3.0

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 (87) hide show
  1. package/README.md +16 -0
  2. package/dist/browser/lemma-client.js +13661 -4410
  3. package/dist/browser.d.ts +14 -6
  4. package/dist/browser.js +35 -6
  5. package/dist/client.d.ts +4 -0
  6. package/dist/client.js +15 -3
  7. package/dist/config.d.ts +4 -0
  8. package/dist/config.js +7 -1
  9. package/dist/generated.d.ts +14 -1
  10. package/dist/generated.js +62 -11
  11. package/dist/http.d.ts +47 -1
  12. package/dist/http.js +145 -26
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/namespaces/agents.d.ts +20 -1
  16. package/dist/namespaces/agents.js +29 -1
  17. package/dist/namespaces/conversations.d.ts +3 -0
  18. package/dist/namespaces/conversations.js +2 -0
  19. package/dist/namespaces/desks.d.ts +9 -0
  20. package/dist/namespaces/desks.js +6 -0
  21. package/dist/namespaces/files.d.ts +18 -0
  22. package/dist/namespaces/files.js +21 -0
  23. package/dist/namespaces/functions.d.ts +3 -0
  24. package/dist/namespaces/functions.js +5 -0
  25. package/dist/namespaces/widgets.d.ts +17 -0
  26. package/dist/namespaces/widgets.js +16 -0
  27. package/dist/openapi_client/core/OpenAPI.js +1 -1
  28. package/dist/openapi_client/index.d.ts +4 -0
  29. package/dist/openapi_client/index.js +1 -0
  30. package/dist/openapi_client/models/AgentRunStatus.d.ts +10 -0
  31. package/dist/openapi_client/models/AgentRunStatus.js +15 -0
  32. package/dist/openapi_client/models/AgentToolset.d.ts +2 -2
  33. package/dist/openapi_client/models/AgentToolset.js +1 -1
  34. package/dist/openapi_client/models/ConversationResponse.d.ts +4 -0
  35. package/dist/openapi_client/models/ConversationType.d.ts +2 -1
  36. package/dist/openapi_client/models/ConversationType.js +1 -0
  37. package/dist/openapi_client/models/DatastoreQueryRequest.d.ts +1 -1
  38. package/dist/openapi_client/models/FileSearchResultSchema.d.ts +2 -0
  39. package/dist/openapi_client/models/FileSignedUrlRequest.d.ts +4 -0
  40. package/dist/openapi_client/models/FileSignedUrlRequest.js +1 -0
  41. package/dist/openapi_client/models/FileSignedUrlResponse.d.ts +6 -0
  42. package/dist/openapi_client/models/FileSignedUrlResponse.js +1 -0
  43. package/dist/openapi_client/models/FileUrlResponse.d.ts +6 -0
  44. package/dist/openapi_client/models/FileUrlResponse.js +1 -0
  45. package/dist/openapi_client/services/AgentConversationsService.d.ts +3 -2
  46. package/dist/openapi_client/services/AgentConversationsService.js +4 -2
  47. package/dist/openapi_client/services/FilesService.d.ts +20 -0
  48. package/dist/openapi_client/services/FilesService.js +47 -0
  49. package/dist/openapi_client/services/QueryService.d.ts +1 -1
  50. package/dist/openapi_client/services/QueryService.js +1 -1
  51. package/dist/run-utils.d.ts +24 -0
  52. package/dist/run-utils.js +54 -0
  53. package/dist/version.d.ts +5 -0
  54. package/dist/version.js +7 -0
  55. package/package.json +10 -5
  56. package/dist/hey_client/client/client.gen.d.ts +0 -2
  57. package/dist/hey_client/client/client.gen.js +0 -216
  58. package/dist/hey_client/client/index.d.ts +0 -10
  59. package/dist/hey_client/client/index.js +0 -6
  60. package/dist/hey_client/client/types.gen.d.ts +0 -120
  61. package/dist/hey_client/client/types.gen.js +0 -2
  62. package/dist/hey_client/client/utils.gen.d.ts +0 -37
  63. package/dist/hey_client/client/utils.gen.js +0 -228
  64. package/dist/hey_client/client.gen.d.ts +0 -12
  65. package/dist/hey_client/client.gen.js +0 -3
  66. package/dist/hey_client/core/auth.gen.d.ts +0 -25
  67. package/dist/hey_client/core/auth.gen.js +0 -14
  68. package/dist/hey_client/core/bodySerializer.gen.d.ts +0 -25
  69. package/dist/hey_client/core/bodySerializer.gen.js +0 -57
  70. package/dist/hey_client/core/params.gen.d.ts +0 -43
  71. package/dist/hey_client/core/params.gen.js +0 -100
  72. package/dist/hey_client/core/pathSerializer.gen.d.ts +0 -33
  73. package/dist/hey_client/core/pathSerializer.gen.js +0 -106
  74. package/dist/hey_client/core/queryKeySerializer.gen.d.ts +0 -18
  75. package/dist/hey_client/core/queryKeySerializer.gen.js +0 -92
  76. package/dist/hey_client/core/serverSentEvents.gen.d.ts +0 -71
  77. package/dist/hey_client/core/serverSentEvents.gen.js +0 -132
  78. package/dist/hey_client/core/types.gen.d.ts +0 -83
  79. package/dist/hey_client/core/types.gen.js +0 -2
  80. package/dist/hey_client/core/utils.gen.d.ts +0 -19
  81. package/dist/hey_client/core/utils.gen.js +0 -87
  82. package/dist/hey_client/index.d.ts +0 -2
  83. package/dist/hey_client/index.js +0 -2
  84. package/dist/hey_client/sdk.gen.d.ts +0 -1005
  85. package/dist/hey_client/sdk.gen.js +0 -1438
  86. package/dist/hey_client/types.gen.d.ts +0 -12992
  87. package/dist/hey_client/types.gen.js +0 -2
@@ -2,13 +2,41 @@ import { AgentsService } from "../openapi_client/services/AgentsService.js";
2
2
  export class AgentsNamespace {
3
3
  client;
4
4
  podId;
5
- constructor(client, podId) {
5
+ conversations;
6
+ constructor(client, podId,
7
+ // Lazy accessor — conversations is constructed alongside agents on the client.
8
+ conversations) {
6
9
  this.client = client;
7
10
  this.podId = podId;
11
+ this.conversations = conversations;
8
12
  }
9
13
  list(options = {}) {
10
14
  return this.client.request(() => AgentsService.agentList(this.podId(), options.pageToken, options.limit ?? 100));
11
15
  }
16
+ /**
17
+ * Run an agent on a single message (the `.run` verb, alongside
18
+ * `functions.run` / `datastore.query`). Note the return contract differs:
19
+ * those return the result directly, whereas an agent reply is asynchronous —
20
+ * this opens a fresh conversation, sends `message`, and returns the created
21
+ * conversation (read the reply via `client.conversations.messages.list(conv.id)`).
22
+ * With `stream: true` it returns the SSE stream so you can consume tokens as
23
+ * they arrive.
24
+ */
25
+ async run(agentName, message, options = {}) {
26
+ if (!this.conversations) {
27
+ throw new Error("agents.run requires the conversations namespace — call it via client.agents.run().");
28
+ }
29
+ const conversations = this.conversations();
30
+ const conversation = await conversations.createForAgent(agentName, {
31
+ title: options.title,
32
+ metadata: options.metadata,
33
+ });
34
+ if (options.stream) {
35
+ return conversations.sendMessageStream(conversation.id, { content: message }, { signal: options.signal });
36
+ }
37
+ await conversations.messages.send(conversation.id, { content: message });
38
+ return conversation;
39
+ }
12
40
  create(payload) {
13
41
  return this.client.request(() => AgentsService.agentCreate(this.podId(), payload));
14
42
  }
@@ -2,6 +2,7 @@ import type { HttpClient } from "../http.js";
2
2
  import type { ApprovalDecisionResponse } from "../openapi_client/models/ApprovalDecisionResponse.js";
3
3
  import type { AgentRuntimeConfig } from "../openapi_client/models/AgentRuntimeConfig.js";
4
4
  import type { ConversationListResponse } from "../openapi_client/models/ConversationListResponse.js";
5
+ import type { ConversationType } from "../openapi_client/models/ConversationType.js";
5
6
  import type { CreateConversationRequest } from "../openapi_client/models/CreateConversationRequest.js";
6
7
  import type { HarnessKind } from "../openapi_client/models/HarnessKind.js";
7
8
  import type { ResolveUserApprovalRequest } from "../openapi_client/models/ResolveUserApprovalRequest.js";
@@ -44,6 +45,8 @@ export declare class ConversationsNamespace {
44
45
  list(options?: {
45
46
  agent_name?: string | null;
46
47
  pod_id?: string | null;
48
+ parent_id?: string | null;
49
+ type?: ConversationType | null;
47
50
  limit?: number;
48
51
  page_token?: string | null;
49
52
  }): Promise<ConversationListResponse>;
@@ -107,6 +107,8 @@ export class ConversationsNamespace {
107
107
  return this.http.request("GET", `/pods/${podId}/conversations`, {
108
108
  params: {
109
109
  agent_name: options.agent_name,
110
+ parent_id: options.parent_id,
111
+ type: options.type,
110
112
  limit: options.limit ?? 20,
111
113
  page_token: options.page_token,
112
114
  },
@@ -16,6 +16,15 @@ export declare class DesksNamespace {
16
16
  get(name: string): Promise<import("../types.js").DeskDetailResponse>;
17
17
  update(name: string, payload: UpdateDeskRequest): Promise<import("../types.js").DeskDetailResponse>;
18
18
  delete(name: string): Promise<import("../types.js").DeskMessageResponse>;
19
+ /** Promote a conversation widget into a persisted desk (save as desk). */
20
+ createFromWidget(payload: {
21
+ conversation_id: string;
22
+ tool_call_id: string;
23
+ name: string;
24
+ public_slug?: string;
25
+ description?: string;
26
+ visibility?: string;
27
+ }): Promise<unknown>;
19
28
  readonly assets: {
20
29
  get: (name: string, path?: string) => Promise<string>;
21
30
  };
@@ -23,6 +23,12 @@ export class DesksNamespace {
23
23
  delete(name) {
24
24
  return this.client.request(() => DesksService.deskDelete(this.podId(), name));
25
25
  }
26
+ /** Promote a conversation widget into a persisted desk (save as desk). */
27
+ createFromWidget(payload) {
28
+ return this.http.request("POST", `/pods/${this.podId()}/desks/from-widget`, {
29
+ body: payload,
30
+ });
31
+ }
26
32
  assets = {
27
33
  get: (name, path) => this.http.request("GET", `/pods/${this.podId()}/desks/${name}/assets${path ? `/${path.replace(/^\/+/, "")}` : ""}`),
28
34
  };
@@ -3,6 +3,8 @@ import type { HttpClient } from "../http.js";
3
3
  import type { ConvertedFileResponse } from "../openapi_client/models/ConvertedFileResponse.js";
4
4
  import type { DirectoryTreeResponse } from "../openapi_client/models/DirectoryTreeResponse.js";
5
5
  import { FileSearchScopeMode } from "../openapi_client/models/FileSearchScopeMode.js";
6
+ import type { FileSignedUrlResponse } from "../openapi_client/models/FileSignedUrlResponse.js";
7
+ import type { FileUrlResponse } from "../openapi_client/models/FileUrlResponse.js";
6
8
  import { SearchMethod } from "../openapi_client/models/SearchMethod.js";
7
9
  type SearchMethodInput = SearchMethod | `${SearchMethod}`;
8
10
  type FileSearchScopeModeInput = FileSearchScopeMode | `${FileSearchScopeMode}`;
@@ -18,6 +20,22 @@ export declare class FilesNamespace {
18
20
  parentId?: string;
19
21
  }): Promise<import("../types.js").FileListResponse>;
20
22
  get(path: string): Promise<import("../types.js").FileDetailResponse>;
23
+ /**
24
+ * URLs for a file: a short-lived download `url` plus a permanent
25
+ * authenticated `app_url` deep-link that opens the file in the Lemma
26
+ * frontend (the viewer must be a signed-in pod member).
27
+ */
28
+ getUrl(path: string): Promise<FileUrlResponse>;
29
+ /**
30
+ * Mint a public, hit-capped short signed URL (no login needed to open).
31
+ * Expires after `expiresSeconds` (default 3h, max 24h) and serves the file
32
+ * at most `maxHits` times (default 50, max 100); both bounds are clamped
33
+ * server-side. Use it to share a file outside the pod without unbounded egress.
34
+ */
35
+ createSignedUrl(path: string, options?: {
36
+ expiresSeconds?: number;
37
+ maxHits?: number;
38
+ }): Promise<FileSignedUrlResponse>;
21
39
  delete(path: string): Promise<void>;
22
40
  search(query: string, options?: {
23
41
  limit?: number;
@@ -45,6 +45,27 @@ export class FilesNamespace {
45
45
  get(path) {
46
46
  return this.client.request(() => FilesService.fileGet(this.podId(), path));
47
47
  }
48
+ /**
49
+ * URLs for a file: a short-lived download `url` plus a permanent
50
+ * authenticated `app_url` deep-link that opens the file in the Lemma
51
+ * frontend (the viewer must be a signed-in pod member).
52
+ */
53
+ getUrl(path) {
54
+ return this.client.request(() => FilesService.fileUrl(this.podId(), path));
55
+ }
56
+ /**
57
+ * Mint a public, hit-capped short signed URL (no login needed to open).
58
+ * Expires after `expiresSeconds` (default 3h, max 24h) and serves the file
59
+ * at most `maxHits` times (default 50, max 100); both bounds are clamped
60
+ * server-side. Use it to share a file outside the pod without unbounded egress.
61
+ */
62
+ createSignedUrl(path, options = {}) {
63
+ const body = {
64
+ expires_seconds: options.expiresSeconds,
65
+ max_hits: options.maxHits,
66
+ };
67
+ return this.client.request(() => FilesService.fileSignedUrl(this.podId(), path, body));
68
+ }
48
69
  delete(path) {
49
70
  return this.client.request(() => FilesService.fileDelete(this.podId(), path));
50
71
  }
@@ -15,6 +15,9 @@ export declare class FunctionsNamespace {
15
15
  get(name: string): Promise<import("../types.js").FunctionDetailResponse>;
16
16
  update(name: string, payload: UpdateFunctionRequest): Promise<import("../types.js").FunctionActionResponse>;
17
17
  delete(name: string): Promise<import("../types.js").FunctionMessageResponse>;
18
+ /** Run a function — convenience alias for `functions.runs.create`, matching the
19
+ * Python SDK's `functions.run(name, input)` and the unified `.run` verb. */
20
+ run(name: string, options?: RunFunctionOptions): Promise<import("../types.js").FunctionRunResponse>;
18
21
  readonly permissions: {
19
22
  get: (name: string) => Promise<import("../types.js").FunctionPermissionsResponse>;
20
23
  replace: (name: string, payload: FunctionPermissionsReplaceRequest) => Promise<import("../types.js").FunctionPermissionsResponse>;
@@ -21,6 +21,11 @@ export class FunctionsNamespace {
21
21
  delete(name) {
22
22
  return this.client.request(() => FunctionsService.functionDelete(this.podId(), name));
23
23
  }
24
+ /** Run a function — convenience alias for `functions.runs.create`, matching the
25
+ * Python SDK's `functions.run(name, input)` and the unified `.run` verb. */
26
+ run(name, options = {}) {
27
+ return this.runs.create(name, options);
28
+ }
24
29
  permissions = {
25
30
  get: (name) => this.client.request(() => FunctionsService.functionPermissionsGet(this.podId(), name)),
26
31
  replace: (name, payload) => this.client.request(() => FunctionsService.functionPermissionsReplace(this.podId(), name, payload)),
@@ -0,0 +1,17 @@
1
+ import type { HttpClient } from "../http.js";
2
+ export declare class WidgetsNamespace {
3
+ private readonly http;
4
+ private readonly podId;
5
+ constructor(http: HttpClient, podId: () => string);
6
+ /**
7
+ * Mint a short-lived, signed embed URL for a conversation widget. The widget
8
+ * serve route is authenticated; this returns a URL the iframe can load even
9
+ * when the session cookie is not sent in a cross-site/embedded context.
10
+ */
11
+ embedUrl(payload: {
12
+ conversation_id: string;
13
+ tool_call_id: string;
14
+ }): Promise<{
15
+ url: string;
16
+ }>;
17
+ }
@@ -0,0 +1,16 @@
1
+ export class WidgetsNamespace {
2
+ http;
3
+ podId;
4
+ constructor(http, podId) {
5
+ this.http = http;
6
+ this.podId = podId;
7
+ }
8
+ /**
9
+ * Mint a short-lived, signed embed URL for a conversation widget. The widget
10
+ * serve route is authenticated; this returns a URL the iframe can load even
11
+ * when the session cookie is not sent in a cross-site/embedded context.
12
+ */
13
+ embedUrl(payload) {
14
+ return this.http.request("POST", `/pods/${this.podId()}/widgets/${payload.conversation_id}/${payload.tool_call_id}/embed-token`);
15
+ }
16
+ }
@@ -1,6 +1,6 @@
1
1
  export const OpenAPI = {
2
2
  BASE: '',
3
- VERSION: '1.0.0',
3
+ VERSION: '1.3.0',
4
4
  WITH_CREDENTIALS: false,
5
5
  CREDENTIALS: 'include',
6
6
  TOKEN: undefined,
@@ -22,6 +22,7 @@ export type { AgentPermissionsResponse } from './models/AgentPermissionsResponse
22
22
  export type { AgentResourcePermissionRequest } from './models/AgentResourcePermissionRequest.js';
23
23
  export type { AgentResourcePermissionResponse } from './models/AgentResourcePermissionResponse.js';
24
24
  export { AgentRunApprovalDecision } from './models/AgentRunApprovalDecision.js';
25
+ export { AgentRunStatus } from './models/AgentRunStatus.js';
25
26
  export type { AgentRuntimeConfig } from './models/AgentRuntimeConfig.js';
26
27
  export type { AgentRuntimeProfileListResponse } from './models/AgentRuntimeProfileListResponse.js';
27
28
  export type { AgentRuntimeProfileResponse } from './models/AgentRuntimeProfileResponse.js';
@@ -108,6 +109,9 @@ export type { FileSearchRequest } from './models/FileSearchRequest.js';
108
109
  export type { FileSearchResponse } from './models/FileSearchResponse.js';
109
110
  export type { FileSearchResultSchema } from './models/FileSearchResultSchema.js';
110
111
  export { FileSearchScopeMode } from './models/FileSearchScopeMode.js';
112
+ export type { FileSignedUrlRequest } from './models/FileSignedUrlRequest.js';
113
+ export type { FileSignedUrlResponse } from './models/FileSignedUrlResponse.js';
114
+ export type { FileUrlResponse } from './models/FileUrlResponse.js';
111
115
  export type { FlowDetailResponse } from './models/FlowDetailResponse.js';
112
116
  export { FlowRunStatus } from './models/FlowRunStatus.js';
113
117
  export type { ForeignKeySpec } from './models/ForeignKeySpec.js';
@@ -6,6 +6,7 @@ export { ApiError } from './core/ApiError.js';
6
6
  export { CancelablePromise, CancelError } from './core/CancelablePromise.js';
7
7
  export { OpenAPI } from './core/OpenAPI.js';
8
8
  export { AgentRunApprovalDecision } from './models/AgentRunApprovalDecision.js';
9
+ export { AgentRunStatus } from './models/AgentRunStatus.js';
9
10
  export { AgentSurfaceStatus } from './models/AgentSurfaceStatus.js';
10
11
  export { AgentToolset } from './models/AgentToolset.js';
11
12
  export { AuthProvider } from './models/AuthProvider.js';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Internal lifecycle for one harness execution.
3
+ */
4
+ export declare enum AgentRunStatus {
5
+ RUNNING = "RUNNING",
6
+ STOP_REQUESTED = "STOP_REQUESTED",
7
+ COMPLETED = "COMPLETED",
8
+ FAILED = "FAILED",
9
+ STOPPED = "STOPPED"
10
+ }
@@ -0,0 +1,15 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ /**
6
+ * Internal lifecycle for one harness execution.
7
+ */
8
+ export var AgentRunStatus;
9
+ (function (AgentRunStatus) {
10
+ AgentRunStatus["RUNNING"] = "RUNNING";
11
+ AgentRunStatus["STOP_REQUESTED"] = "STOP_REQUESTED";
12
+ AgentRunStatus["COMPLETED"] = "COMPLETED";
13
+ AgentRunStatus["FAILED"] = "FAILED";
14
+ AgentRunStatus["STOPPED"] = "STOPPED";
15
+ })(AgentRunStatus || (AgentRunStatus = {}));
@@ -2,12 +2,12 @@
2
2
  * Known tool bundles an agent may request.
3
3
  */
4
4
  export declare enum AgentToolset {
5
- FILE_SYSTEM = "FILE_SYSTEM",
6
5
  WORKSPACE_CLI = "WORKSPACE_CLI",
7
6
  SKILLS = "SKILLS",
8
7
  WEB_SEARCH = "WEB_SEARCH",
9
8
  USER_INTERACTION = "USER_INTERACTION",
10
9
  IMAGE_GENERATION = "IMAGE_GENERATION",
11
10
  AUDIO_GENERATION = "AUDIO_GENERATION",
12
- POD = "POD"
11
+ POD = "POD",
12
+ SUBAGENTS = "SUBAGENTS"
13
13
  }
@@ -7,7 +7,6 @@
7
7
  */
8
8
  export var AgentToolset;
9
9
  (function (AgentToolset) {
10
- AgentToolset["FILE_SYSTEM"] = "FILE_SYSTEM";
11
10
  AgentToolset["WORKSPACE_CLI"] = "WORKSPACE_CLI";
12
11
  AgentToolset["SKILLS"] = "SKILLS";
13
12
  AgentToolset["WEB_SEARCH"] = "WEB_SEARCH";
@@ -15,4 +14,5 @@ export var AgentToolset;
15
14
  AgentToolset["IMAGE_GENERATION"] = "IMAGE_GENERATION";
16
15
  AgentToolset["AUDIO_GENERATION"] = "AUDIO_GENERATION";
17
16
  AgentToolset["POD"] = "POD";
17
+ AgentToolset["SUBAGENTS"] = "SUBAGENTS";
18
18
  })(AgentToolset || (AgentToolset = {}));
@@ -1,3 +1,4 @@
1
+ import type { AgentRunStatus } from './AgentRunStatus.js';
1
2
  import type { AgentRuntimeConfig } from './AgentRuntimeConfig.js';
2
3
  import type { ConversationStatus } from './ConversationStatus.js';
3
4
  import type { ConversationType } from './ConversationType.js';
@@ -7,6 +8,9 @@ export type ConversationResponse = {
7
8
  created_at: string;
8
9
  id: string;
9
10
  instructions?: (string | null);
11
+ last_run_error?: (string | null);
12
+ last_run_finished_at?: (string | null);
13
+ last_run_status?: (AgentRunStatus | null);
10
14
  metadata?: (Record<string, any> | null);
11
15
  organization_id?: (string | null);
12
16
  output?: null;
@@ -3,5 +3,6 @@
3
3
  */
4
4
  export declare enum ConversationType {
5
5
  CHAT = "CHAT",
6
- TASK = "TASK"
6
+ TASK = "TASK",
7
+ PROJECT = "PROJECT"
7
8
  }
@@ -9,4 +9,5 @@ export var ConversationType;
9
9
  (function (ConversationType) {
10
10
  ConversationType["CHAT"] = "CHAT";
11
11
  ConversationType["TASK"] = "TASK";
12
+ ConversationType["PROJECT"] = "PROJECT";
12
13
  })(ConversationType || (ConversationType = {}));
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export type DatastoreQueryRequest = {
5
5
  /**
6
- * Read-only SQL query executed inside this datastore schema. Only SELECT-style queries are allowed; mutating statements are blocked. Queries against RLS-enabled tables are rejected; use table-scoped record APIs instead. Write queries such as INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, and TRUNCATE are rejected. Example: `SELECT id, amount FROM expenses WHERE amount > 100 ORDER BY created_at DESC LIMIT 20`.
6
+ * Read-only SQL query executed inside this datastore schema. A single SELECT statement only; mutating statements (INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, TRUNCATE, ...) and cross-schema references are rejected. Joins, aggregates, and subqueries across tables are allowed, including RLS-enabled tables rows of an RLS table are scoped to the caller unless they administer it. Example: `SELECT id, amount FROM expenses WHERE amount > 100 ORDER BY created_at DESC LIMIT 20`.
7
7
  */
8
8
  query: string;
9
9
  };
@@ -3,6 +3,8 @@ export type FileSearchResultSchema = {
3
3
  content: string;
4
4
  file_id: string;
5
5
  metadata?: (Record<string, any> | null);
6
+ page_end?: (number | null);
7
+ page_number?: (number | null);
6
8
  path: string;
7
9
  score: number;
8
10
  };
@@ -0,0 +1,4 @@
1
+ export type FileSignedUrlRequest = {
2
+ expires_seconds?: (number | null);
3
+ max_hits?: (number | null);
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export type FileSignedUrlResponse = {
2
+ expires_at: string;
3
+ max_hits: number;
4
+ path: string;
5
+ signed_url: string;
6
+ };
@@ -0,0 +1,6 @@
1
+ export type FileUrlResponse = {
2
+ app_url: string;
3
+ expires_at: string;
4
+ path: string;
5
+ url: string;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -13,17 +13,18 @@ import type { CancelablePromise } from '../core/CancelablePromise.js';
13
13
  export declare class AgentConversationsService {
14
14
  /**
15
15
  * List Pod Agent Conversations
16
- * List root conversations for the current user in a pod. Use agent_name to list conversations for a specific pod agent; omit it to list default pod assistant conversations. Child conversations are omitted from this root list.
16
+ * List root conversations for the current user in a pod. Use agent_name to list conversations for a specific pod agent; omit it to list default pod assistant conversations. Child (sub-agent) conversations are omitted by default; pass parent_id to list the children of a specific conversation instead.
17
17
  * @param podId
18
18
  * @param agentName
19
19
  * @param status
20
20
  * @param type
21
+ * @param parentId
21
22
  * @param pageToken
22
23
  * @param limit
23
24
  * @returns ConversationListResponse Successful Response
24
25
  * @throws ApiError
25
26
  */
26
- static agentConversationList(podId: string, agentName?: (string | null), status?: (ConversationStatus | null), type?: (ConversationType | null), pageToken?: (string | null), limit?: number): CancelablePromise<ConversationListResponse>;
27
+ static agentConversationList(podId: string, agentName?: (string | null), status?: (ConversationStatus | null), type?: (ConversationType | null), parentId?: (string | null), pageToken?: (string | null), limit?: number): CancelablePromise<ConversationListResponse>;
27
28
  /**
28
29
  * Create Pod Agent Conversation
29
30
  * Create a new pod-scoped conversation. When agent_name is omitted, the conversation uses the default pod assistant. Workflow and sub-agent executions also use conversations as their external execution handle.
@@ -3,17 +3,18 @@ import { request as __request } from '../core/request.js';
3
3
  export class AgentConversationsService {
4
4
  /**
5
5
  * List Pod Agent Conversations
6
- * List root conversations for the current user in a pod. Use agent_name to list conversations for a specific pod agent; omit it to list default pod assistant conversations. Child conversations are omitted from this root list.
6
+ * List root conversations for the current user in a pod. Use agent_name to list conversations for a specific pod agent; omit it to list default pod assistant conversations. Child (sub-agent) conversations are omitted by default; pass parent_id to list the children of a specific conversation instead.
7
7
  * @param podId
8
8
  * @param agentName
9
9
  * @param status
10
10
  * @param type
11
+ * @param parentId
11
12
  * @param pageToken
12
13
  * @param limit
13
14
  * @returns ConversationListResponse Successful Response
14
15
  * @throws ApiError
15
16
  */
16
- static agentConversationList(podId, agentName, status, type, pageToken, limit = 20) {
17
+ static agentConversationList(podId, agentName, status, type, parentId, pageToken, limit = 20) {
17
18
  return __request(OpenAPI, {
18
19
  method: 'GET',
19
20
  url: '/pods/{pod_id}/conversations',
@@ -24,6 +25,7 @@ export class AgentConversationsService {
24
25
  'agent_name': agentName,
25
26
  'status': status,
26
27
  'type': type,
28
+ 'parent_id': parentId,
27
29
  'page_token': pageToken,
28
30
  'limit': limit,
29
31
  },
@@ -6,6 +6,9 @@ import type { FileDetailResponse } from '../models/FileDetailResponse.js';
6
6
  import type { FileListResponse } from '../models/FileListResponse.js';
7
7
  import type { FileSearchRequest } from '../models/FileSearchRequest.js';
8
8
  import type { FileSearchResponse } from '../models/FileSearchResponse.js';
9
+ import type { FileSignedUrlRequest } from '../models/FileSignedUrlRequest.js';
10
+ import type { FileSignedUrlResponse } from '../models/FileSignedUrlResponse.js';
11
+ import type { FileUrlResponse } from '../models/FileUrlResponse.js';
9
12
  import type { update } from '../models/update.js';
10
13
  import type { CancelablePromise } from '../core/CancelablePromise.js';
11
14
  export declare class FilesService {
@@ -109,6 +112,15 @@ export declare class FilesService {
109
112
  * @throws ApiError
110
113
  */
111
114
  static fileSearch(podId: string, requestBody: FileSearchRequest): CancelablePromise<FileSearchResponse>;
115
+ /**
116
+ * Create a public, hit-capped signed URL for a file
117
+ * @param podId
118
+ * @param path
119
+ * @param requestBody
120
+ * @returns FileSignedUrlResponse Successful Response
121
+ * @throws ApiError
122
+ */
123
+ static fileSignedUrl(podId: string, path: string, requestBody?: (FileSignedUrlRequest | null)): CancelablePromise<FileSignedUrlResponse>;
112
124
  /**
113
125
  * Get Directory Tree
114
126
  * @param podId
@@ -118,4 +130,12 @@ export declare class FilesService {
118
130
  * @throws ApiError
119
131
  */
120
132
  static fileTree(podId: string, rootPath?: string, filesPerDirectory?: number): CancelablePromise<DirectoryTreeResponse>;
133
+ /**
134
+ * Get a short-lived URL for a file
135
+ * @param podId
136
+ * @param path
137
+ * @returns FileUrlResponse Successful Response
138
+ * @throws ApiError
139
+ */
140
+ static fileUrl(podId: string, path: string): CancelablePromise<FileUrlResponse>;
121
141
  }
@@ -269,6 +269,31 @@ export class FilesService {
269
269
  },
270
270
  });
271
271
  }
272
+ /**
273
+ * Create a public, hit-capped signed URL for a file
274
+ * @param podId
275
+ * @param path
276
+ * @param requestBody
277
+ * @returns FileSignedUrlResponse Successful Response
278
+ * @throws ApiError
279
+ */
280
+ static fileSignedUrl(podId, path, requestBody) {
281
+ return __request(OpenAPI, {
282
+ method: 'POST',
283
+ url: '/pods/{pod_id}/datastore/files/signed-url',
284
+ path: {
285
+ 'pod_id': podId,
286
+ },
287
+ query: {
288
+ 'path': path,
289
+ },
290
+ body: requestBody,
291
+ mediaType: 'application/json',
292
+ errors: {
293
+ 422: `Validation Error`,
294
+ },
295
+ });
296
+ }
272
297
  /**
273
298
  * Get Directory Tree
274
299
  * @param podId
@@ -293,4 +318,26 @@ export class FilesService {
293
318
  },
294
319
  });
295
320
  }
321
+ /**
322
+ * Get a short-lived URL for a file
323
+ * @param podId
324
+ * @param path
325
+ * @returns FileUrlResponse Successful Response
326
+ * @throws ApiError
327
+ */
328
+ static fileUrl(podId, path) {
329
+ return __request(OpenAPI, {
330
+ method: 'GET',
331
+ url: '/pods/{pod_id}/datastore/files/url',
332
+ path: {
333
+ 'pod_id': podId,
334
+ },
335
+ query: {
336
+ 'path': path,
337
+ },
338
+ errors: {
339
+ 422: `Validation Error`,
340
+ },
341
+ });
342
+ }
296
343
  }
@@ -4,7 +4,7 @@ import type { CancelablePromise } from '../core/CancelablePromise.js';
4
4
  export declare class QueryService {
5
5
  /**
6
6
  * Execute Query
7
- * Execute a read-only SQL query inside the datastore schema. Joins, aggregates, subqueries, and cross-table reads are allowed as long as the statement is read only.
7
+ * Execute a read-only SQL query inside the datastore schema. Joins, aggregates, subqueries, and cross-table reads are allowed, including across RLS-enabled tables — rows of RLS tables are scoped to the caller (table admins see all rows). Only a single read-only statement is permitted; mutating statements and cross-schema references are rejected.
8
8
  * @param podId
9
9
  * @param requestBody
10
10
  * @returns DatastoreQueryResponse Successful Response
@@ -3,7 +3,7 @@ import { request as __request } from '../core/request.js';
3
3
  export class QueryService {
4
4
  /**
5
5
  * Execute Query
6
- * Execute a read-only SQL query inside the datastore schema. Joins, aggregates, subqueries, and cross-table reads are allowed as long as the statement is read only.
6
+ * Execute a read-only SQL query inside the datastore schema. Joins, aggregates, subqueries, and cross-table reads are allowed, including across RLS-enabled tables — rows of RLS tables are scoped to the caller (table admins see all rows). Only a single read-only statement is permitted; mutating statements and cross-schema references are rejected.
7
7
  * @param podId
8
8
  * @param requestBody
9
9
  * @returns DatastoreQueryResponse Successful Response
@@ -12,4 +12,28 @@ export declare function isTerminalFlowStatus(status: unknown, options?: {
12
12
  }): boolean;
13
13
  export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
14
14
  export declare function nextBackoffDelay(attempt: number, options?: BackoffOptions): number;
15
+ /**
16
+ * Statuses worth retrying with backoff. Deliberately conservative: 429 is an
17
+ * explicit "back off", and 502/503/504 are gateway errors where the request
18
+ * usually never reached the handler — so retrying is safe even for writes.
19
+ * 500 is excluded (it may indicate a partial side effect).
20
+ */
21
+ export declare const RETRYABLE_STATUS: ReadonlySet<number>;
22
+ /** Parse a server `Retry-After` header (delta-seconds or HTTP-date) into ms,
23
+ * capped at 30s. Returns null when the header is absent or unparseable. */
24
+ export declare function serverRetryAfterMs(retryAfter: string | null | undefined): number | null;
25
+ /** Resolve a backoff delay, honoring a server `Retry-After` header when present. */
26
+ export declare function retryAfterMs(retryAfter: string | null | undefined, attempt: number): number;
27
+ /** Equal jitter: keep half the delay fixed and randomize the other half, so the
28
+ * result lands in `[delay/2, delay]`. Spreads correlated retries (thundering
29
+ * herd) without ever waiting longer than the computed backoff. */
30
+ export declare function applyJitter(delayMs: number, random?: () => number): number;
31
+ /**
32
+ * Single source of truth for the retry decision shared by the hand-written
33
+ * `HttpClient` and the generated-client adapter. Returns the number of ms to
34
+ * wait before retrying, or `null` when the status is non-retryable or retries
35
+ * are exhausted. A server-advised `Retry-After` is honored verbatim (no jitter);
36
+ * the computed exponential backoff gets equal jitter.
37
+ */
38
+ export declare function retryDelayForStatus(status: number, attempt: number, maxRetries: number, retryAfterHeader: string | null | undefined, random?: () => number): number | null;
15
39
  export {};