@stigmer/sdk 3.1.8 → 3.1.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/gen/agent.d.ts +1 -20
- package/gen/agent.d.ts.map +1 -1
- package/gen/agent.js +1 -54
- package/gen/agent.js.map +1 -1
- package/gen/agentshare.d.ts +45 -0
- package/gen/agentshare.d.ts.map +1 -0
- package/gen/agentshare.js +142 -0
- package/gen/agentshare.js.map +1 -0
- package/gen/authorization-config.d.ts.map +1 -1
- package/gen/authorization-config.js +1 -0
- package/gen/authorization-config.js.map +1 -1
- package/gen/client.d.ts +5 -1
- package/gen/client.d.ts.map +1 -1
- package/gen/client.js +4 -0
- package/gen/client.js.map +1 -1
- package/guest-auth.d.ts +19 -16
- package/guest-auth.d.ts.map +1 -1
- package/guest-auth.js +5 -5
- package/guest-auth.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/sharing.d.ts +5 -4
- package/sharing.d.ts.map +1 -1
- package/sharing.js +6 -5
- package/sharing.js.map +1 -1
- package/src/gen/agent.ts +2 -61
- package/src/gen/agentshare.ts +148 -0
- package/src/gen/authorization-config.ts +1 -0
- package/src/gen/client.ts +6 -1
- package/src/guest-auth.ts +20 -17
- package/src/index.ts +5 -0
- package/src/sharing.ts +6 -5
package/guest-auth.js
CHANGED
|
@@ -189,10 +189,10 @@ function safeSetItem(storage, key, value) {
|
|
|
189
189
|
* or embed.
|
|
190
190
|
*
|
|
191
191
|
* This is the browser-side counterpart of `createPlatformClientAuth`:
|
|
192
|
-
* it involves **no credentials** — the server gates minting on
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
192
|
+
* it involves **no credentials** — the server gates minting on an
|
|
193
|
+
* enabled AgentShare and issues a short-lived guest JWT scoped to the
|
|
194
|
+
* sharing org. Pass {@link GuestAuth.getAccessToken} to a `Stigmer`
|
|
195
|
+
* client and every request authenticates as this visitor.
|
|
196
196
|
*
|
|
197
197
|
* @example
|
|
198
198
|
* ```typescript
|
|
@@ -220,7 +220,7 @@ export function createGuestAuth(config) {
|
|
|
220
220
|
throw new Error("createGuestAuth: org is required — the organization slug from the share URL");
|
|
221
221
|
}
|
|
222
222
|
if (!config.slug) {
|
|
223
|
-
throw new Error("createGuestAuth: slug is required — the
|
|
223
|
+
throw new Error("createGuestAuth: slug is required — the share slug from the share URL");
|
|
224
224
|
}
|
|
225
225
|
return new GuestAuth(config);
|
|
226
226
|
}
|
package/guest-auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guest-auth.js","sourceRoot":"","sources":["../src/guest-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAe,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"guest-auth.js","sourceRoot":"","sources":["../src/guest-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAe,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,iB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;;GA2BG;AACH,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { type DeleteResourceInput, type ResourceRef, type Page, type ListParams,
|
|
|
18
18
|
export { AgentClient, type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInput, type SubAgentInput, type McpAccessInput, } from "./gen/agent.js";
|
|
19
19
|
export { AgentExecutionClient, type AgentExecutionInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput, } from "./gen/agentexecution.js";
|
|
20
20
|
export { AgentInstanceClient, type AgentInstanceInput, } from "./gen/agentinstance.js";
|
|
21
|
+
export { AgentShareClient, type AgentShareInput, type AgentShareMessagesInput, } from "./gen/agentshare.js";
|
|
21
22
|
export { ApiKeyClient, type ApiKeyInput } from "./gen/apikey.js";
|
|
22
23
|
export { EnvironmentClient, type EnvironmentInput, } from "./gen/environment.js";
|
|
23
24
|
export { ExecutionContextClient, type ExecutionContextInput, } from "./gen/executioncontext.js";
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,mB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AC1B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,KAAK,sBAAsB,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGrE,OAAO,EACL,eAAe,EACf,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,KAAK,aAAa,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,cAAc,EACnB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,C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ACtB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,KAAK,sBAAsB,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC"}
|
package/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export { PlatformClient, } from "./platform.js";
|
|
|
29
29
|
export { AgentClient, } from "./gen/agent.js";
|
|
30
30
|
export { AgentExecutionClient, } from "./gen/agentexecution.js";
|
|
31
31
|
export { AgentInstanceClient, } from "./gen/agentinstance.js";
|
|
32
|
+
export { AgentShareClient, } from "./gen/agentshare.js";
|
|
32
33
|
export { ApiKeyClient } from "./gen/apikey.js";
|
|
33
34
|
export { EnvironmentClient, } from "./gen/environment.js";
|
|
34
35
|
export { ExecutionContextClient, } from "./gen/executioncontext.js";
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9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Ae,EAAE,MAAM,cAAc,CAAC;AAEhE,uFAAuF;AACvF,OAAO,EACL,QAAQ,EACR,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,GAIpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAmB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EACL,cAAc,GAMf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,GAExB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,GAEvB,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/sdk",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.9",
|
|
4
4
|
"description": "Stigmer TypeScript SDK — typed API client for all Stigmer platform resources",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@bufbuild/protobuf": "^2.0.0",
|
|
46
46
|
"@connectrpc/connect-node": "^2.0.0",
|
|
47
|
-
"@stigmer/protos": "3.1.
|
|
47
|
+
"@stigmer/protos": "3.1.9"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/sharing.d.ts
CHANGED
|
@@ -29,9 +29,10 @@ export declare function validateOrigin(value: string): string | null;
|
|
|
29
29
|
*/
|
|
30
30
|
export declare const LINK_TOKEN_PARAM = "k";
|
|
31
31
|
/**
|
|
32
|
-
* The hosted chat page path for a shared agent: `/chat/<org>/<slug
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* The hosted chat page path for a shared agent: `/chat/<org>/<slug>`
|
|
33
|
+
* (the AgentShare's org and slug — the slug defaults to the agent's),
|
|
34
|
+
* plus `?k=<token>` when the share link is locked with a rotatable
|
|
35
|
+
* token (`AgentShareStatus.share_link_token`).
|
|
35
36
|
*
|
|
36
37
|
* Useful on its own when the caller renders relative to the current
|
|
37
38
|
* origin (e.g. a host that never configured an absolute app URL).
|
|
@@ -53,7 +54,7 @@ export declare function buildChatUrl(appOrigin: string, org: string, slug: strin
|
|
|
53
54
|
* For hosts that construct the base URL through their own callback (the
|
|
54
55
|
* share dialog's `buildShareUrl` prop) rather than {@link buildChatUrl}.
|
|
55
56
|
* A `null`/empty token returns the URL unchanged, so callers can pass
|
|
56
|
-
* `
|
|
57
|
+
* `share.status?.shareLinkToken` straight through. Emits the identical
|
|
57
58
|
* `?k=` shape as {@link chatPath} — one URL grammar across every surface.
|
|
58
59
|
*/
|
|
59
60
|
export declare function appendLinkToken(url: string, linkToken: string | null | undefined): string;
|
package/sharing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharing.d.ts","sourceRoot":"","sources":["../src/sharing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,KAAK,CAAC;AActC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC
|
|
1
|
+
{"version":3,"file":"sharing.d.ts","sourceRoot":"","sources":["../src/sharing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,KAAK,CAAC;AActC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAK9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAIzF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAMR"}
|
package/sharing.js
CHANGED
|
@@ -17,7 +17,7 @@ export const MAX_ALLOWED_ORIGINS = 32;
|
|
|
17
17
|
/**
|
|
18
18
|
* Exact web origin: scheme://host[:port] — no path, query, fragment, or
|
|
19
19
|
* trailing slash. Mirrors the CEL expression `allowed_origins.format` on
|
|
20
|
-
* `
|
|
20
|
+
* `AgentShareSpec` (`apis/ai/stigmer/agentic/agentshare/v1/spec.proto`).
|
|
21
21
|
*
|
|
22
22
|
* The proto is the source of truth — if the CEL expression changes, this
|
|
23
23
|
* pattern must change with it. Mirroring it client-side gives immediate
|
|
@@ -47,9 +47,10 @@ export function validateOrigin(value) {
|
|
|
47
47
|
*/
|
|
48
48
|
export const LINK_TOKEN_PARAM = "k";
|
|
49
49
|
/**
|
|
50
|
-
* The hosted chat page path for a shared agent: `/chat/<org>/<slug
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* The hosted chat page path for a shared agent: `/chat/<org>/<slug>`
|
|
51
|
+
* (the AgentShare's org and slug — the slug defaults to the agent's),
|
|
52
|
+
* plus `?k=<token>` when the share link is locked with a rotatable
|
|
53
|
+
* token (`AgentShareStatus.share_link_token`).
|
|
53
54
|
*
|
|
54
55
|
* Useful on its own when the caller renders relative to the current
|
|
55
56
|
* origin (e.g. a host that never configured an absolute app URL).
|
|
@@ -78,7 +79,7 @@ export function buildChatUrl(appOrigin, org, slug, linkToken) {
|
|
|
78
79
|
* For hosts that construct the base URL through their own callback (the
|
|
79
80
|
* share dialog's `buildShareUrl` prop) rather than {@link buildChatUrl}.
|
|
80
81
|
* A `null`/empty token returns the URL unchanged, so callers can pass
|
|
81
|
-
* `
|
|
82
|
+
* `share.status?.shareLinkToken` straight through. Emits the identical
|
|
82
83
|
* `?k=` shape as {@link chatPath} — one URL grammar across every surface.
|
|
83
84
|
*/
|
|
84
85
|
export function appendLinkToken(url, linkToken) {
|
package/sharing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharing.js","sourceRoot":"","sources":["../src/sharing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC;;;;;;;;GAQG;AACH,MAAM,cAAc,GAClB,8GAA8G,CAAC;AAEjH;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO,2CAA2C,CAAC;IACjE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,0FAA0F,CAAC;IACpG,CAAC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GAAW,EAAE,SAAoC;IAC/E,IAAI,CAAC,SAAS;QAAE,OAAO,GAAG,CAAC;IAC3B,MAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAChD,OAAO,GAAG,GAAG,GAAG,SAAS,GAAG,gBAAgB,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;AAClF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC,WAAW,CAAC;AACrD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAiB,EACjB,GAAW,EACX,IAAY,EACZ,SAAkB;IAElB,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,WAAW,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,OAAO;QACL,gBAAgB,mBAAmB,CAAC,SAAS,CAAC,mBAAmB;QACjE,uBAAuB,GAAG,YAAY,IAAI,IAAI,cAAc,mBAAmB;KAChF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC7D,CAAC"}
|
package/src/gen/agent.ts
CHANGED
|
@@ -7,9 +7,9 @@ import { create } from "@bufbuild/protobuf";
|
|
|
7
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
8
|
import { AgentSchema, type Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
9
9
|
import { AgentCommandController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/command_pb";
|
|
10
|
-
import { AgentIdSchema,
|
|
10
|
+
import { AgentIdSchema, GetDefaultAgentRequestSchema, type GetDefaultAgentRequest } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/io_pb";
|
|
11
11
|
import { AgentQueryController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/query_pb";
|
|
12
|
-
import { AgentSpecSchema,
|
|
12
|
+
import { AgentSpecSchema, ToolApprovalOverrideSchema, McpServerUsageSchema, McpAccessSchema, SubAgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
13
13
|
import { EnvVarDeclarationSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
14
14
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
15
15
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
@@ -55,18 +55,6 @@ export class AgentClient {
|
|
|
55
55
|
} catch (e) { throw wrapError(e); }
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
async updateSharing(input: UpdateAgentSharingInput): Promise<Agent> {
|
|
59
|
-
try {
|
|
60
|
-
return await this.command.updateSharing(input);
|
|
61
|
-
} catch (e) { throw wrapError(e); }
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async rotateShareLink(input: RotateShareLinkInput): Promise<Agent> {
|
|
65
|
-
try {
|
|
66
|
-
return await this.command.rotateShareLink(input);
|
|
67
|
-
} catch (e) { throw wrapError(e); }
|
|
68
|
-
}
|
|
69
|
-
|
|
70
58
|
async delete(id: string): Promise<Agent> {
|
|
71
59
|
try {
|
|
72
60
|
return await this.command.delete(create(AgentIdSchema, { value: id }));
|
|
@@ -91,18 +79,6 @@ export class AgentClient {
|
|
|
91
79
|
} catch (e) { throw wrapError(e); }
|
|
92
80
|
}
|
|
93
81
|
|
|
94
|
-
async getSharedProfile(input: GetSharedProfileRequest): Promise<SharedAgentProfile> {
|
|
95
|
-
try {
|
|
96
|
-
return await this.query.getSharedProfile(input);
|
|
97
|
-
} catch (e) { throw wrapError(e); }
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
async getSharedProfileForMember(ref: ResourceRef): Promise<SharedAgentProfile> {
|
|
101
|
-
try {
|
|
102
|
-
return await this.query.getSharedProfileForMember(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.agent }));
|
|
103
|
-
} catch (e) { throw wrapError(e); }
|
|
104
|
-
}
|
|
105
|
-
|
|
106
82
|
async list(params: ListParams): Promise<ListResult> {
|
|
107
83
|
try {
|
|
108
84
|
const resp = await this.search.search(create(SearchRequestSchema, {
|
|
@@ -136,7 +112,6 @@ export interface AgentInput {
|
|
|
136
112
|
skillRefs?: ResourceRef[];
|
|
137
113
|
subAgents?: SubAgentInput[];
|
|
138
114
|
env?: Record<string, EnvVarDeclarationInput>;
|
|
139
|
-
sharing?: AgentSharingInput;
|
|
140
115
|
}
|
|
141
116
|
|
|
142
117
|
/** SDK input type for McpServerUsage. */
|
|
@@ -176,21 +151,6 @@ export interface EnvVarDeclarationInput {
|
|
|
176
151
|
optional?: boolean;
|
|
177
152
|
}
|
|
178
153
|
|
|
179
|
-
/** SDK input type for AgentSharing. */
|
|
180
|
-
export interface AgentSharingInput {
|
|
181
|
-
enabled?: boolean;
|
|
182
|
-
allowedOrigins?: string[];
|
|
183
|
-
messages?: AgentSharingMessagesInput;
|
|
184
|
-
audience?: AgentSharingAudience;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/** SDK input type for AgentSharingMessages. */
|
|
188
|
-
export interface AgentSharingMessagesInput {
|
|
189
|
-
rateLimited?: string;
|
|
190
|
-
unavailable?: string;
|
|
191
|
-
conversationEnded?: string;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
154
|
function buildToolApprovalOverrideProto(input: ToolApprovalOverrideInput) {
|
|
195
155
|
return Object.assign(create(ToolApprovalOverrideSchema), stripUndefined({
|
|
196
156
|
toolName: input.toolName,
|
|
@@ -233,23 +193,6 @@ function buildEnvVarDeclarationProto(input: EnvVarDeclarationInput) {
|
|
|
233
193
|
}));
|
|
234
194
|
}
|
|
235
195
|
|
|
236
|
-
function buildAgentSharingMessagesProto(input: AgentSharingMessagesInput) {
|
|
237
|
-
return Object.assign(create(AgentSharingMessagesSchema), stripUndefined({
|
|
238
|
-
rateLimited: input.rateLimited,
|
|
239
|
-
unavailable: input.unavailable,
|
|
240
|
-
conversationEnded: input.conversationEnded,
|
|
241
|
-
}));
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function buildAgentSharingProto(input: AgentSharingInput) {
|
|
245
|
-
const msg = create(AgentSharingSchema);
|
|
246
|
-
if (input.enabled !== undefined) msg.enabled = input.enabled;
|
|
247
|
-
if (input.allowedOrigins) msg.allowedOrigins = input.allowedOrigins;
|
|
248
|
-
if (input.messages) msg.messages = buildAgentSharingMessagesProto(input.messages);
|
|
249
|
-
if (input.audience !== undefined) msg.audience = input.audience;
|
|
250
|
-
return msg;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
196
|
export function buildAgentProto(input: AgentInput): Agent {
|
|
254
197
|
const mcpServerUsages = input.mcpServerUsages?.map(buildMcpServerUsageProto);
|
|
255
198
|
const skillRefs = input.skillRefs?.map(r => create(ApiResourceReferenceSchema, { ...r, kind: 43 }));
|
|
@@ -258,7 +201,6 @@ export function buildAgentProto(input: AgentInput): Agent {
|
|
|
258
201
|
if (input.env) {
|
|
259
202
|
env = Object.fromEntries(Object.entries(input.env).map(([k, v]) => [k, buildEnvVarDeclarationProto(v)]));
|
|
260
203
|
}
|
|
261
|
-
const sharing = input.sharing ? buildAgentSharingProto(input.sharing) : undefined;
|
|
262
204
|
return Object.assign(create(AgentSchema), {
|
|
263
205
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
264
206
|
kind: "Agent",
|
|
@@ -277,7 +219,6 @@ export function buildAgentProto(input: AgentInput): Agent {
|
|
|
277
219
|
skillRefs,
|
|
278
220
|
subAgents,
|
|
279
221
|
env,
|
|
280
|
-
sharing,
|
|
281
222
|
})),
|
|
282
223
|
}) as Agent;
|
|
283
224
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import { wrapError } from "./errors.js";
|
|
4
|
+
import { stripUndefined } from "./proto-utils.js";
|
|
5
|
+
import { type ResourceRef } from "./types.js";
|
|
6
|
+
import { create } from "@bufbuild/protobuf";
|
|
7
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
|
+
import { AgentShareSchema, type AgentShare } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
9
|
+
import { AgentShareCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/command_pb";
|
|
10
|
+
import { AgentShareIdSchema, RotateShareLinkInputSchema, GetAgentSharesByAgentRequestSchema, AgentShareListSchema, ListAgentSharesRequestSchema, GetSharedProfileRequestSchema, SharedAgentProfileSchema, type RotateShareLinkInput, type GetAgentSharesByAgentRequest, type AgentShareList, type ListAgentSharesRequest, type GetSharedProfileRequest, type SharedAgentProfile } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/io_pb";
|
|
11
|
+
import { AgentShareQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/query_pb";
|
|
12
|
+
import { AgentShareSpecSchema, AgentShareAudience, AgentShareMessagesSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
|
|
13
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
14
|
+
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
15
|
+
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
16
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
17
|
+
|
|
18
|
+
/** Provides operations on agentshare resources. */
|
|
19
|
+
export class AgentShareClient {
|
|
20
|
+
private readonly command: Client<typeof AgentShareCommandController>;
|
|
21
|
+
private readonly query: Client<typeof AgentShareQueryController>;
|
|
22
|
+
|
|
23
|
+
constructor(transport: Transport) {
|
|
24
|
+
this.command = createClient(AgentShareCommandController, transport);
|
|
25
|
+
this.query = createClient(AgentShareQueryController, transport);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async apply(input: AgentShareInput): Promise<AgentShare> {
|
|
29
|
+
try {
|
|
30
|
+
return await this.command.apply(buildAgentShareProto(input));
|
|
31
|
+
} catch (e) { throw wrapError(e); }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async create(input: AgentShareInput): Promise<AgentShare> {
|
|
35
|
+
try {
|
|
36
|
+
return await this.command.create(buildAgentShareProto(input));
|
|
37
|
+
} catch (e) { throw wrapError(e); }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async update(input: AgentShareInput): Promise<AgentShare> {
|
|
41
|
+
try {
|
|
42
|
+
return await this.command.update(buildAgentShareProto(input));
|
|
43
|
+
} catch (e) { throw wrapError(e); }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async rotateShareLink(input: RotateShareLinkInput): Promise<AgentShare> {
|
|
47
|
+
try {
|
|
48
|
+
return await this.command.rotateShareLink(input);
|
|
49
|
+
} catch (e) { throw wrapError(e); }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async delete(id: string): Promise<AgentShare> {
|
|
53
|
+
try {
|
|
54
|
+
return await this.command.delete(create(AgentShareIdSchema, { value: id }));
|
|
55
|
+
} catch (e) { throw wrapError(e); }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async get(id: string): Promise<AgentShare> {
|
|
59
|
+
try {
|
|
60
|
+
return await this.query.get(create(AgentShareIdSchema, { value: id }));
|
|
61
|
+
} catch (e) { throw wrapError(e); }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async getByReference(ref: ResourceRef): Promise<AgentShare> {
|
|
65
|
+
try {
|
|
66
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.agent_share }));
|
|
67
|
+
} catch (e) { throw wrapError(e); }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async getByAgent(input: GetAgentSharesByAgentRequest): Promise<AgentShareList> {
|
|
71
|
+
try {
|
|
72
|
+
return await this.query.getByAgent(input);
|
|
73
|
+
} catch (e) { throw wrapError(e); }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async list(input: ListAgentSharesRequest): Promise<AgentShareList> {
|
|
77
|
+
try {
|
|
78
|
+
return await this.query.list(input);
|
|
79
|
+
} catch (e) { throw wrapError(e); }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async getSharedProfile(input: GetSharedProfileRequest): Promise<SharedAgentProfile> {
|
|
83
|
+
try {
|
|
84
|
+
return await this.query.getSharedProfile(input);
|
|
85
|
+
} catch (e) { throw wrapError(e); }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async getSharedProfileForMember(ref: ResourceRef): Promise<SharedAgentProfile> {
|
|
89
|
+
try {
|
|
90
|
+
return await this.query.getSharedProfileForMember(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.agent_share }));
|
|
91
|
+
} catch (e) { throw wrapError(e); }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Input for creating/updating a AgentShare. */
|
|
96
|
+
export interface AgentShareInput {
|
|
97
|
+
name: string;
|
|
98
|
+
slug?: string;
|
|
99
|
+
org: string;
|
|
100
|
+
labels?: Record<string, string>;
|
|
101
|
+
visibility?: ApiResourceVisibility;
|
|
102
|
+
agentRef: ResourceRef;
|
|
103
|
+
enabled?: boolean;
|
|
104
|
+
audience?: AgentShareAudience;
|
|
105
|
+
allowedOrigins?: string[];
|
|
106
|
+
messages?: AgentShareMessagesInput;
|
|
107
|
+
environmentRefs?: ResourceRef[];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** SDK input type for AgentShareMessages. */
|
|
111
|
+
export interface AgentShareMessagesInput {
|
|
112
|
+
rateLimited?: string;
|
|
113
|
+
unavailable?: string;
|
|
114
|
+
conversationEnded?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function buildAgentShareMessagesProto(input: AgentShareMessagesInput) {
|
|
118
|
+
return Object.assign(create(AgentShareMessagesSchema), stripUndefined({
|
|
119
|
+
rateLimited: input.rateLimited,
|
|
120
|
+
unavailable: input.unavailable,
|
|
121
|
+
conversationEnded: input.conversationEnded,
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function buildAgentShareProto(input: AgentShareInput): AgentShare {
|
|
126
|
+
const agentRef = (input.agentRef?.slug || input.agentRef?.org) ? create(ApiResourceReferenceSchema, { ...input.agentRef, kind: 40 }) : undefined;
|
|
127
|
+
const messages = input.messages ? buildAgentShareMessagesProto(input.messages) : undefined;
|
|
128
|
+
const environmentRefs = input.environmentRefs?.map(r => create(ApiResourceReferenceSchema, { ...r, kind: 53 }));
|
|
129
|
+
return Object.assign(create(AgentShareSchema), {
|
|
130
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
131
|
+
kind: "AgentShare",
|
|
132
|
+
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
133
|
+
name: input.name,
|
|
134
|
+
org: input.org,
|
|
135
|
+
...(input.slug && { slug: input.slug }),
|
|
136
|
+
...(input.labels && { labels: input.labels }),
|
|
137
|
+
...(input.visibility && { visibility: input.visibility }),
|
|
138
|
+
}),
|
|
139
|
+
spec: Object.assign(create(AgentShareSpecSchema), stripUndefined({
|
|
140
|
+
agentRef,
|
|
141
|
+
enabled: input.enabled,
|
|
142
|
+
audience: input.audience,
|
|
143
|
+
allowedOrigins: input.allowedOrigins,
|
|
144
|
+
messages,
|
|
145
|
+
environmentRefs,
|
|
146
|
+
})),
|
|
147
|
+
}) as AgentShare;
|
|
148
|
+
}
|
|
@@ -23,6 +23,7 @@ export const GRANTABLE_ROLES: ReadonlyMap<ApiResourceKind, readonly IamRole[]> =
|
|
|
23
23
|
[ApiResourceKind.skill, [IamRole.owner, IamRole.viewer]],
|
|
24
24
|
[ApiResourceKind.mcp_server, [IamRole.owner, IamRole.viewer]],
|
|
25
25
|
[ApiResourceKind.agent_instance, [IamRole.owner, IamRole.viewer]],
|
|
26
|
+
[ApiResourceKind.agent_share, [IamRole.owner, IamRole.viewer]],
|
|
26
27
|
[ApiResourceKind.workflow, [IamRole.owner, IamRole.viewer]],
|
|
27
28
|
[ApiResourceKind.workflow_instance, [IamRole.owner, IamRole.viewer]],
|
|
28
29
|
[ApiResourceKind.workflow_execution, [IamRole.owner, IamRole.viewer]],
|
package/src/gen/client.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Transport } from "@connectrpc/connect";
|
|
|
4
4
|
import { AgentClient } from "./agent.js";
|
|
5
5
|
import { AgentExecutionClient } from "./agentexecution.js";
|
|
6
6
|
import { AgentInstanceClient } from "./agentinstance.js";
|
|
7
|
+
import { AgentShareClient } from "./agentshare.js";
|
|
7
8
|
import { ApiKeyClient } from "./apikey.js";
|
|
8
9
|
import { ArtifactClient } from "./artifact.js";
|
|
9
10
|
import { EnvironmentClient } from "./environment.js";
|
|
@@ -28,6 +29,7 @@ export class GeneratedClient {
|
|
|
28
29
|
readonly agent: AgentClient;
|
|
29
30
|
readonly agentExecution: AgentExecutionClient;
|
|
30
31
|
readonly agentInstance: AgentInstanceClient;
|
|
32
|
+
readonly agentShare: AgentShareClient;
|
|
31
33
|
readonly apiKey: ApiKeyClient;
|
|
32
34
|
readonly artifact: ArtifactClient;
|
|
33
35
|
readonly environment: EnvironmentClient;
|
|
@@ -51,6 +53,7 @@ export class GeneratedClient {
|
|
|
51
53
|
this.agent = new AgentClient(transport);
|
|
52
54
|
this.agentExecution = new AgentExecutionClient(transport);
|
|
53
55
|
this.agentInstance = new AgentInstanceClient(transport);
|
|
56
|
+
this.agentShare = new AgentShareClient(transport);
|
|
54
57
|
this.apiKey = new ApiKeyClient(transport);
|
|
55
58
|
this.artifact = new ArtifactClient(transport);
|
|
56
59
|
this.environment = new EnvironmentClient(transport);
|
|
@@ -74,11 +77,13 @@ export class GeneratedClient {
|
|
|
74
77
|
|
|
75
78
|
// Re-export all resource client types and input types.
|
|
76
79
|
export { AgentClient } from "./agent.js";
|
|
77
|
-
export { type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInput, type SubAgentInput, type McpAccessInput, type EnvVarDeclarationInput
|
|
80
|
+
export { type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInput, type SubAgentInput, type McpAccessInput, type EnvVarDeclarationInput } from "./agent.js";
|
|
78
81
|
export { AgentExecutionClient } from "./agentexecution.js";
|
|
79
82
|
export { type AgentExecutionInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput } from "./agentexecution.js";
|
|
80
83
|
export { AgentInstanceClient } from "./agentinstance.js";
|
|
81
84
|
export { type AgentInstanceInput } from "./agentinstance.js";
|
|
85
|
+
export { AgentShareClient } from "./agentshare.js";
|
|
86
|
+
export { type AgentShareInput, type AgentShareMessagesInput } from "./agentshare.js";
|
|
82
87
|
export { ApiKeyClient } from "./apikey.js";
|
|
83
88
|
export { type ApiKeyInput } from "./apikey.js";
|
|
84
89
|
export { ArtifactClient } from "./artifact.js";
|
package/src/guest-auth.ts
CHANGED
|
@@ -26,8 +26,8 @@ export interface GuestIdStorage {
|
|
|
26
26
|
*
|
|
27
27
|
* Unlike {@link PlatformClientAuthConfig}, this carries **no
|
|
28
28
|
* credentials** — `mintGuestToken` is a public RPC gated server-side
|
|
29
|
-
* on the
|
|
30
|
-
* directly from a browser.
|
|
29
|
+
* on an enabled AgentShare at the given org/slug. It is therefore safe
|
|
30
|
+
* to use directly from a browser.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
@@ -47,7 +47,11 @@ export interface GuestAuthConfig {
|
|
|
47
47
|
/** Organization slug from the share URL. */
|
|
48
48
|
readonly org: string;
|
|
49
49
|
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Share slug from the share URL. Defaults to the shared agent's slug
|
|
52
|
+
* when the owner never customized it, so existing links pass the
|
|
53
|
+
* agent's slug here unchanged.
|
|
54
|
+
*/
|
|
51
55
|
readonly slug: string;
|
|
52
56
|
|
|
53
57
|
/**
|
|
@@ -67,21 +71,20 @@ export interface GuestAuthConfig {
|
|
|
67
71
|
* embedding page's origin, discovered via `@stigmer/embed`'s
|
|
68
72
|
* `resolveParentOrigin`) or directly in your own app
|
|
69
73
|
* (`window.location.origin`). Leave unset on the unframed hosted
|
|
70
|
-
* page. The server validates it against the
|
|
71
|
-
* `
|
|
72
|
-
*
|
|
73
|
-
* not allowed.
|
|
74
|
+
* page. The server validates it against the share's
|
|
75
|
+
* `allowed_origins` at mint (an empty list admits any origin) and
|
|
76
|
+
* refuses with `"permission-denied"` when the origin is not allowed.
|
|
74
77
|
*/
|
|
75
78
|
readonly embedOrigin?: string;
|
|
76
79
|
|
|
77
80
|
/**
|
|
78
81
|
* Share-link token from the URL's `?k=` parameter.
|
|
79
82
|
*
|
|
80
|
-
* Required when the
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
83
|
+
* Required when the share link has been locked with a rotatable
|
|
84
|
+
* token; harmless (ignored server-side) on plain links. On a locked
|
|
85
|
+
* link a missing or rotated-away token refuses the mint with
|
|
86
|
+
* `"not-found"` — deliberately indistinguishable from an agent that
|
|
87
|
+
* does not exist.
|
|
85
88
|
*/
|
|
86
89
|
readonly linkToken?: string;
|
|
87
90
|
}
|
|
@@ -287,10 +290,10 @@ function safeSetItem(storage: GuestIdStorage, key: string, value: string): void
|
|
|
287
290
|
* or embed.
|
|
288
291
|
*
|
|
289
292
|
* This is the browser-side counterpart of `createPlatformClientAuth`:
|
|
290
|
-
* it involves **no credentials** — the server gates minting on
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
293
|
+
* it involves **no credentials** — the server gates minting on an
|
|
294
|
+
* enabled AgentShare and issues a short-lived guest JWT scoped to the
|
|
295
|
+
* sharing org. Pass {@link GuestAuth.getAccessToken} to a `Stigmer`
|
|
296
|
+
* client and every request authenticates as this visitor.
|
|
294
297
|
*
|
|
295
298
|
* @example
|
|
296
299
|
* ```typescript
|
|
@@ -323,7 +326,7 @@ export function createGuestAuth(config: GuestAuthConfig): GuestAuth {
|
|
|
323
326
|
}
|
|
324
327
|
if (!config.slug) {
|
|
325
328
|
throw new Error(
|
|
326
|
-
"createGuestAuth: slug is required — the
|
|
329
|
+
"createGuestAuth: slug is required — the share slug from the share URL",
|
|
327
330
|
);
|
|
328
331
|
}
|
|
329
332
|
|
package/src/index.ts
CHANGED
|
@@ -145,6 +145,11 @@ export {
|
|
|
145
145
|
AgentInstanceClient,
|
|
146
146
|
type AgentInstanceInput,
|
|
147
147
|
} from "./gen/agentinstance.js";
|
|
148
|
+
export {
|
|
149
|
+
AgentShareClient,
|
|
150
|
+
type AgentShareInput,
|
|
151
|
+
type AgentShareMessagesInput,
|
|
152
|
+
} from "./gen/agentshare.js";
|
|
148
153
|
export { ApiKeyClient, type ApiKeyInput } from "./gen/apikey.js";
|
|
149
154
|
export {
|
|
150
155
|
EnvironmentClient,
|
package/src/sharing.ts
CHANGED
|
@@ -19,7 +19,7 @@ export const MAX_ALLOWED_ORIGINS = 32;
|
|
|
19
19
|
/**
|
|
20
20
|
* Exact web origin: scheme://host[:port] — no path, query, fragment, or
|
|
21
21
|
* trailing slash. Mirrors the CEL expression `allowed_origins.format` on
|
|
22
|
-
* `
|
|
22
|
+
* `AgentShareSpec` (`apis/ai/stigmer/agentic/agentshare/v1/spec.proto`).
|
|
23
23
|
*
|
|
24
24
|
* The proto is the source of truth — if the CEL expression changes, this
|
|
25
25
|
* pattern must change with it. Mirroring it client-side gives immediate
|
|
@@ -52,9 +52,10 @@ export function validateOrigin(value: string): string | null {
|
|
|
52
52
|
export const LINK_TOKEN_PARAM = "k";
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* The hosted chat page path for a shared agent: `/chat/<org>/<slug
|
|
56
|
-
*
|
|
57
|
-
*
|
|
55
|
+
* The hosted chat page path for a shared agent: `/chat/<org>/<slug>`
|
|
56
|
+
* (the AgentShare's org and slug — the slug defaults to the agent's),
|
|
57
|
+
* plus `?k=<token>` when the share link is locked with a rotatable
|
|
58
|
+
* token (`AgentShareStatus.share_link_token`).
|
|
58
59
|
*
|
|
59
60
|
* Useful on its own when the caller renders relative to the current
|
|
60
61
|
* origin (e.g. a host that never configured an absolute app URL).
|
|
@@ -90,7 +91,7 @@ export function buildChatUrl(
|
|
|
90
91
|
* For hosts that construct the base URL through their own callback (the
|
|
91
92
|
* share dialog's `buildShareUrl` prop) rather than {@link buildChatUrl}.
|
|
92
93
|
* A `null`/empty token returns the URL unchanged, so callers can pass
|
|
93
|
-
* `
|
|
94
|
+
* `share.status?.shareLinkToken` straight through. Emits the identical
|
|
94
95
|
* `?k=` shape as {@link chatPath} — one URL grammar across every surface.
|
|
95
96
|
*/
|
|
96
97
|
export function appendLinkToken(url: string, linkToken: string | null | undefined): string {
|