primitive-functions 0.3.0-alpha.8 → 0.3.0-alpha.9
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.
- package/index.d.ts +52 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -142,7 +142,11 @@ export type FunctionTriggerKind = FunctionTrigger["kind"];
|
|
|
142
142
|
*/
|
|
143
143
|
export interface FunctionToolContext {
|
|
144
144
|
readonly sessionId: string;
|
|
145
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* The session's document, which holds its messages.
|
|
147
|
+
* @deprecated Use `sessionId` with the session API (`ctx.agents`,
|
|
148
|
+
* `ctx.api.agentSessions`); the field remains until a later breaking release.
|
|
149
|
+
*/
|
|
146
150
|
readonly documentId: string;
|
|
147
151
|
readonly turnId: string;
|
|
148
152
|
/** The call's id, the same on every attempt: an idempotency key. */
|
|
@@ -247,6 +251,30 @@ export interface FunctionApi {
|
|
|
247
251
|
"callId": string | number;
|
|
248
252
|
body: unknown;
|
|
249
253
|
}): Promise<any>;
|
|
254
|
+
"attachments": {
|
|
255
|
+
/** `agentSessions.attachments.downloadHeaders` — HEAD /agent-sessions/{sessionId}/attachments/{blobId}/download. Get an agent session attachment's download headers */
|
|
256
|
+
"downloadHeaders"(args: {
|
|
257
|
+
"sessionId": string | number;
|
|
258
|
+
"blobId": string | number;
|
|
259
|
+
"disposition"?: string | number | boolean;
|
|
260
|
+
}): Promise<HeaderResult>;
|
|
261
|
+
/** `agentSessions.attachments.downloadUrl` — GET /agent-sessions/{sessionId}/attachments/{blobId}/download. Download an agent session attachment */
|
|
262
|
+
"downloadUrl"(args: {
|
|
263
|
+
"sessionId": string | number;
|
|
264
|
+
"blobId": string | number;
|
|
265
|
+
"disposition"?: string | number | boolean;
|
|
266
|
+
}): Promise<Uint8Array>;
|
|
267
|
+
/** `agentSessions.attachments.upload` — PUT /agent-sessions/{sessionId}/attachments/{blobId}. Upload an agent session attachment */
|
|
268
|
+
"upload"(args: {
|
|
269
|
+
"sessionId": string | number;
|
|
270
|
+
"blobId": string | number;
|
|
271
|
+
"X-Blob-Filename": string | number;
|
|
272
|
+
"X-Blob-Size": string | number;
|
|
273
|
+
"X-Blob-Sha256": string | number;
|
|
274
|
+
"Content-Type"?: string | number;
|
|
275
|
+
body: ArrayBuffer | Uint8Array | string;
|
|
276
|
+
}): Promise<any>;
|
|
277
|
+
};
|
|
250
278
|
/** `agentSessions.cancel` — POST /agent-sessions/{sessionId}/cancel. Cancel an agent session's active turn */
|
|
251
279
|
"cancel"(args: {
|
|
252
280
|
"sessionId": string | number;
|
|
@@ -856,6 +884,7 @@ export interface FunctionApi {
|
|
|
856
884
|
"X-Blob-Filename": string | number;
|
|
857
885
|
"X-Blob-Size": string | number;
|
|
858
886
|
"X-Blob-Sha256": string | number;
|
|
887
|
+
"Content-Type"?: string | number;
|
|
859
888
|
body: ArrayBuffer | Uint8Array | string;
|
|
860
889
|
}): Promise<any>;
|
|
861
890
|
};
|
|
@@ -1889,7 +1918,11 @@ export interface AgentSessionCreateOptions<K extends SessionAgentKeys> {
|
|
|
1889
1918
|
export interface AgentSessionCreateResult {
|
|
1890
1919
|
/** The session: what the app keeps and uses for everything but opening. */
|
|
1891
1920
|
sessionId: string;
|
|
1892
|
-
/**
|
|
1921
|
+
/**
|
|
1922
|
+
* The session's conversation document, opened with the document client.
|
|
1923
|
+
* @deprecated Use `sessionId` with the session API (`ctx.agents`,
|
|
1924
|
+
* `ctx.api.agentSessions`); the field remains until a later breaking release.
|
|
1925
|
+
*/
|
|
1893
1926
|
documentId: string;
|
|
1894
1927
|
}
|
|
1895
1928
|
|
|
@@ -1897,7 +1930,11 @@ export interface AgentSessionCreateResult {
|
|
|
1897
1930
|
export interface AgentSessionInfo {
|
|
1898
1931
|
sessionId: string;
|
|
1899
1932
|
agentKey: string;
|
|
1900
|
-
/**
|
|
1933
|
+
/**
|
|
1934
|
+
* Open this with the document client to read the conversation.
|
|
1935
|
+
* @deprecated Use `sessionId` with the session API (`ctx.agents`,
|
|
1936
|
+
* `ctx.api.agentSessions`); the field remains until a later breaking release.
|
|
1937
|
+
*/
|
|
1901
1938
|
documentId: string;
|
|
1902
1939
|
ownerUserId: string;
|
|
1903
1940
|
/** ISO-8601. */
|
|
@@ -1962,6 +1999,11 @@ export interface AgentSessionListItem {
|
|
|
1962
1999
|
sessionId: string;
|
|
1963
2000
|
agentKey: string;
|
|
1964
2001
|
scope: string | null;
|
|
2002
|
+
/**
|
|
2003
|
+
* The session's conversation document.
|
|
2004
|
+
* @deprecated Use `sessionId` with the session API (`ctx.agents`,
|
|
2005
|
+
* `ctx.api.agentSessions`); the field remains until a later breaking release.
|
|
2006
|
+
*/
|
|
1965
2007
|
documentId: string;
|
|
1966
2008
|
ownerUserId: string;
|
|
1967
2009
|
role: "owner" | "participant" | "viewer";
|
|
@@ -1973,6 +2015,13 @@ export interface AgentSessionListItem {
|
|
|
1973
2015
|
hasUnread: boolean;
|
|
1974
2016
|
/** When the user last marked the session read (ISO-8601), or null. */
|
|
1975
2017
|
lastReadAt: string | null;
|
|
2018
|
+
/**
|
|
2019
|
+
* The session's status as of its last listed activity, or null for an
|
|
2020
|
+
* entry written before the status was listed. It may lag a status change
|
|
2021
|
+
* that came with no activity (a server tool's round); `getSession` reads
|
|
2022
|
+
* the current one.
|
|
2023
|
+
*/
|
|
2024
|
+
status: AgentSessionStatus | null;
|
|
1976
2025
|
}
|
|
1977
2026
|
|
|
1978
2027
|
/** What `ctx.agents.listSessions` takes — #3805. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primitive-functions",
|
|
3
|
-
"version": "0.3.0-alpha.
|
|
3
|
+
"version": "0.3.0-alpha.9",
|
|
4
4
|
"description": "The module a Primitive server function imports. Supplied by the platform at invoke time; reserved here so the name is ours before the runtime lands.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Primitive LLC",
|