@finalai/agents 0.11.0 → 0.13.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.
- package/HOSTING.md +334 -245
- package/README.md +214 -29
- package/dist/modules/agent-client/agent-input.d.mts +24 -0
- package/dist/modules/agent-client/agent-input.mjs +46 -0
- package/dist/modules/agent-client/agent-input.mjs.map +7 -0
- package/dist/modules/agent-client/channels.d.mts +128 -16
- package/dist/modules/agent-client/channels.mjs +216 -33
- package/dist/modules/agent-client/channels.mjs.map +2 -2
- package/dist/modules/agent-client/client.d.mts +91 -21
- package/dist/modules/agent-client/client.mjs +79 -24
- package/dist/modules/agent-client/client.mjs.map +2 -2
- package/dist/modules/agent-client/config-options.mjs +1 -2
- package/dist/modules/agent-client/config-options.mjs.map +2 -2
- package/dist/modules/agent-client/conversation-resources.d.mts +102 -0
- package/dist/modules/agent-client/conversation-resources.mjs +178 -0
- package/dist/modules/agent-client/conversation-resources.mjs.map +7 -0
- package/dist/modules/agent-client/conversations.d.mts +120 -38
- package/dist/modules/agent-client/conversations.mjs +386 -71
- package/dist/modules/agent-client/conversations.mjs.map +2 -2
- package/dist/modules/agent-client/defaults.d.mts +8 -0
- package/dist/modules/agent-client/defaults.mjs +77 -0
- package/dist/modules/agent-client/defaults.mjs.map +7 -0
- package/dist/modules/agent-client/errors.d.mts +22 -2
- package/dist/modules/agent-client/errors.mjs +19 -0
- package/dist/modules/agent-client/errors.mjs.map +2 -2
- package/dist/modules/agent-client/events.d.mts +62 -0
- package/dist/modules/agent-client/events.mjs +107 -0
- package/dist/modules/agent-client/events.mjs.map +7 -0
- package/dist/modules/agent-client/harnesses.d.mts +66 -0
- package/dist/modules/agent-client/harnesses.mjs +156 -0
- package/dist/modules/agent-client/harnesses.mjs.map +7 -0
- package/dist/modules/agent-client/http.d.mts +2 -1
- package/dist/modules/agent-client/http.mjs +21 -2
- package/dist/modules/agent-client/http.mjs.map +2 -2
- package/dist/modules/agent-client/index.d.mts +21 -6
- package/dist/modules/agent-client/index.mjs +26 -0
- package/dist/modules/agent-client/index.mjs.map +2 -2
- package/dist/modules/agent-client/integrations.d.mts +40 -0
- package/dist/modules/agent-client/integrations.mjs +92 -0
- package/dist/modules/agent-client/integrations.mjs.map +7 -0
- package/dist/modules/agent-client/local-host-protocol.d.mts +156 -0
- package/dist/modules/agent-client/local-host-protocol.mjs +258 -0
- package/dist/modules/agent-client/local-host-protocol.mjs.map +7 -0
- package/dist/modules/agent-client/local-host.d.mts +56 -0
- package/dist/modules/agent-client/local-host.mjs +200 -0
- package/dist/modules/agent-client/local-host.mjs.map +7 -0
- package/dist/modules/agent-client/oauth-clients.d.mts +36 -0
- package/dist/modules/agent-client/oauth-clients.mjs +67 -0
- package/dist/modules/agent-client/oauth-clients.mjs.map +7 -0
- package/dist/modules/agent-client/project-agents.d.mts +54 -0
- package/dist/modules/agent-client/project-agents.mjs +111 -0
- package/dist/modules/agent-client/project-agents.mjs.map +7 -0
- package/dist/modules/agent-client/project.d.mts +48 -0
- package/dist/modules/agent-client/project.mjs +66 -0
- package/dist/modules/agent-client/project.mjs.map +7 -0
- package/dist/modules/agent-client/projects.d.mts +61 -0
- package/dist/modules/agent-client/projects.mjs +145 -0
- package/dist/modules/agent-client/projects.mjs.map +7 -0
- package/dist/modules/agent-client/provide.d.mts +41 -0
- package/dist/modules/agent-client/provide.mjs +90 -0
- package/dist/modules/agent-client/provide.mjs.map +7 -0
- package/dist/modules/agent-client/publishers.d.mts +57 -0
- package/dist/modules/agent-client/publishers.mjs +109 -0
- package/dist/modules/agent-client/publishers.mjs.map +7 -0
- package/dist/modules/agent-client/requirements.d.mts +60 -0
- package/dist/modules/agent-client/requirements.mjs +83 -0
- package/dist/modules/agent-client/requirements.mjs.map +7 -0
- package/dist/modules/agent-client/sandbox-providers.d.mts +34 -0
- package/dist/modules/agent-client/sandbox-providers.mjs +75 -0
- package/dist/modules/agent-client/sandbox-providers.mjs.map +7 -0
- package/dist/modules/agent-client/sandbox-uri.d.mts +1 -1
- package/dist/modules/agent-client/sandbox-uri.mjs +4 -4
- package/dist/modules/agent-client/sandbox-uri.mjs.map +1 -1
- package/dist/modules/agent-client/sandboxes.d.mts +72 -0
- package/dist/modules/agent-client/sandboxes.mjs +138 -0
- package/dist/modules/agent-client/sandboxes.mjs.map +7 -0
- package/dist/modules/agent-client/schedules.d.mts +9 -0
- package/dist/modules/agent-client/schedules.mjs +17 -0
- package/dist/modules/agent-client/schedules.mjs.map +7 -0
- package/dist/modules/agent-client/sessions.d.mts +46 -8
- package/dist/modules/agent-client/sessions.mjs +91 -29
- package/dist/modules/agent-client/sessions.mjs.map +2 -2
- package/dist/modules/agent-client/start.d.mts +101 -0
- package/dist/modules/agent-client/start.mjs +260 -0
- package/dist/modules/agent-client/start.mjs.map +7 -0
- package/dist/modules/agent-client/test-fakes.d.mts +1 -0
- package/dist/modules/agent-client/test-fakes.mjs +3 -1
- package/dist/modules/agent-client/test-fakes.mjs.map +2 -2
- package/dist/modules/cli/agent-module.d.mts +39 -0
- package/dist/modules/cli/agent-module.mjs +89 -0
- package/dist/modules/cli/agent-module.mjs.map +7 -0
- package/dist/modules/cli/cli.d.mts +6 -6
- package/dist/modules/cli/cli.mjs +94 -120
- package/dist/modules/cli/cli.mjs.map +2 -2
- package/dist/modules/cli/conformance.d.mts +2 -6
- package/dist/modules/cli/conformance.mjs +5 -8
- package/dist/modules/cli/conformance.mjs.map +2 -2
- package/dist/modules/cli/main.mjs.map +1 -1
- package/dist/modules/cli/output.d.mts +0 -9
- package/dist/modules/cli/output.mjs +7 -85
- package/dist/modules/cli/output.mjs.map +2 -2
- package/dist/modules/harnesses.mjs.map +2 -2
- package/dist/modules/index.d.mts +0 -2
- package/dist/modules/index.mjs +0 -4
- package/dist/modules/index.mjs.map +2 -2
- package/dist/modules/integrations.d.mts +24 -0
- package/dist/modules/integrations.mjs +30 -0
- package/dist/modules/integrations.mjs.map +7 -0
- package/dist/modules/public.d.mts +10 -10
- package/dist/modules/public.mjs +29 -78
- package/dist/modules/public.mjs.map +2 -2
- package/dist/modules/sandboxes.d.mts +2 -0
- package/dist/modules/sandboxes.mjs +4 -0
- package/dist/modules/sandboxes.mjs.map +2 -2
- package/dist/modules/verify.d.mts +1 -0
- package/dist/modules/verify.mjs +2 -0
- package/dist/modules/verify.mjs.map +7 -0
- package/dist/modules/webhooks.d.mts +37 -0
- package/dist/modules/webhooks.mjs +100 -0
- package/dist/modules/webhooks.mjs.map +7 -0
- package/examples/release-scout/README.md +18 -10
- package/examples/release-scout/agent.ts +41 -0
- package/examples/release-scout/by-name.ts +43 -0
- package/examples/release-scout/db.ts +6 -0
- package/examples/release-scout/instructions.md +5 -0
- package/examples/release-scout/run-on-a-computer.ts +49 -0
- package/examples/release-scout/run.ts +38 -0
- package/package.json +37 -28
- package/dist/modules/agent-client/build.d.mts +0 -110
- package/dist/modules/agent-client/build.mjs +0 -213
- package/dist/modules/agent-client/build.mjs.map +0 -7
- package/dist/modules/authoring/final-channel.d.mts +0 -1
- package/dist/modules/authoring/final-channel.mjs +0 -2
- package/dist/modules/authoring/final-channel.mjs.map +0 -7
- package/dist/modules/authoring/index.d.mts +0 -1
- package/dist/modules/authoring/index.mjs +0 -2
- package/dist/modules/authoring/index.mjs.map +0 -7
- package/dist/modules/authoring/instructions.d.mts +0 -1
- package/dist/modules/authoring/instructions.mjs +0 -2
- package/dist/modules/authoring/instructions.mjs.map +0 -7
- package/dist/modules/authoring/providers.d.mts +0 -2
- package/dist/modules/authoring/providers.mjs +0 -1
- package/dist/modules/authoring/providers.mjs.map +0 -7
- package/dist/modules/cli/build.d.mts +0 -22
- package/dist/modules/cli/build.mjs +0 -77
- package/dist/modules/cli/build.mjs.map +0 -7
- package/dist/modules/cli/channel-install.d.mts +0 -12
- package/dist/modules/cli/channel-install.mjs +0 -25
- package/dist/modules/cli/channel-install.mjs.map +0 -7
- package/dist/modules/cli/channel-socket.d.mts +0 -9
- package/dist/modules/cli/channel-socket.mjs +0 -114
- package/dist/modules/cli/channel-socket.mjs.map +0 -7
- package/dist/modules/cli/dev.d.mts +0 -26
- package/dist/modules/cli/dev.mjs +0 -311
- package/dist/modules/cli/dev.mjs.map +0 -7
- package/dist/modules/cli/files.d.mts +0 -18
- package/dist/modules/cli/files.mjs +0 -66
- package/dist/modules/cli/files.mjs.map +0 -7
- package/dist/modules/cli/harness-descriptions.d.mts +0 -20
- package/dist/modules/cli/harness-descriptions.mjs +0 -70
- package/dist/modules/cli/harness-descriptions.mjs.map +0 -7
- package/dist/modules/cli/publish.d.mts +0 -15
- package/dist/modules/cli/publish.mjs +0 -92
- package/dist/modules/cli/publish.mjs.map +0 -7
- package/dist/modules/compile.d.mts +0 -3
- package/dist/modules/compile.mjs +0 -58
- package/dist/modules/compile.mjs.map +0 -7
- package/dist/modules/index.browser.d.mts +0 -4
- package/dist/modules/index.browser.mjs +0 -8
- package/dist/modules/index.browser.mjs.map +0 -7
- package/examples/custom-harness/README.md +0 -16
- package/examples/custom-harness/agent.ts +0 -154
- package/examples/custom-sandbox/README.md +0 -12
- package/examples/custom-sandbox/agent.ts +0 -14
- package/examples/custom-sandbox/sandbox.ts +0 -24
- package/examples/release-scout/agent/agent.ts +0 -22
- package/examples/release-scout/agent/channels/github-signature.ts +0 -27
- package/examples/release-scout/agent/channels/github.ts +0 -32
- package/examples/release-scout/agent/connections/linear.ts +0 -9
- package/examples/release-scout/agent/hooks/audit.ts +0 -24
- package/examples/release-scout/agent/instructions/org-context.ts +0 -26
- package/examples/release-scout/agent/instructions.md +0 -2
- package/examples/release-scout/agent/sandbox.ts +0 -20
- package/examples/release-scout/agent/schedules/daily-digest.md +0 -7
- package/examples/release-scout/agent/skills/triage/SKILL.md +0 -8
- package/examples/release-scout/agent/skills/triage/checklist.md +0 -3
- package/examples/release-scout/agent/tools/lookup_release_notes.ts +0 -24
- package/examples/release-scout/client.ts +0 -122
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { jsonObjectSchema } from "@finalai/agent-protocol";
|
|
2
|
+
import {
|
|
3
|
+
acpAdapterDefinitionInfoSchema,
|
|
4
|
+
acpAdapterDefinitionListSchema,
|
|
5
|
+
allowSubscriptionsRequestSchema,
|
|
6
|
+
definitionPublicationSchema,
|
|
7
|
+
harnessDefinitionInfoSchema,
|
|
8
|
+
harnessDefinitionListSchema,
|
|
9
|
+
okResponseSchema,
|
|
10
|
+
publishDefinitionRequestSchema,
|
|
11
|
+
subscriptionAllowanceListSchema,
|
|
12
|
+
subscriptionAllowanceSchema
|
|
13
|
+
} from "@finalai/agent-protocol/agent-platform";
|
|
14
|
+
import {
|
|
15
|
+
acpAdapterDefinitionHash,
|
|
16
|
+
acpAdapterDefinitionSchema,
|
|
17
|
+
harnessDefinitionHash,
|
|
18
|
+
harnessDefinitionSchema
|
|
19
|
+
} from "@finalai/agent-provider/harness-definition";
|
|
20
|
+
import {
|
|
21
|
+
encodePath
|
|
22
|
+
} from "./context.mjs";
|
|
23
|
+
import { clientError, ClientErrorCode } from "./errors.mjs";
|
|
24
|
+
import { HttpMethod } from "./http.mjs";
|
|
25
|
+
import { checkHarness } from "./start.mjs";
|
|
26
|
+
const projectPath = (projectId, suffix) => `/v1/projects/${encodePath(projectId)}${suffix}`;
|
|
27
|
+
const prepared = async (args) => {
|
|
28
|
+
const parsed = args.schema.safeParse(args.value);
|
|
29
|
+
if (!parsed.success)
|
|
30
|
+
throw clientError({
|
|
31
|
+
message: `Invalid ${args.what}: ${parsed.error.message}`,
|
|
32
|
+
status: 0,
|
|
33
|
+
code: ClientErrorCode.InvalidRequest
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
definition: jsonObjectSchema.parse(JSON.parse(JSON.stringify(parsed.data))),
|
|
37
|
+
hash: await args.hash(parsed.data)
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const lookupQuery = (selector) => ({
|
|
41
|
+
name: "name" in selector ? selector.name : void 0,
|
|
42
|
+
hash: "hash" in selector ? selector.hash : void 0
|
|
43
|
+
});
|
|
44
|
+
const createHarnessesApi = (args) => {
|
|
45
|
+
const { http } = args.context;
|
|
46
|
+
const path = (suffix) => projectPath(args.projectId, suffix);
|
|
47
|
+
const allowancePath = (harness) => path(`/subscription-allowances/${encodePath(harness)}`);
|
|
48
|
+
return {
|
|
49
|
+
check: async ({ agent, harness, compute, signal }) => checkHarness({
|
|
50
|
+
context: args.context,
|
|
51
|
+
projectId: args.projectId,
|
|
52
|
+
hash: typeof agent === "string" ? agent : await args.store(agent, signal),
|
|
53
|
+
harness,
|
|
54
|
+
compute,
|
|
55
|
+
signal
|
|
56
|
+
}),
|
|
57
|
+
publish: async ({ harness, name, visibility, signal }) => http.request({
|
|
58
|
+
method: HttpMethod.Post,
|
|
59
|
+
path: path("/harnesses/publish"),
|
|
60
|
+
body: {
|
|
61
|
+
schema: publishDefinitionRequestSchema,
|
|
62
|
+
value: {
|
|
63
|
+
name,
|
|
64
|
+
visibility,
|
|
65
|
+
...await prepared({
|
|
66
|
+
schema: harnessDefinitionSchema,
|
|
67
|
+
value: harness,
|
|
68
|
+
hash: harnessDefinitionHash,
|
|
69
|
+
what: "harness definition"
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
response: definitionPublicationSchema,
|
|
74
|
+
signal
|
|
75
|
+
}),
|
|
76
|
+
get: ({ signal, ...selector }) => http.request({
|
|
77
|
+
method: HttpMethod.Get,
|
|
78
|
+
path: path("/harnesses/lookup"),
|
|
79
|
+
query: lookupQuery(selector),
|
|
80
|
+
response: harnessDefinitionInfoSchema,
|
|
81
|
+
signal
|
|
82
|
+
}),
|
|
83
|
+
list: async (options) => (await http.request({
|
|
84
|
+
method: HttpMethod.Get,
|
|
85
|
+
path: path("/harnesses"),
|
|
86
|
+
response: harnessDefinitionListSchema,
|
|
87
|
+
signal: options?.signal
|
|
88
|
+
})).harnesses,
|
|
89
|
+
allowances: {
|
|
90
|
+
list: async (options) => (await http.request({
|
|
91
|
+
method: HttpMethod.Get,
|
|
92
|
+
path: path("/subscription-allowances"),
|
|
93
|
+
response: subscriptionAllowanceListSchema,
|
|
94
|
+
signal: options?.signal
|
|
95
|
+
})).allowances,
|
|
96
|
+
allow: ({ harness, signal }) => http.request({
|
|
97
|
+
method: HttpMethod.Put,
|
|
98
|
+
path: allowancePath(harness),
|
|
99
|
+
body: { schema: allowSubscriptionsRequestSchema, value: {} },
|
|
100
|
+
response: subscriptionAllowanceSchema,
|
|
101
|
+
signal
|
|
102
|
+
}),
|
|
103
|
+
revoke: async ({ harness, signal }) => {
|
|
104
|
+
await http.request({
|
|
105
|
+
method: HttpMethod.Delete,
|
|
106
|
+
path: allowancePath(harness),
|
|
107
|
+
response: okResponseSchema,
|
|
108
|
+
signal
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
const createAcpAdaptersApi = (args) => {
|
|
115
|
+
const { http } = args.context;
|
|
116
|
+
const path = (suffix) => projectPath(args.projectId, suffix);
|
|
117
|
+
return {
|
|
118
|
+
publish: async ({ adapter, name, visibility, signal }) => http.request({
|
|
119
|
+
method: HttpMethod.Post,
|
|
120
|
+
path: path("/acp-adapters/publish"),
|
|
121
|
+
body: {
|
|
122
|
+
schema: publishDefinitionRequestSchema,
|
|
123
|
+
value: {
|
|
124
|
+
name,
|
|
125
|
+
visibility,
|
|
126
|
+
...await prepared({
|
|
127
|
+
schema: acpAdapterDefinitionSchema,
|
|
128
|
+
value: adapter,
|
|
129
|
+
hash: acpAdapterDefinitionHash,
|
|
130
|
+
what: "ACP adapter definition"
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
response: definitionPublicationSchema,
|
|
135
|
+
signal
|
|
136
|
+
}),
|
|
137
|
+
get: ({ signal, ...selector }) => http.request({
|
|
138
|
+
method: HttpMethod.Get,
|
|
139
|
+
path: path("/acp-adapters/lookup"),
|
|
140
|
+
query: lookupQuery(selector),
|
|
141
|
+
response: acpAdapterDefinitionInfoSchema,
|
|
142
|
+
signal
|
|
143
|
+
}),
|
|
144
|
+
list: async (options) => (await http.request({
|
|
145
|
+
method: HttpMethod.Get,
|
|
146
|
+
path: path("/acp-adapters"),
|
|
147
|
+
response: acpAdapterDefinitionListSchema,
|
|
148
|
+
signal: options?.signal
|
|
149
|
+
})).adapters
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export {
|
|
153
|
+
createAcpAdaptersApi,
|
|
154
|
+
createHarnessesApi
|
|
155
|
+
};
|
|
156
|
+
//# sourceMappingURL=harnesses.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/agent-client/harnesses.ts"],
|
|
4
|
+
"sourcesContent": ["import { jsonObjectSchema, type Capability } from '@finalai/agent-protocol';\nimport {\n acpAdapterDefinitionInfoSchema,\n acpAdapterDefinitionListSchema,\n allowSubscriptionsRequestSchema,\n definitionPublicationSchema,\n harnessDefinitionInfoSchema,\n harnessDefinitionListSchema,\n okResponseSchema,\n publishDefinitionRequestSchema,\n subscriptionAllowanceListSchema,\n subscriptionAllowanceSchema,\n type AcpAdapterDefinitionInfoIface,\n type AcpAdapterDefinitionSummaryIface,\n type DefinitionPublicationIface,\n type DefinitionVisibility,\n type HarnessCheckResponseIface,\n type HarnessDefinitionInfoIface,\n type HarnessDefinitionSummaryIface,\n type HarnessSettingsIface,\n type SubscriptionAllowanceIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport {\n acpAdapterDefinitionHash,\n acpAdapterDefinitionSchema,\n harnessDefinitionHash,\n harnessDefinitionSchema,\n type AcpAdapterDefinitionInputIface,\n type HarnessDefinitionInputIface,\n} from '@finalai/agent-provider/harness-definition';\nimport type * as z from 'zod';\nimport type { AgentInput } from \"./agent-input.mjs\";\nimport {\n encodePath,\n type ClientContextIface,\n type EnumInput,\n type SignalOptionsIface,\n} from \"./context.mjs\";\nimport { clientError, ClientErrorCode } from \"./errors.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\nimport { checkHarness } from \"./start.mjs\";\n\n// A project's harness and ACP adapter definitions (data, published by name),\n// the check of harness settings against an agent, and which harnesses\n// subscriptions may reach.\n\nexport type DefinitionSelectorIface = { name: string } | { hash: string };\n\nexport interface SubscriptionAllowancesApiIface {\n /** The harnesses subscriptions may reach in this project, the catalog's included. */\n list: (options?: SignalOptionsIface) => Promise<SubscriptionAllowanceIface[]>;\n /** Lets personal and shared subscriptions reach `harness`. */\n allow: (args: { harness: string } & SignalOptionsIface) => Promise<SubscriptionAllowanceIface>;\n revoke: (args: { harness: string } & SignalOptionsIface) => Promise<void>;\n}\n\nexport interface HarnessesApiIface {\n /**\n * Whether harness settings suit an agent, where the harness would run, and\n * which of its compute that environment covers. `agent` is the agent or its\n * content hash; `compute` places a harness that names no environment.\n */\n check: (\n args: {\n agent: string | AgentInput;\n harness: HarnessSettingsIface;\n compute?: Partial<Record<Capability, string>>;\n } & SignalOptionsIface,\n ) => Promise<HarnessCheckResponseIface>;\n /**\n * Stores a harness definition and points `name` at it. `visibility: 'public'`\n * also makes the name public under the project's publisher handle.\n */\n publish: (\n args: {\n harness: HarnessDefinitionInputIface;\n name: string;\n visibility?: EnumInput<DefinitionVisibility>;\n } & SignalOptionsIface,\n ) => Promise<DefinitionPublicationIface>;\n get: (\n selector: DefinitionSelectorIface & SignalOptionsIface,\n ) => Promise<HarnessDefinitionInfoIface>;\n /** The harnesses this project can name by bare name: its own and its ancestors'. */\n list: (options?: SignalOptionsIface) => Promise<HarnessDefinitionSummaryIface[]>;\n allowances: SubscriptionAllowancesApiIface;\n}\n\nexport interface AcpAdaptersApiIface {\n /** Stores an ACP adapter definition and points `name` at it; see `harnesses.publish` for `visibility`. */\n publish: (\n args: {\n adapter: AcpAdapterDefinitionInputIface;\n name: string;\n visibility?: EnumInput<DefinitionVisibility>;\n } & SignalOptionsIface,\n ) => Promise<DefinitionPublicationIface>;\n get: (\n selector: DefinitionSelectorIface & SignalOptionsIface,\n ) => Promise<AcpAdapterDefinitionInfoIface>;\n list: (options?: SignalOptionsIface) => Promise<AcpAdapterDefinitionSummaryIface[]>;\n}\n\nconst projectPath = (projectId: string, suffix: string): string =>\n `/v1/projects/${encodePath(projectId)}${suffix}`;\n\n// The definition as sent, validated and hashed here first so a bad one fails\n// before any request.\nconst prepared = async <Schema extends z.ZodType>(args: {\n schema: Schema;\n value: unknown;\n hash: (definition: z.output<Schema>) => Promise<string>;\n what: string;\n}) => {\n const parsed = args.schema.safeParse(args.value);\n if (!parsed.success)\n throw clientError({\n message: `Invalid ${args.what}: ${parsed.error.message}`,\n status: 0,\n code: ClientErrorCode.InvalidRequest,\n });\n return {\n definition: jsonObjectSchema.parse(JSON.parse(JSON.stringify(parsed.data))),\n hash: await args.hash(parsed.data),\n };\n};\n\nconst lookupQuery = (selector: DefinitionSelectorIface) => ({\n name: 'name' in selector ? selector.name : undefined,\n hash: 'hash' in selector ? selector.hash : undefined,\n});\n\nexport const createHarnessesApi = (args: {\n context: ClientContextIface;\n projectId: string;\n /** Stores an agent's document so the platform can check against it; returns its hash. */\n store: (agent: AgentInput, signal?: AbortSignal) => Promise<string>;\n}): HarnessesApiIface => {\n const { http } = args.context;\n const path = (suffix: string) => projectPath(args.projectId, suffix);\n const allowancePath = (harness: string) =>\n path(`/subscription-allowances/${encodePath(harness)}`);\n return {\n check: async ({ agent, harness, compute, signal }) =>\n checkHarness({\n context: args.context,\n projectId: args.projectId,\n hash: typeof agent === 'string' ? agent : await args.store(agent, signal),\n harness,\n compute,\n signal,\n }),\n publish: async ({ harness, name, visibility, signal }) =>\n http.request({\n method: HttpMethod.Post,\n path: path('/harnesses/publish'),\n body: {\n schema: publishDefinitionRequestSchema,\n value: {\n name,\n visibility,\n ...(await prepared({\n schema: harnessDefinitionSchema,\n value: harness,\n hash: harnessDefinitionHash,\n what: 'harness definition',\n })),\n },\n },\n response: definitionPublicationSchema,\n signal,\n }),\n get: ({ signal, ...selector }) =>\n http.request({\n method: HttpMethod.Get,\n path: path('/harnesses/lookup'),\n query: lookupQuery(selector),\n response: harnessDefinitionInfoSchema,\n signal,\n }),\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: path('/harnesses'),\n response: harnessDefinitionListSchema,\n signal: options?.signal,\n })\n ).harnesses,\n allowances: {\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: path('/subscription-allowances'),\n response: subscriptionAllowanceListSchema,\n signal: options?.signal,\n })\n ).allowances,\n allow: ({ harness, signal }) =>\n http.request({\n method: HttpMethod.Put,\n path: allowancePath(harness),\n body: { schema: allowSubscriptionsRequestSchema, value: {} },\n response: subscriptionAllowanceSchema,\n signal,\n }),\n revoke: async ({ harness, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: allowancePath(harness),\n response: okResponseSchema,\n signal,\n });\n },\n },\n };\n};\n\nexport const createAcpAdaptersApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): AcpAdaptersApiIface => {\n const { http } = args.context;\n const path = (suffix: string) => projectPath(args.projectId, suffix);\n return {\n publish: async ({ adapter, name, visibility, signal }) =>\n http.request({\n method: HttpMethod.Post,\n path: path('/acp-adapters/publish'),\n body: {\n schema: publishDefinitionRequestSchema,\n value: {\n name,\n visibility,\n ...(await prepared({\n schema: acpAdapterDefinitionSchema,\n value: adapter,\n hash: acpAdapterDefinitionHash,\n what: 'ACP adapter definition',\n })),\n },\n },\n response: definitionPublicationSchema,\n signal,\n }),\n get: ({ signal, ...selector }) =>\n http.request({\n method: HttpMethod.Get,\n path: path('/acp-adapters/lookup'),\n query: lookupQuery(selector),\n response: acpAdapterDefinitionInfoSchema,\n signal,\n }),\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: path('/acp-adapters'),\n response: acpAdapterDefinitionListSchema,\n signal: options?.signal,\n })\n ).adapters,\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,wBAAyC;AAClD;AAAA,EACE;AAAA,EACA;AAAA,EACA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|
Delete = "DELETE"
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/** An array repeats the parameter once per value. */
|
|
24
|
+
export type QueryValue = string | number | boolean | readonly string[] | undefined;
|
|
24
25
|
export interface HttpBodyIface {
|
|
25
26
|
/** The strict client-to-server schema the body must satisfy. */
|
|
26
27
|
schema: z.ZodType;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { jsonValueSchema } from "@finalai/agent-protocol";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AgentApiErrorCode,
|
|
4
|
+
apiErrorResponseSchema,
|
|
5
|
+
requirementsUnmetDetailsSchema
|
|
6
|
+
} from "@finalai/agent-protocol/agent-platform";
|
|
3
7
|
import {
|
|
4
8
|
clientError,
|
|
5
9
|
ClientErrorCode,
|
|
6
10
|
decisionError,
|
|
7
11
|
DecisionErrorReason,
|
|
12
|
+
requirementsUnmetError,
|
|
8
13
|
turnRejectedError
|
|
9
14
|
} from "./errors.mjs";
|
|
10
15
|
var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
@@ -54,6 +59,17 @@ const errorFromResponse = (args) => {
|
|
|
54
59
|
state: detail.state
|
|
55
60
|
});
|
|
56
61
|
}
|
|
62
|
+
if (detail.code === AgentApiErrorCode.RequirementsUnmet || detail.code === AgentApiErrorCode.HarnessUnsuitable) {
|
|
63
|
+
const details = requirementsUnmetDetailsSchema.safeParse(detail.details ?? {});
|
|
64
|
+
return requirementsUnmetError({
|
|
65
|
+
message,
|
|
66
|
+
status: args.status,
|
|
67
|
+
code: detail.code,
|
|
68
|
+
body,
|
|
69
|
+
agent: details.success ? details.data.agent : null,
|
|
70
|
+
requirements: details.success ? details.data.requirements : []
|
|
71
|
+
});
|
|
72
|
+
}
|
|
57
73
|
const reason = decisionReasonByCode.get(detail.code);
|
|
58
74
|
if (reason != null) {
|
|
59
75
|
return decisionError({
|
|
@@ -96,7 +112,10 @@ const createHttp = (options) => {
|
|
|
96
112
|
const request = async (args) => {
|
|
97
113
|
const target = url(args.path);
|
|
98
114
|
for (const [key, value] of Object.entries(args.query ?? {})) {
|
|
99
|
-
if (value
|
|
115
|
+
if (value === void 0) continue;
|
|
116
|
+
if (typeof value === "object") {
|
|
117
|
+
for (const item of value) target.searchParams.append(key, item);
|
|
118
|
+
} else target.searchParams.set(key, String(value));
|
|
100
119
|
}
|
|
101
120
|
let body;
|
|
102
121
|
if (args.body != null) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/agent-client/http.ts"],
|
|
4
|
-
"sourcesContent": ["import { jsonValueSchema, type JsonValue } from '@finalai/agent-protocol';\nimport {
|
|
5
|
-
"mappings": "AAAA,SAAS,uBAAuC;AAChD,
|
|
4
|
+
"sourcesContent": ["import { jsonValueSchema, type JsonValue } from '@finalai/agent-protocol';\nimport {\n AgentApiErrorCode,\n apiErrorResponseSchema,\n requirementsUnmetDetailsSchema,\n} from '@finalai/agent-protocol/agent-platform';\nimport type * as z from 'zod';\nimport {\n clientError,\n ClientErrorCode,\n decisionError,\n DecisionErrorReason,\n requirementsUnmetError,\n turnRejectedError,\n type AgentClientError,\n} from \"./errors.mjs\";\n\nexport type FetchIface = (input: string, init: RequestInit) => Promise<Response>;\n\n/** API key (`fk_...`), a bearer source (console access token, service grant), or the browser's console cookie. */\nexport type AgentClientAuth =\n | { anonymous: true }\n | { apiKey: string }\n | { bearer: () => Promise<string> | string }\n | { cookies: true };\n\n/** Extra headers per request (client identity, request source). */\nexport type HeadersOption = () => Record<string, string> | Promise<Record<string, string>>;\n\nexport enum HttpMethod {\n Get = 'GET',\n Post = 'POST',\n Patch = 'PATCH',\n Put = 'PUT',\n Delete = 'DELETE',\n}\n\n/** An array repeats the parameter once per value. */\nexport type QueryValue = string | number | boolean | readonly string[] | undefined;\n\nexport interface HttpBodyIface {\n /** The strict client-to-server schema the body must satisfy. */\n schema: z.ZodType;\n value: unknown;\n}\n\nexport interface HttpRequestArgsIface<Output> {\n method: HttpMethod;\n path: string;\n query?: Record<string, QueryValue>;\n body?: HttpBodyIface;\n response: z.ZodType<Output>;\n signal?: AbortSignal;\n keepalive?: boolean;\n /** Ids the error mapping attaches to DecisionError / TurnRejectedError. */\n context?: { decisionId?: string; sessionId?: string };\n}\n\nexport interface HttpIface {\n request: <Output>(args: HttpRequestArgsIface<Output>) => Promise<Output>;\n /** Auth and caller headers for non-fetch transports (ACP WebSocket). */\n headers: () => Promise<Record<string, string>>;\n url: (path: string) => URL;\n fetch: FetchIface;\n usesCookies: boolean;\n}\n\nexport interface CreateHttpOptionsIface {\n host: string;\n auth: AgentClientAuth;\n headers?: HeadersOption;\n fetch?: FetchIface;\n}\n\nconst decisionReasonByCode = new Map<string, DecisionErrorReason>([\n [AgentApiErrorCode.DecisionNotFound, DecisionErrorReason.NotFound],\n [AgentApiErrorCode.DecisionNotInAudience, DecisionErrorReason.NotInAudience],\n [AgentApiErrorCode.DecisionAlreadyResolved, DecisionErrorReason.AlreadyResolved],\n [AgentApiErrorCode.DecisionExpired, DecisionErrorReason.Expired],\n]);\n\nconst parseJson = (text: string): { ok: true; value: JsonValue } | { ok: false } => {\n if (text.trim().length === 0) return { ok: true, value: {} };\n try {\n const parsed = jsonValueSchema.safeParse(JSON.parse(text));\n return parsed.success ? { ok: true, value: parsed.data } : { ok: false };\n } catch {\n return { ok: false };\n }\n};\n\ninterface ErrorResponseArgsIface {\n status: number;\n text: string;\n context: HttpRequestArgsIface<unknown>['context'];\n}\n\n/** Maps a non-2xx response to the SDK error family. */\nexport const errorFromResponse = (args: ErrorResponseArgsIface): AgentClientError => {\n const json = parseJson(args.text);\n const body = json.ok ? json.value : args.text.length > 0 ? args.text : null;\n const parsed = apiErrorResponseSchema.safeParse(body);\n if (!parsed.success) {\n return clientError({\n message: `Request failed with status ${args.status}`,\n status: args.status,\n code: ClientErrorCode.Unknown,\n body,\n });\n }\n const detail = parsed.data.error;\n const message = detail.message.length > 0 ? detail.message : detail.code;\n if (detail.code === AgentApiErrorCode.TurnRejected) {\n return turnRejectedError({\n message,\n status: args.status,\n code: detail.code,\n body,\n sessionId: detail.sessionId ?? args.context?.sessionId ?? null,\n state: detail.state,\n });\n }\n if (\n detail.code === AgentApiErrorCode.RequirementsUnmet ||\n detail.code === AgentApiErrorCode.HarnessUnsuitable\n ) {\n const details = requirementsUnmetDetailsSchema.safeParse(detail.details ?? {});\n return requirementsUnmetError({\n message,\n status: args.status,\n code: detail.code,\n body,\n agent: details.success ? details.data.agent : null,\n requirements: details.success ? details.data.requirements : [],\n });\n }\n const reason = decisionReasonByCode.get(detail.code);\n if (reason != null) {\n return decisionError({\n message,\n status: args.status,\n code: detail.code,\n body,\n decisionId: detail.decisionId ?? args.context?.decisionId ?? null,\n reason,\n });\n }\n return clientError({ message, status: args.status, code: detail.code, body });\n};\n\nconst resolveHeaders = async (option: HeadersOption | undefined): Promise<Record<string, string>> =>\n option == null ? {} : await option();\n\nconst authHeaders = async (auth: AgentClientAuth): Promise<Record<string, string>> => {\n if ('apiKey' in auth) return { authorization: `Bearer ${auth.apiKey}` };\n if ('bearer' in auth) return { authorization: `Bearer ${await auth.bearer()}` };\n return {};\n};\n\nconst isAbort = (signal: AbortSignal | undefined): boolean => signal?.aborted === true;\n\n/** Where the session service mounts its API routes when `host` is a bare origin. */\nexport const DEFAULT_API_PREFIX = '/api';\n\n// Preserve a custom API base path when joining absolute route paths.\nexport const joinHostPath = (host: string, path: string): URL => {\n const base = new URL(host);\n const trimmed = base.pathname.replace(/\\/+$/, '');\n const prefix = trimmed.length === 0 ? DEFAULT_API_PREFIX : trimmed;\n const [pathname, search] = path.split('?', 2);\n const target = new URL(base.origin);\n target.pathname = `${prefix}${pathname?.startsWith('/') ? '' : '/'}${pathname ?? ''}`;\n if (search != null) target.search = search;\n return target;\n};\n\nexport const createHttp = (options: CreateHttpOptionsIface): HttpIface => {\n const fetchImpl: FetchIface = options.fetch ?? ((input, init) => globalThis.fetch(input, init));\n const usesCookies = 'cookies' in options.auth;\n\n const headers = async (): Promise<Record<string, string>> => ({\n ...(await resolveHeaders(options.headers)),\n ...(await authHeaders(options.auth)),\n });\n\n const url = (path: string): URL => joinHostPath(options.host, path);\n\n const request = async <Output>(args: HttpRequestArgsIface<Output>): Promise<Output> => {\n const target = url(args.path);\n for (const [key, value] of Object.entries(args.query ?? {})) {\n if (value === undefined) continue;\n if (typeof value === 'object') {\n for (const item of value) target.searchParams.append(key, item);\n } else target.searchParams.set(key, String(value));\n }\n let body: string | undefined;\n if (args.body != null) {\n const validated = args.body.schema.safeParse(args.body.value);\n if (!validated.success) {\n throw clientError({\n message: `Invalid request for ${args.method} ${args.path}: ${validated.error.message}`,\n status: 0,\n code: ClientErrorCode.InvalidRequest,\n });\n }\n body = JSON.stringify(validated.data);\n }\n const baseHeaders = { accept: 'application/json', ...(await headers()) };\n const requestHeaders =\n body === undefined ? baseHeaders : { ...baseHeaders, 'content-type': 'application/json' };\n\n let response: Response;\n let text: string;\n try {\n response = await fetchImpl(target.toString(), {\n method: args.method,\n headers: requestHeaders,\n body,\n signal: args.signal,\n credentials: 'anonymous' in options.auth ? 'omit' : usesCookies ? 'include' : undefined,\n keepalive: args.keepalive,\n });\n // Read failures are network failures too.\n text = await response.text();\n } catch (cause) {\n if (isAbort(args.signal)) throw cause;\n throw clientError({\n message: `Network request to ${target.pathname} failed`,\n status: 0,\n code: ClientErrorCode.Network,\n cause,\n });\n }\n // Read text first so proxy and CDN error bodies survive non-JSON responses.\n if (!response.ok) {\n throw errorFromResponse({ status: response.status, text, context: args.context });\n }\n const json = parseJson(text);\n if (!json.ok) {\n throw clientError({\n message: `Response from ${args.method} ${args.path} was not JSON`,\n status: response.status,\n code: ClientErrorCode.InvalidResponse,\n body: text,\n });\n }\n const parsed = args.response.safeParse(json.value);\n if (!parsed.success) {\n throw clientError({\n message: `Unexpected response from ${args.method} ${args.path}: ${parsed.error.message}`,\n status: response.status,\n code: ClientErrorCode.InvalidResponse,\n body: json.value,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KAAK,IAAI;AACZ,YAAM,YAAY;AAAA,QAChB,SAAS,iBAAiB,KAAK,MAAM,IAAI,KAAK,IAAI;AAAA,QAClD,QAAQ,SAAS;AAAA,QACjB,MAAM,gBAAgB;AAAA,QACtB,MAAM;AAAA,MACR,CAAC;AAAA,IACH;AACA,UAAM,SAAS,KAAK,SAAS,UAAU,KAAK,KAAK;AACjD,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,YAAY;AAAA,QAChB,SAAS,4BAA4B,KAAK,MAAM,IAAI,KAAK,IAAI,KAAK,OAAO,MAAM,OAAO;AAAA,QACtF,QAAQ,SAAS;AAAA,QACjB,MAAM,gBAAgB;AAAA,QACtB,MAAM,KAAK;AAAA,MACb,CAAC;AAAA,IACH;AACA,WAAO,OAAO;AAAA,EAChB;AAEA,SAAO,EAAE,SAAS,SAAS,KAAK,OAAO,WAAW,YAAY;AAChE;",
|
|
6
6
|
"names": ["HttpMethod"]
|
|
7
7
|
}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
export * from '@finalai/agent-protocol/agent-platform';
|
|
2
|
+
export { Capability, FilesAccess, ScreenAccess, ShellAccess, type CapabilityAccess, } from '@finalai/agent-protocol';
|
|
2
3
|
export { AcpAuthMode, type AcpApiIface, type AcpConnectArgsIface } from "./acp.mjs";
|
|
3
4
|
export { createTextCollector, isUserMessageFor, sessionUpdateOf, textOf, turnEndOf, type AcpSessionUpdateIface, type TurnEndIface, } from "./acp-frames.mjs";
|
|
4
|
-
export type {
|
|
5
|
-
export {
|
|
5
|
+
export type { AgentInput, AgentValue, AgentValueCodecIface } from "./agent-input.mjs";
|
|
6
|
+
export type { ActorOptionIface, ChannelAppsApiIface, ChannelBindingsApiIface, ChannelSourceIface, ChannelSourceOf, ChannelTicketsApiIface, IdentityLinksApiIface, InstallChannelArgsIface, ProjectChannelsApiIface, PublishChannelArgsIface, UpdateChannelBindingArgsIface, } from "./channels.mjs";
|
|
7
|
+
export { DEFAULT_AGENTS_HOST, createClient, type AgentClientIface, type AgentsApiIface, type AppApiIface, type CreateClientOptionsIface, type DecisionsApiIface, type InferenceApiIface, type PeopleApiIface, type PlatformIdentityApiIface, type RealtimeApiIface, } from "./client.mjs";
|
|
6
8
|
export { CollectionEventKind, CollectionResyncReason, type CollectionEvent, type CollectionEventsOptionsIface, type CollectionResyncEventIface, } from "./collection-events.mjs";
|
|
7
9
|
export { ConfigOptionCategory, configSelectFor, configSelectsOf, type ConfigSelectChoiceIface, type ConfigSelectIface, type SessionConfigOptionIface, } from "./config-options.mjs";
|
|
8
10
|
export type { EnumInput, SignalOptionsIface } from "./context.mjs";
|
|
11
|
+
export type { ConversationChannelRoutesApiIface, ConversationContextApiIface, ConversationContextEntryInputIface, ConversationDecisionsApiIface, ConversationInputsApiIface, ConversationLabelsApiIface, ConversationReadGrantsApiIface, ConversationResourcesIface, ResourceSubscriptionsApiIface, SendInputArgsIface, } from "./conversation-resources.mjs";
|
|
9
12
|
export { TURN_OPEN_SESSION_STATES, isNewerMessageVersion, messageVersionOf, type MessageVersionIface, } from "./conversations.mjs";
|
|
10
|
-
export type { ConversationAgentTurnIface, ConversationEvent, ConversationEventMetaIface, ConversationEventsOptionsIface, ConversationHandleIface, ConversationsApiIface, CreateConversationArgsIface, ListMessagesOptionsIface, OpenedConversationIface, ParticipantCreateInput, SandboxFileContentArgsIface, SandboxFileContentRequestIface, SendMessageOptionsIface, SentMessageIface, UploadAttachmentArgsIface, } from "./conversations.mjs";
|
|
11
|
-
export { AgentClientErrorName, ClientErrorCode, DecisionErrorReason, clientError, decisionError, isClientError, isDecisionError, isRealtimeSubscriptionError, isTerminalRealtimeError, isTurnRejectedError, realtimeSubscriptionError, turnRejectedError, type AgentClientError, type ClientErrorIface, type DecisionErrorIface, type RealtimeSubscriptionErrorIface, type TurnRejectedErrorIface, } from "./errors.mjs";
|
|
13
|
+
export type { ConversationAgentTurnIface, ConversationEvent, ConversationEventMetaIface, ConversationEventsOptionsIface, ConversationHandleIface, ConversationsApiIface, CreateConversationArgsIface, ListMessagesOptionsIface, OpenedConversationIface, ParticipantCreateInput, ParticipantsApiIface, ProjectConversationsApiIface, SandboxFileContentArgsIface, SandboxFileContentRequestIface, SendMessageOptionsIface, SentMessageIface, UploadAttachmentArgsIface, } from "./conversations.mjs";
|
|
14
|
+
export { AgentClientErrorName, ClientErrorCode, DecisionErrorReason, clientError, decisionError, isClientError, isDecisionError, isRealtimeSubscriptionError, isRequirementsUnmetError, isTerminalRealtimeError, isTurnRejectedError, realtimeSubscriptionError, requirementsUnmetError, turnRejectedError, type AgentClientError, type ClientErrorIface, type DecisionErrorIface, type RealtimeSubscriptionErrorIface, type RequirementsUnmetErrorIface, type TurnRejectedErrorIface, } from "./errors.mjs";
|
|
15
|
+
export { EVENTS_POLL_INTERVAL_MS, type EventsApiIface, type EventSubscriptionsApiIface, type ListEventsOptionsIface, type StreamEventsOptionsIface, } from "./events.mjs";
|
|
12
16
|
export { defaultStreamTiming, type StreamTimingIface } from "./frame-stream.mjs";
|
|
13
17
|
export type { AgentClientAuth, FetchIface, HeadersOption } from "./http.mjs";
|
|
18
|
+
export type { AcpAdaptersApiIface, DefinitionSelectorIface, HarnessesApiIface, SubscriptionAllowancesApiIface, } from "./harnesses.mjs";
|
|
19
|
+
export type { IntegrationsApiIface } from "./integrations.mjs";
|
|
14
20
|
export { SessionLiveEventKind, type SessionLiveEvent } from "./live-stream.mjs";
|
|
21
|
+
export type { LocalComputeIface } from "./local-host.mjs";
|
|
22
|
+
export type { OAuthClientsApiIface, SignInReturnOriginsApiIface } from "./oauth-clients.mjs";
|
|
23
|
+
export type { ProjectClientIface } from "./project.mjs";
|
|
24
|
+
export type { AgentSelectorIface, ProjectAgentsApiIface } from "./project-agents.mjs";
|
|
25
|
+
export type { ProjectApiKeysApiIface, ProjectMembersApiIface, ProjectResourceApiIface, ProjectsApiIface, } from "./projects.mjs";
|
|
26
|
+
export type { ProjectPublisherApiIface, PublicNamesApiIface, PublisherHandleIface, PublishersApiIface, } from "./publishers.mjs";
|
|
27
|
+
export { provideDocumentOf, resourceIdOf, type ProvideIface, type ProvidePatchIface, type ResourceRef, type ResourceRefIface, } from "./provide.mjs";
|
|
15
28
|
export { createGatewayRealtimeTransport, type GatewayConnect, type GatewayConnectionIface, type GatewayRealtimeTransportOptionsIface, type RealtimeSubscribeOptionsIface, type RealtimeTransportFrameIface, type RealtimeTransportIface, } from "./realtime.mjs";
|
|
16
29
|
export { SANDBOX_FILE_URI_SCHEME, createSandboxFileUri, parseSandboxFileUri, type SandboxFileTargetIface, } from "./sandbox-uri.mjs";
|
|
17
|
-
export type {
|
|
18
|
-
export type {
|
|
30
|
+
export type { SandboxProvidersApiIface } from "./sandbox-providers.mjs";
|
|
31
|
+
export type { CreateSandboxOptionsIface, SandboxEnvironmentValueIface, SandboxHandleIface, SandboxOwnerIface, SandboxSetupRefIface, SandboxSetupsApiIface, SandboxesApiIface, } from "./sandboxes.mjs";
|
|
32
|
+
export type { ProjectSchedulesApiIface } from "./schedules.mjs";
|
|
33
|
+
export type { CreateSessionArgsIface, CreatedSessionIface, ForkSessionOptionsIface, ProjectSessionsApiIface, RespondArgs, SendOptionsIface, SessionHandleIface, SessionsApiIface, StreamOptionsIface, TurnHandleIface, TurnResultIface, } from "./sessions.mjs";
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export * from "@finalai/agent-protocol/agent-platform";
|
|
2
|
+
import {
|
|
3
|
+
Capability,
|
|
4
|
+
FilesAccess,
|
|
5
|
+
ScreenAccess,
|
|
6
|
+
ShellAccess
|
|
7
|
+
} from "@finalai/agent-protocol";
|
|
2
8
|
import { AcpAuthMode } from "./acp.mjs";
|
|
3
9
|
import {
|
|
4
10
|
createTextCollector,
|
|
@@ -8,6 +14,7 @@ import {
|
|
|
8
14
|
turnEndOf
|
|
9
15
|
} from "./acp-frames.mjs";
|
|
10
16
|
import {
|
|
17
|
+
DEFAULT_AGENTS_HOST,
|
|
11
18
|
createClient
|
|
12
19
|
} from "./client.mjs";
|
|
13
20
|
import {
|
|
@@ -33,13 +40,22 @@ import {
|
|
|
33
40
|
isClientError,
|
|
34
41
|
isDecisionError,
|
|
35
42
|
isRealtimeSubscriptionError,
|
|
43
|
+
isRequirementsUnmetError,
|
|
36
44
|
isTerminalRealtimeError,
|
|
37
45
|
isTurnRejectedError,
|
|
38
46
|
realtimeSubscriptionError,
|
|
47
|
+
requirementsUnmetError,
|
|
39
48
|
turnRejectedError
|
|
40
49
|
} from "./errors.mjs";
|
|
50
|
+
import {
|
|
51
|
+
EVENTS_POLL_INTERVAL_MS
|
|
52
|
+
} from "./events.mjs";
|
|
41
53
|
import { defaultStreamTiming } from "./frame-stream.mjs";
|
|
42
54
|
import { SessionLiveEventKind } from "./live-stream.mjs";
|
|
55
|
+
import {
|
|
56
|
+
provideDocumentOf,
|
|
57
|
+
resourceIdOf
|
|
58
|
+
} from "./provide.mjs";
|
|
43
59
|
import {
|
|
44
60
|
createGatewayRealtimeTransport
|
|
45
61
|
} from "./realtime.mjs";
|
|
@@ -51,13 +67,19 @@ import {
|
|
|
51
67
|
export {
|
|
52
68
|
AcpAuthMode,
|
|
53
69
|
AgentClientErrorName,
|
|
70
|
+
Capability,
|
|
54
71
|
ClientErrorCode,
|
|
55
72
|
CollectionEventKind,
|
|
56
73
|
CollectionResyncReason,
|
|
57
74
|
ConfigOptionCategory,
|
|
75
|
+
DEFAULT_AGENTS_HOST,
|
|
58
76
|
DecisionErrorReason,
|
|
77
|
+
EVENTS_POLL_INTERVAL_MS,
|
|
78
|
+
FilesAccess,
|
|
59
79
|
SANDBOX_FILE_URI_SCHEME,
|
|
80
|
+
ScreenAccess,
|
|
60
81
|
SessionLiveEventKind,
|
|
82
|
+
ShellAccess,
|
|
61
83
|
TURN_OPEN_SESSION_STATES,
|
|
62
84
|
clientError,
|
|
63
85
|
configSelectFor,
|
|
@@ -72,12 +94,16 @@ export {
|
|
|
72
94
|
isDecisionError,
|
|
73
95
|
isNewerMessageVersion,
|
|
74
96
|
isRealtimeSubscriptionError,
|
|
97
|
+
isRequirementsUnmetError,
|
|
75
98
|
isTerminalRealtimeError,
|
|
76
99
|
isTurnRejectedError,
|
|
77
100
|
isUserMessageFor,
|
|
78
101
|
messageVersionOf,
|
|
79
102
|
parseSandboxFileUri,
|
|
103
|
+
provideDocumentOf,
|
|
80
104
|
realtimeSubscriptionError,
|
|
105
|
+
requirementsUnmetError,
|
|
106
|
+
resourceIdOf,
|
|
81
107
|
sessionUpdateOf,
|
|
82
108
|
textOf,
|
|
83
109
|
turnEndOf,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/agent-client/index.ts"],
|
|
4
|
-
"sourcesContent": ["// `@finalai/agents/client`: the agent platform client SDK.\n// Wire types come from `@finalai/agent-protocol/agent-platform`, re-exported\n// here so consumers need one import.\n\nexport * from '@finalai/agent-protocol/agent-platform';\nexport { AcpAuthMode, type AcpApiIface, type AcpConnectArgsIface } from \"./acp.mjs\";\nexport {\n createTextCollector,\n isUserMessageFor,\n sessionUpdateOf,\n textOf,\n turnEndOf,\n type AcpSessionUpdateIface,\n type TurnEndIface,\n} from \"./acp-frames.mjs\";\nexport type {\n
|
|
5
|
-
"mappings": "AAIA,cAAc;AACd,SAAS,mBAA+D;AACxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;
|
|
4
|
+
"sourcesContent": ["// `@finalai/agents/client`: the agent platform client SDK.\n// Wire types come from `@finalai/agent-protocol/agent-platform`, re-exported\n// here so consumers need one import.\n\nexport * from '@finalai/agent-protocol/agent-platform';\nexport {\n Capability,\n FilesAccess,\n ScreenAccess,\n ShellAccess,\n type CapabilityAccess,\n} from '@finalai/agent-protocol';\nexport { AcpAuthMode, type AcpApiIface, type AcpConnectArgsIface } from \"./acp.mjs\";\nexport {\n createTextCollector,\n isUserMessageFor,\n sessionUpdateOf,\n textOf,\n turnEndOf,\n type AcpSessionUpdateIface,\n type TurnEndIface,\n} from \"./acp-frames.mjs\";\nexport type { AgentInput, AgentValue, AgentValueCodecIface } from \"./agent-input.mjs\";\nexport type {\n ActorOptionIface,\n ChannelAppsApiIface,\n ChannelBindingsApiIface,\n ChannelSourceIface,\n ChannelSourceOf,\n ChannelTicketsApiIface,\n IdentityLinksApiIface,\n InstallChannelArgsIface,\n ProjectChannelsApiIface,\n PublishChannelArgsIface,\n UpdateChannelBindingArgsIface,\n} from \"./channels.mjs\";\nexport {\n DEFAULT_AGENTS_HOST,\n createClient,\n type AgentClientIface,\n type AgentsApiIface,\n type AppApiIface,\n type CreateClientOptionsIface,\n type DecisionsApiIface,\n type InferenceApiIface,\n type PeopleApiIface,\n type PlatformIdentityApiIface,\n type RealtimeApiIface,\n} from \"./client.mjs\";\nexport {\n CollectionEventKind,\n CollectionResyncReason,\n type CollectionEvent,\n type CollectionEventsOptionsIface,\n type CollectionResyncEventIface,\n} from \"./collection-events.mjs\";\nexport {\n ConfigOptionCategory,\n configSelectFor,\n configSelectsOf,\n type ConfigSelectChoiceIface,\n type ConfigSelectIface,\n type SessionConfigOptionIface,\n} from \"./config-options.mjs\";\nexport type { EnumInput, SignalOptionsIface } from \"./context.mjs\";\nexport type {\n ConversationChannelRoutesApiIface,\n ConversationContextApiIface,\n ConversationContextEntryInputIface,\n ConversationDecisionsApiIface,\n ConversationInputsApiIface,\n ConversationLabelsApiIface,\n ConversationReadGrantsApiIface,\n ConversationResourcesIface,\n ResourceSubscriptionsApiIface,\n SendInputArgsIface,\n} from \"./conversation-resources.mjs\";\nexport {\n TURN_OPEN_SESSION_STATES,\n isNewerMessageVersion,\n messageVersionOf,\n type MessageVersionIface,\n} from \"./conversations.mjs\";\nexport type {\n ConversationAgentTurnIface,\n ConversationEvent,\n ConversationEventMetaIface,\n ConversationEventsOptionsIface,\n ConversationHandleIface,\n ConversationsApiIface,\n CreateConversationArgsIface,\n ListMessagesOptionsIface,\n OpenedConversationIface,\n ParticipantCreateInput,\n ParticipantsApiIface,\n ProjectConversationsApiIface,\n SandboxFileContentArgsIface,\n SandboxFileContentRequestIface,\n SendMessageOptionsIface,\n SentMessageIface,\n UploadAttachmentArgsIface,\n} from \"./conversations.mjs\";\nexport {\n AgentClientErrorName,\n ClientErrorCode,\n DecisionErrorReason,\n clientError,\n decisionError,\n isClientError,\n isDecisionError,\n isRealtimeSubscriptionError,\n isRequirementsUnmetError,\n isTerminalRealtimeError,\n isTurnRejectedError,\n realtimeSubscriptionError,\n requirementsUnmetError,\n turnRejectedError,\n type AgentClientError,\n type ClientErrorIface,\n type DecisionErrorIface,\n type RealtimeSubscriptionErrorIface,\n type RequirementsUnmetErrorIface,\n type TurnRejectedErrorIface,\n} from \"./errors.mjs\";\nexport {\n EVENTS_POLL_INTERVAL_MS,\n type EventsApiIface,\n type EventSubscriptionsApiIface,\n type ListEventsOptionsIface,\n type StreamEventsOptionsIface,\n} from \"./events.mjs\";\nexport { defaultStreamTiming, type StreamTimingIface } from \"./frame-stream.mjs\";\nexport type { AgentClientAuth, FetchIface, HeadersOption } from \"./http.mjs\";\nexport type {\n AcpAdaptersApiIface,\n DefinitionSelectorIface,\n HarnessesApiIface,\n SubscriptionAllowancesApiIface,\n} from \"./harnesses.mjs\";\nexport type { IntegrationsApiIface } from \"./integrations.mjs\";\nexport { SessionLiveEventKind, type SessionLiveEvent } from \"./live-stream.mjs\";\nexport type { LocalComputeIface } from \"./local-host.mjs\";\nexport type { OAuthClientsApiIface, SignInReturnOriginsApiIface } from \"./oauth-clients.mjs\";\nexport type { ProjectClientIface } from \"./project.mjs\";\nexport type { AgentSelectorIface, ProjectAgentsApiIface } from \"./project-agents.mjs\";\nexport type {\n ProjectApiKeysApiIface,\n ProjectMembersApiIface,\n ProjectResourceApiIface,\n ProjectsApiIface,\n} from \"./projects.mjs\";\nexport type {\n ProjectPublisherApiIface,\n PublicNamesApiIface,\n PublisherHandleIface,\n PublishersApiIface,\n} from \"./publishers.mjs\";\nexport {\n provideDocumentOf,\n resourceIdOf,\n type ProvideIface,\n type ProvidePatchIface,\n type ResourceRef,\n type ResourceRefIface,\n} from \"./provide.mjs\";\nexport {\n createGatewayRealtimeTransport,\n type GatewayConnect,\n type GatewayConnectionIface,\n type GatewayRealtimeTransportOptionsIface,\n type RealtimeSubscribeOptionsIface,\n type RealtimeTransportFrameIface,\n type RealtimeTransportIface,\n} from \"./realtime.mjs\";\nexport {\n SANDBOX_FILE_URI_SCHEME,\n createSandboxFileUri,\n parseSandboxFileUri,\n type SandboxFileTargetIface,\n} from \"./sandbox-uri.mjs\";\nexport type { SandboxProvidersApiIface } from \"./sandbox-providers.mjs\";\nexport type {\n CreateSandboxOptionsIface,\n SandboxEnvironmentValueIface,\n SandboxHandleIface,\n SandboxOwnerIface,\n SandboxSetupRefIface,\n SandboxSetupsApiIface,\n SandboxesApiIface,\n} from \"./sandboxes.mjs\";\nexport type { ProjectSchedulesApiIface } from \"./schedules.mjs\";\nexport type {\n CreateSessionArgsIface,\n CreatedSessionIface,\n ForkSessionOptionsIface,\n ProjectSessionsApiIface,\n RespondArgs,\n SendOptionsIface,\n SessionHandleIface,\n SessionsApiIface,\n StreamOptionsIface,\n TurnHandleIface,\n TurnResultIface,\n} from \"./sessions.mjs\";\n"],
|
|
5
|
+
"mappings": "AAIA,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,mBAA+D;AACxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAeP;AAAA,EACE;AAAA,EACA;AAAA,OAUK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAcP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAoBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP;AAAA,EACE;AAAA,OAKK;AACP,SAAS,2BAAmD;AAS5D,SAAS,4BAAmD;AAiB5D;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,OAOK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type CompleteSignInResponseIface, type CreateIntegrationRequestIface, type IntegrationIface, type IntegrationListIface, type StartSignInResponseIface } from '@finalai/agent-protocol/agent-platform';
|
|
2
|
+
import { type ClientContextIface, type SignalOptionsIface } from "./context.mjs";
|
|
3
|
+
export interface IntegrationsApiIface {
|
|
4
|
+
/** Names are unique in a project. Returns the integration; pass it in `provide.integrations`. */
|
|
5
|
+
create: (args: CreateIntegrationRequestIface & SignalOptionsIface) => Promise<IntegrationIface>;
|
|
6
|
+
get: (selector: ({
|
|
7
|
+
name: string;
|
|
8
|
+
} | {
|
|
9
|
+
id: string;
|
|
10
|
+
}) & SignalOptionsIface) => Promise<IntegrationIface>;
|
|
11
|
+
list: (options?: SignalOptionsIface & {
|
|
12
|
+
cursor?: string;
|
|
13
|
+
limit?: number;
|
|
14
|
+
}) => Promise<IntegrationListIface>;
|
|
15
|
+
delete: (args: {
|
|
16
|
+
id: string;
|
|
17
|
+
} & SignalOptionsIface) => Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Starts the caller's own sign-in: an authorization URL to open. Pass the
|
|
20
|
+
* sign-in decision's id to resolve it when the sign-in completes.
|
|
21
|
+
*/
|
|
22
|
+
signIn: (args: {
|
|
23
|
+
id: string;
|
|
24
|
+
returnUrl?: string;
|
|
25
|
+
decisionId?: string;
|
|
26
|
+
} & SignalOptionsIface) => Promise<StartSignInResponseIface>;
|
|
27
|
+
/** Activates a sign-in with the `state` and `code` the provider redirected with. */
|
|
28
|
+
completeSignIn: (args: {
|
|
29
|
+
state: string;
|
|
30
|
+
code: string;
|
|
31
|
+
} & SignalOptionsIface) => Promise<CompleteSignInResponseIface>;
|
|
32
|
+
/** Forgets the caller's own sign-in. */
|
|
33
|
+
signOut: (args: {
|
|
34
|
+
id: string;
|
|
35
|
+
} & SignalOptionsIface) => Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export declare const createIntegrationsApi: (args: {
|
|
38
|
+
context: ClientContextIface;
|
|
39
|
+
projectId: string;
|
|
40
|
+
}) => IntegrationsApiIface;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
completeSignInRequestSchema,
|
|
3
|
+
completeSignInResponseSchema,
|
|
4
|
+
createIntegrationRequestSchema,
|
|
5
|
+
integrationListSchema,
|
|
6
|
+
integrationSchema,
|
|
7
|
+
okResponseSchema,
|
|
8
|
+
startSignInRequestSchema,
|
|
9
|
+
startSignInResponseSchema
|
|
10
|
+
} from "@finalai/agent-protocol/agent-platform";
|
|
11
|
+
import { encodePath } from "./context.mjs";
|
|
12
|
+
import { clientError, ClientErrorCode } from "./errors.mjs";
|
|
13
|
+
import { HttpMethod } from "./http.mjs";
|
|
14
|
+
const projectPath = (projectId, suffix) => `/v1/projects/${encodePath(projectId)}${suffix}`;
|
|
15
|
+
const createIntegrationsApi = (args) => {
|
|
16
|
+
const { http } = args.context;
|
|
17
|
+
const integrationPath = (id, suffix = "") => projectPath(args.projectId, `/integrations/${encodePath(id)}${suffix}`);
|
|
18
|
+
return {
|
|
19
|
+
create: ({ signal, ...value }) => http.request({
|
|
20
|
+
method: HttpMethod.Post,
|
|
21
|
+
path: projectPath(args.projectId, "/integrations"),
|
|
22
|
+
body: { schema: createIntegrationRequestSchema, value },
|
|
23
|
+
response: integrationSchema,
|
|
24
|
+
signal
|
|
25
|
+
}),
|
|
26
|
+
get: async ({ signal, ...selector }) => {
|
|
27
|
+
if ("id" in selector)
|
|
28
|
+
return http.request({
|
|
29
|
+
method: HttpMethod.Get,
|
|
30
|
+
path: integrationPath(selector.id),
|
|
31
|
+
response: integrationSchema,
|
|
32
|
+
signal
|
|
33
|
+
});
|
|
34
|
+
const { integrations } = await http.request({
|
|
35
|
+
method: HttpMethod.Get,
|
|
36
|
+
path: projectPath(args.projectId, "/integrations"),
|
|
37
|
+
query: { name: selector.name },
|
|
38
|
+
response: integrationListSchema,
|
|
39
|
+
signal
|
|
40
|
+
});
|
|
41
|
+
const found = integrations.find((integration) => integration.name === selector.name);
|
|
42
|
+
if (found == null)
|
|
43
|
+
throw clientError({
|
|
44
|
+
message: `No integration named ${selector.name} in this project`,
|
|
45
|
+
status: 404,
|
|
46
|
+
code: ClientErrorCode.NotFound
|
|
47
|
+
});
|
|
48
|
+
return found;
|
|
49
|
+
},
|
|
50
|
+
list: (options) => http.request({
|
|
51
|
+
method: HttpMethod.Get,
|
|
52
|
+
path: projectPath(args.projectId, "/integrations"),
|
|
53
|
+
query: { cursor: options?.cursor, limit: options?.limit },
|
|
54
|
+
response: integrationListSchema,
|
|
55
|
+
signal: options?.signal
|
|
56
|
+
}),
|
|
57
|
+
delete: async ({ id, signal }) => {
|
|
58
|
+
await http.request({
|
|
59
|
+
method: HttpMethod.Delete,
|
|
60
|
+
path: integrationPath(id),
|
|
61
|
+
response: okResponseSchema,
|
|
62
|
+
signal
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
signIn: ({ id, signal, ...value }) => http.request({
|
|
66
|
+
method: HttpMethod.Post,
|
|
67
|
+
path: integrationPath(id, "/sign-in"),
|
|
68
|
+
body: { schema: startSignInRequestSchema, value },
|
|
69
|
+
response: startSignInResponseSchema,
|
|
70
|
+
signal
|
|
71
|
+
}),
|
|
72
|
+
completeSignIn: ({ signal, ...value }) => http.request({
|
|
73
|
+
method: HttpMethod.Post,
|
|
74
|
+
path: "/v1/sign-ins/complete",
|
|
75
|
+
body: { schema: completeSignInRequestSchema, value },
|
|
76
|
+
response: completeSignInResponseSchema,
|
|
77
|
+
signal
|
|
78
|
+
}),
|
|
79
|
+
signOut: async ({ id, signal }) => {
|
|
80
|
+
await http.request({
|
|
81
|
+
method: HttpMethod.Delete,
|
|
82
|
+
path: integrationPath(id, "/sign-in"),
|
|
83
|
+
response: okResponseSchema,
|
|
84
|
+
signal
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
createIntegrationsApi
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=integrations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/agent-client/integrations.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n completeSignInRequestSchema,\n completeSignInResponseSchema,\n createIntegrationRequestSchema,\n integrationListSchema,\n integrationSchema,\n okResponseSchema,\n startSignInRequestSchema,\n startSignInResponseSchema,\n type CompleteSignInResponseIface,\n type CreateIntegrationRequestIface,\n type IntegrationIface,\n type IntegrationListIface,\n type StartSignInResponseIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { clientError, ClientErrorCode } from \"./errors.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\n// Integrations (sources of tools: MCP servers, Final's gateway among them),\n// scoped to one project.\n\nexport interface IntegrationsApiIface {\n /** Names are unique in a project. Returns the integration; pass it in `provide.integrations`. */\n create: (args: CreateIntegrationRequestIface & SignalOptionsIface) => Promise<IntegrationIface>;\n get: (\n selector: ({ name: string } | { id: string }) & SignalOptionsIface,\n ) => Promise<IntegrationIface>;\n list: (\n options?: SignalOptionsIface & { cursor?: string; limit?: number },\n ) => Promise<IntegrationListIface>;\n delete: (args: { id: string } & SignalOptionsIface) => Promise<void>;\n /**\n * Starts the caller's own sign-in: an authorization URL to open. Pass the\n * sign-in decision's id to resolve it when the sign-in completes.\n */\n signIn: (\n args: { id: string; returnUrl?: string; decisionId?: string } & SignalOptionsIface,\n ) => Promise<StartSignInResponseIface>;\n /** Activates a sign-in with the `state` and `code` the provider redirected with. */\n completeSignIn: (\n args: { state: string; code: string } & SignalOptionsIface,\n ) => Promise<CompleteSignInResponseIface>;\n /** Forgets the caller's own sign-in. */\n signOut: (args: { id: string } & SignalOptionsIface) => Promise<void>;\n}\n\nconst projectPath = (projectId: string, suffix: string): string =>\n `/v1/projects/${encodePath(projectId)}${suffix}`;\n\nexport const createIntegrationsApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): IntegrationsApiIface => {\n const { http } = args.context;\n const integrationPath = (id: string, suffix = '') =>\n projectPath(args.projectId, `/integrations/${encodePath(id)}${suffix}`);\n return {\n create: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: projectPath(args.projectId, '/integrations'),\n body: { schema: createIntegrationRequestSchema, value },\n response: integrationSchema,\n signal,\n }),\n get: async ({ signal, ...selector }) => {\n if ('id' in selector)\n return http.request({\n method: HttpMethod.Get,\n path: integrationPath(selector.id),\n response: integrationSchema,\n signal,\n });\n const { integrations } = await http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/integrations'),\n query: { name: selector.name },\n response: integrationListSchema,\n signal,\n });\n const found = integrations.find((integration) => integration.name === selector.name);\n if (found == null)\n throw clientError({\n message: `No integration named ${selector.name} in this project`,\n status: 404,\n code: ClientErrorCode.NotFound,\n });\n return found;\n },\n list: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/integrations'),\n query: { cursor: options?.cursor, limit: options?.limit },\n response: integrationListSchema,\n signal: options?.signal,\n }),\n delete: async ({ id, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: integrationPath(id),\n response: okResponseSchema,\n signal,\n });\n },\n signIn: ({ id, signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: integrationPath(id, '/sign-in'),\n body: { schema: startSignInRequestSchema, value },\n response: startSignInResponseSchema,\n signal,\n }),\n completeSignIn: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/sign-ins/complete',\n body: { schema: completeSignInRequestSchema, value },\n response: completeSignInResponseSchema,\n signal,\n }),\n signOut: async ({ id, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: integrationPath(id, '/sign-in'),\n response: okResponseSchema,\n signal,\n });\n },\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,kBAAoE;AAC7E,SAAS,aAAa,uBAAuB;AAC7C,SAAS,kBAAkB;AA8B3B,MAAM,cAAc,CAAC,WAAmB,WACtC,gBAAgB,WAAW,SAAS,CAAC,GAAG,MAAM;AAEzC,MAAM,wBAAwB,CAAC,SAGV;AAC1B,QAAM,EAAE,KAAK,IAAI,KAAK;AACtB,QAAM,kBAAkB,CAAC,IAAY,SAAS,OAC5C,YAAY,KAAK,WAAW,iBAAiB,WAAW,EAAE,CAAC,GAAG,MAAM,EAAE;AACxE,SAAO;AAAA,IACL,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,MAC1B,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,YAAY,KAAK,WAAW,eAAe;AAAA,MACjD,MAAM,EAAE,QAAQ,gCAAgC,MAAM;AAAA,MACtD,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,IACH,KAAK,OAAO,EAAE,QAAQ,GAAG,SAAS,MAAM;AACtC,UAAI,QAAQ;AACV,eAAO,KAAK,QAAQ;AAAA,UAClB,QAAQ,WAAW;AAAA,UACnB,MAAM,gBAAgB,SAAS,EAAE;AAAA,UACjC,UAAU;AAAA,UACV;AAAA,QACF,CAAC;AACH,YAAM,EAAE,aAAa,IAAI,MAAM,KAAK,QAAQ;AAAA,QAC1C,QAAQ,WAAW;AAAA,QACnB,MAA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