@pasko70/pibo 1.16.6 → 2.0.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/dist/agent-runtime/auth.js +28 -0
- package/dist/agent-runtime/capabilities.js +221 -0
- package/dist/agent-runtime/context-build.js +313 -0
- package/dist/agent-runtime/contract.js +45 -0
- package/dist/agent-runtime/errors.js +57 -0
- package/dist/agent-runtime/events.js +1 -0
- package/dist/agent-runtime/history.js +1 -0
- package/dist/agent-runtime/profile-validation.js +109 -0
- package/dist/agent-runtime/registry.js +608 -0
- package/dist/agent-runtime/resource-files.js +87 -0
- package/dist/agent-runtime/resource-service.js +635 -0
- package/dist/agent-runtime/resources.js +1 -0
- package/dist/agent-runtime/routed-session.js +931 -0
- package/dist/agent-runtime/testing/contract.js +51 -0
- package/dist/agent-runtime/testing/fake-adapter.js +192 -0
- package/dist/agent-runtime/types.js +3 -0
- package/dist/agent-runtimes/codex-native/adapter.js +905 -0
- package/dist/agent-runtimes/codex-native/auth.js +476 -0
- package/dist/agent-runtimes/codex-native/client.js +734 -0
- package/dist/agent-runtimes/codex-native/config.js +152 -0
- package/dist/agent-runtimes/codex-native/history.js +283 -0
- package/dist/agent-runtimes/codex-native/mcp-stdio-launcher.js +89 -0
- package/dist/agent-runtimes/codex-native/models.js +581 -0
- package/dist/agent-runtimes/codex-native/process.js +459 -0
- package/dist/agent-runtimes/codex-native/protocol-types.js +1 -0
- package/dist/agent-runtimes/codex-native/protocol-version.js +7 -0
- package/dist/agent-runtimes/codex-native/redaction.js +31 -0
- package/dist/agent-runtimes/codex-native/requests.js +378 -0
- package/dist/agent-runtimes/codex-native/resource-delivery.js +445 -0
- package/dist/agent-runtimes/codex-native/thread.js +388 -0
- package/dist/agent-runtimes/codex-native/turn.js +849 -0
- package/dist/agent-runtimes/pi/adapter.js +653 -0
- package/dist/agent-runtimes/pi/auth.js +455 -0
- package/dist/agent-runtimes/pi/history.js +640 -0
- package/dist/agent-runtimes/pi/model-catalog.js +87 -0
- package/dist/agent-runtimes/pi/routed-session.js +1464 -0
- package/dist/agent-runtimes/pi/runtime.js +534 -0
- package/dist/agent-runtimes/pi/tool-compiler.js +69 -0
- package/dist/apps/chat/agent-profiles.js +40 -23
- package/dist/apps/chat/agent-store.js +111 -64
- package/dist/apps/chat/chat-api-routes.js +1 -1
- package/dist/apps/chat/chat-request-normalizers.js +47 -0
- package/dist/apps/chat/data/chat-data-mappers.js +25 -9
- package/dist/apps/chat/data/history-query-service.js +108 -0
- package/dist/apps/chat/data/session-query-service.js +24 -3
- package/dist/apps/chat/data/timeline-query-service.js +3 -3
- package/dist/apps/chat/model-catalog.js +1 -55
- package/dist/apps/chat/provider-auth-actions.js +171 -23
- package/dist/apps/chat/stream.js +12 -0
- package/dist/apps/chat/trace-v2.js +1 -0
- package/dist/apps/chat/trace.js +126 -415
- package/dist/apps/chat/web-app.js +582 -157
- package/dist/apps/chat-ui/assets/{dist-BTLtT_Vf.js → dist-9v2ZXT6V.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CMk1aPug.js → dist-B1LVAytl.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CcwA_IWN.js → dist-C6LPDFXU.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-DKOthbxr.js → dist-DVtXxfHc.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-ls2I6BIw.js → dist-DW4Qrfbd.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-D1rAtRWs.js → dist-DmbsHdMC.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-C1JQRskW.js → dist-DyvwuSFO.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-DfpaylQ-.js → dist-I26VB0QO.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-D10bTFD5.js → dist-RtHbJRPV.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-5KpmmBBZ.js → dist-sZgJkWZb.js} +1 -1
- package/dist/apps/chat-ui/assets/index-BPbNvcZe.css +1 -0
- package/dist/apps/chat-ui/assets/index-CIOf2uL2.js +237 -0
- package/dist/apps/chat-ui/index.html +2 -2
- package/dist/apps/chat-vscode-web/assets/index-1ivRyjFs.js +41 -0
- package/dist/apps/chat-vscode-web/index.html +1 -1
- package/dist/apps/vscode-artifacts/latest.vsix +0 -0
- package/dist/apps/vscode-artifacts/pibo-vscode-ext-2.0.0.vsix +0 -0
- package/dist/auth/login-actions.js +5 -251
- package/dist/cli-session/localSessionSource.js +8 -1
- package/dist/core/context-build.js +124 -20
- package/dist/core/default-profile.js +8 -0
- package/dist/core/profiles.js +30 -3
- package/dist/core/routed-session.js +5 -1446
- package/dist/core/runtime.js +5 -561
- package/dist/core/session-router.js +637 -83
- package/dist/data/cli.js +20 -3
- package/dist/data/schema.js +104 -1
- package/dist/data/session-store.js +24 -1
- package/dist/debug/events.js +25 -10
- package/dist/debug/failures.js +23 -3
- package/dist/debug/index.js +24 -6
- package/dist/debug/messages.js +87 -7
- package/dist/debug/persisted-payloads.js +31 -0
- package/dist/debug/pty.js +7 -6
- package/dist/debug/runtime-binding.js +29 -0
- package/dist/debug/session.js +137 -0
- package/dist/debug/summary.js +12 -0
- package/dist/debug/telemetry.js +28 -0
- package/dist/debug/tools.js +12 -2
- package/dist/debug/trace.js +154 -76
- package/dist/gateway/server.js +87 -2
- package/dist/gateway/tool.js +5 -5
- package/dist/index.js +21 -2
- package/dist/loops/tools.js +13 -12
- package/dist/mcp/agent-context.js +13 -4
- package/dist/mcp/client.js +10 -6
- package/dist/mcp/config.js +5 -2
- package/dist/mcp/runtime-session.js +166 -0
- package/dist/plugins/builtin.js +191 -53
- package/dist/plugins/codex-native.js +29 -0
- package/dist/plugins/registry.js +66 -2
- package/dist/runs/tools.js +26 -25
- package/dist/session-ui/terminalRows.js +2 -2
- package/dist/sessions/pibo-data-store.js +125 -16
- package/dist/sessions/runtime-binding.js +107 -0
- package/dist/sessions/sqlite-store.js +239 -18
- package/dist/sessions/store.js +86 -7
- package/dist/shared/trace-engine.js +18 -9
- package/dist/shared/trace-event-projection.js +29 -11
- package/dist/shared/{trace-transcript.js → trace-history.js} +193 -195
- package/dist/shared/trace-order.js +9 -4
- package/dist/shared/trace-page-merge.js +1 -1
- package/dist/signals/projector.js +20 -2
- package/dist/signals/registry.js +11 -0
- package/dist/subagents/tool.js +8 -6
- package/dist/tools/codex-browser.js +20 -19
- package/dist/tools/codex-compat.js +10 -9
- package/dist/tools/codex-image-generation.js +8 -6
- package/dist/tools/contract.js +45 -0
- package/dist/tools/credential-registry.js +182 -0
- package/dist/tools/mcp-bridge.js +511 -0
- package/dist/tools/payload-writer.js +17 -0
- package/dist/tools/runtime/tool.js +10 -9
- package/dist/tools/schema.js +9 -0
- package/dist/tools/session-service.js +193 -0
- package/dist/tools/session-tool-set.js +85 -0
- package/dist/web-annotations/tools.js +17 -16
- package/docs/README.md +11 -0
- package/package.json +3 -2
- package/skills/builtin/pibo-agent-runtime-adapter/SKILL.md +183 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/README.md +10 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/evals.json +45 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/fixtures/orion-full-harness.md +60 -0
- package/skills/builtin/pibo-agent-runtime-adapter/evals/fixtures/relay-partial-harness.md +52 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/capabilities-and-designer.md +194 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/history-debug-and-security.md +213 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/interfaces-and-registration.md +214 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/lifecycle-bindings-and-events.md +193 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/portable-delivery-and-native-behavior.md +226 -0
- package/skills/builtin/pibo-agent-runtime-adapter/references/testing-migration-and-validation.md +256 -0
- package/dist/apps/chat-ui/assets/index-C2YI0xfw.js +0 -237
- package/dist/apps/chat-ui/assets/index-E0RmuCkY.css +0 -1
- package/dist/apps/chat-vscode-web/assets/index-D-tSsXLG.js +0 -41
|
@@ -1,55 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerMiniMaxProvider } from "../../providers/minimax.js";
|
|
3
|
-
import { registerGlmProvider } from "../../providers/glm.js";
|
|
4
|
-
import { registerOpenAiGpt56Models } from "../../providers/openai-gpt56.js";
|
|
5
|
-
import { registerQwenTokenPlanProvider } from "../../providers/qwen-token-plan.js";
|
|
6
|
-
export function buildModelCatalogFromRegistry(registry) {
|
|
7
|
-
const providers = new Map();
|
|
8
|
-
for (const model of registry.getAll()) {
|
|
9
|
-
const providerId = model.provider;
|
|
10
|
-
let provider = providers.get(providerId);
|
|
11
|
-
if (!provider) {
|
|
12
|
-
const authConfigured = registry.getProviderAuthStatus?.(providerId).configured ?? false;
|
|
13
|
-
provider = {
|
|
14
|
-
id: providerId,
|
|
15
|
-
label: registry.getProviderDisplayName?.(providerId) ?? providerId,
|
|
16
|
-
authConfigured,
|
|
17
|
-
models: [],
|
|
18
|
-
};
|
|
19
|
-
providers.set(providerId, provider);
|
|
20
|
-
}
|
|
21
|
-
provider.models.push({
|
|
22
|
-
provider: providerId,
|
|
23
|
-
id: model.id,
|
|
24
|
-
label: model.name || model.id,
|
|
25
|
-
authConfigured: provider.authConfigured,
|
|
26
|
-
supportsReasoning: model.reasoning || undefined,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
providers: [...providers.values()]
|
|
31
|
-
.sort((left, right) => left.label.localeCompare(right.label) || left.id.localeCompare(right.id))
|
|
32
|
-
.map((provider) => ({
|
|
33
|
-
...provider,
|
|
34
|
-
models: [...provider.models].sort((left, right) => left.label.localeCompare(right.label) || left.id.localeCompare(right.id)),
|
|
35
|
-
})),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export async function loadModelCatalogWithServices(createServices, cwd = process.cwd(), extensionHook) {
|
|
39
|
-
try {
|
|
40
|
-
const services = await createServices({ cwd });
|
|
41
|
-
extensionHook?.(services.modelRegistry);
|
|
42
|
-
return buildModelCatalogFromRegistry(services.modelRegistry);
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
return { providers: [] };
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
export async function loadModelCatalog(cwd = process.cwd()) {
|
|
49
|
-
return loadModelCatalogWithServices(createAgentSessionServices, cwd, (registry) => {
|
|
50
|
-
registerOpenAiGpt56Models(registry);
|
|
51
|
-
registerMiniMaxProvider(registry);
|
|
52
|
-
registerGlmProvider(registry);
|
|
53
|
-
registerQwenTokenPlanProvider(registry);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
1
|
+
export { buildModelCatalogFromRegistry, loadModelCatalog, loadModelCatalogWithServices, } from "../../agent-runtimes/pi/model-catalog.js";
|
|
@@ -1,36 +1,184 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { aggregateAgentRuntimeAuthState, redactAgentRuntimeAuthText } from "../../agent-runtime/auth.js";
|
|
3
|
+
import { AgentRuntimeAuthError, AgentRuntimeCapabilityUnavailableError, AgentRuntimeContractError, AgentRuntimeUnavailableError, } from "../../agent-runtime/errors.js";
|
|
3
4
|
import { PiboWebHttpError, responseJson } from "../../web/http.js";
|
|
4
5
|
function isJsonObject(value) {
|
|
5
6
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
7
|
}
|
|
8
|
+
function runtimeInstanceId(input) {
|
|
9
|
+
if (typeof input.runtimeInstanceId !== "string" || !input.runtimeInstanceId.trim()) {
|
|
10
|
+
throw new PiboWebHttpError("runtimeInstanceId is required for provider authentication", 400);
|
|
11
|
+
}
|
|
12
|
+
return input.runtimeInstanceId.trim();
|
|
13
|
+
}
|
|
14
|
+
function providerId(input, action) {
|
|
15
|
+
const provider = typeof input.providerId === "string" ? input.providerId : input.provider;
|
|
16
|
+
if (typeof provider !== "string" || !provider.trim()) {
|
|
17
|
+
throw new PiboWebHttpError(`${action} requires providerId`, 400);
|
|
18
|
+
}
|
|
19
|
+
return provider.trim();
|
|
20
|
+
}
|
|
21
|
+
function flowId(input, action) {
|
|
22
|
+
const value = typeof input.flowId === "string" && input.flowId.trim()
|
|
23
|
+
? input.flowId
|
|
24
|
+
: typeof input.state === "string" && input.state.trim()
|
|
25
|
+
? input.state
|
|
26
|
+
: undefined;
|
|
27
|
+
if (!value)
|
|
28
|
+
throw new PiboWebHttpError(`${action} requires flowId`, 400);
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
function safeRuntimeAuthError(error) {
|
|
32
|
+
if (error instanceof PiboWebHttpError)
|
|
33
|
+
throw error;
|
|
34
|
+
if (error instanceof AgentRuntimeAuthError
|
|
35
|
+
|| error instanceof AgentRuntimeCapabilityUnavailableError
|
|
36
|
+
|| error instanceof AgentRuntimeContractError
|
|
37
|
+
|| error instanceof AgentRuntimeUnavailableError) {
|
|
38
|
+
throw new PiboWebHttpError(redactAgentRuntimeAuthText(error.message), error instanceof AgentRuntimeUnavailableError ? 404 : 409);
|
|
39
|
+
}
|
|
40
|
+
throw new PiboWebHttpError("Runtime provider authentication failed safely. Retry after checking the selected runtime.", 502);
|
|
41
|
+
}
|
|
7
42
|
export function isProviderAuthAction(action) {
|
|
8
|
-
return action === "login.status"
|
|
43
|
+
return action === "login.status"
|
|
44
|
+
|| action === "login.start"
|
|
45
|
+
|| action === "login.complete"
|
|
46
|
+
|| action === "login.apikey"
|
|
47
|
+
|| action === "login.cancel"
|
|
48
|
+
|| action === "logout";
|
|
49
|
+
}
|
|
50
|
+
export function buildProviderAuthCatalog(inspections, defaultRuntimeInstanceId) {
|
|
51
|
+
return {
|
|
52
|
+
...(defaultRuntimeInstanceId ? { defaultRuntimeInstanceId } : {}),
|
|
53
|
+
targets: inspections.map((runtime) => {
|
|
54
|
+
const supported = runtime.capabilities.auth.status;
|
|
55
|
+
const providers = runtime.auth ?? [];
|
|
56
|
+
const state = !supported
|
|
57
|
+
? "unsupported"
|
|
58
|
+
: !runtime.enabled || !runtime.available
|
|
59
|
+
? "failed"
|
|
60
|
+
: aggregateAgentRuntimeAuthState(providers, true);
|
|
61
|
+
return {
|
|
62
|
+
runtimeInstanceId: runtime.id,
|
|
63
|
+
adapterId: runtime.adapterId,
|
|
64
|
+
displayName: runtime.displayName,
|
|
65
|
+
enabled: runtime.enabled,
|
|
66
|
+
available: runtime.available,
|
|
67
|
+
isDefault: runtime.id === defaultRuntimeInstanceId,
|
|
68
|
+
credentialScope: runtime.capabilities.auth.credentialScope,
|
|
69
|
+
cancelSupported: runtime.capabilities.auth.cancel,
|
|
70
|
+
logoutSupported: runtime.capabilities.auth.logout,
|
|
71
|
+
state,
|
|
72
|
+
providers: providers.map((provider) => structuredClone(provider)),
|
|
73
|
+
diagnostics: runtime.diagnostics.map(({ severity, code, message }) => ({ severity, code, message })),
|
|
74
|
+
};
|
|
75
|
+
}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export async function readProviderAuthCatalog(context, defaultRuntimeInstanceId) {
|
|
79
|
+
const configured = context.getCapabilityCatalog?.().agentRuntimes;
|
|
80
|
+
const inspections = configured
|
|
81
|
+
? configured.map((runtime) => ({ ...runtime, available: runtime.enabled, diagnostics: [] }))
|
|
82
|
+
: context.inspectAgentRuntimeInstances
|
|
83
|
+
? await context.inspectAgentRuntimeInstances()
|
|
84
|
+
: (() => { throw new PiboWebHttpError("Runtime authentication inspection is not available", 501); })();
|
|
85
|
+
const refreshed = await Promise.all(inspections.map(async (runtime) => {
|
|
86
|
+
if (!runtime.enabled || !runtime.capabilities.auth.status || !context.getAgentRuntimeAuthStatus)
|
|
87
|
+
return runtime;
|
|
88
|
+
try {
|
|
89
|
+
return { ...runtime, auth: [...await context.getAgentRuntimeAuthStatus(runtime.id)] };
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return {
|
|
93
|
+
...runtime,
|
|
94
|
+
available: false,
|
|
95
|
+
auth: undefined,
|
|
96
|
+
diagnostics: [
|
|
97
|
+
...runtime.diagnostics,
|
|
98
|
+
{
|
|
99
|
+
severity: "warning",
|
|
100
|
+
code: "runtime_auth_status_failed",
|
|
101
|
+
message: `Authentication status is unavailable for runtime instance "${runtime.id}".`,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}));
|
|
107
|
+
return buildProviderAuthCatalog(refreshed, defaultRuntimeInstanceId);
|
|
9
108
|
}
|
|
10
|
-
export async function executeProviderAuthAction(action, params) {
|
|
109
|
+
export async function executeProviderAuthAction(context, action, params) {
|
|
11
110
|
const input = isJsonObject(params) ? params : {};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
111
|
+
try {
|
|
112
|
+
const selectedRuntime = runtimeInstanceId(input);
|
|
113
|
+
if (action === "login.status") {
|
|
114
|
+
if (!context.getAgentRuntimeAuthStatus)
|
|
115
|
+
throw new PiboWebHttpError("Runtime authentication status is not available", 501);
|
|
116
|
+
const selectedProvider = typeof input.providerId === "string"
|
|
117
|
+
? input.providerId
|
|
118
|
+
: typeof input.provider === "string"
|
|
119
|
+
? input.provider
|
|
120
|
+
: undefined;
|
|
121
|
+
const providers = await context.getAgentRuntimeAuthStatus(selectedRuntime);
|
|
122
|
+
return {
|
|
123
|
+
runtimeInstanceId: selectedRuntime,
|
|
124
|
+
providers: selectedProvider ? providers.filter((provider) => provider.id === selectedProvider) : providers,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const selectedProvider = providerId(input, action);
|
|
128
|
+
if (action === "login.start") {
|
|
129
|
+
if (!context.startAgentRuntimeAuth)
|
|
130
|
+
throw new PiboWebHttpError("Runtime authentication login is not available", 501);
|
|
131
|
+
let method = input.method;
|
|
132
|
+
if (method === undefined) {
|
|
133
|
+
if (!context.getAgentRuntimeAuthStatus)
|
|
134
|
+
throw new PiboWebHttpError("Runtime authentication status is not available", 501);
|
|
135
|
+
const status = (await context.getAgentRuntimeAuthStatus(selectedRuntime)).find((provider) => provider.id === selectedProvider);
|
|
136
|
+
method = status?.methods.find((candidate) => candidate.id !== "api_key")?.id;
|
|
137
|
+
}
|
|
138
|
+
if (method !== "device_code" && method !== "browser_oauth") {
|
|
139
|
+
throw new PiboWebHttpError("login.start requires a supported interactive method", 400);
|
|
140
|
+
}
|
|
141
|
+
return await context.startAgentRuntimeAuth(selectedRuntime, { providerId: selectedProvider, method });
|
|
142
|
+
}
|
|
143
|
+
if (action === "login.apikey") {
|
|
144
|
+
if (!context.startAgentRuntimeAuth)
|
|
145
|
+
throw new PiboWebHttpError("Runtime API-key authentication is not available", 501);
|
|
146
|
+
if (typeof input.apiKey !== "string" || input.apiKey.length === 0) {
|
|
147
|
+
throw new PiboWebHttpError("login.apikey requires apiKey", 400);
|
|
148
|
+
}
|
|
149
|
+
const start = { providerId: selectedProvider, method: "api_key", apiKey: input.apiKey };
|
|
150
|
+
return await context.startAgentRuntimeAuth(selectedRuntime, start);
|
|
151
|
+
}
|
|
152
|
+
if (action === "login.complete") {
|
|
153
|
+
if (!context.completeAgentRuntimeAuth)
|
|
154
|
+
throw new PiboWebHttpError("Runtime authentication completion is not available", 501);
|
|
155
|
+
if (input.code !== undefined && typeof input.code !== "string") {
|
|
156
|
+
throw new PiboWebHttpError("login.complete code must be a string when provided", 400);
|
|
157
|
+
}
|
|
158
|
+
return await context.completeAgentRuntimeAuth(selectedRuntime, {
|
|
159
|
+
providerId: selectedProvider,
|
|
160
|
+
flowId: flowId(input, action),
|
|
161
|
+
...(typeof input.code === "string" ? { code: input.code } : {}),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (action === "login.cancel") {
|
|
165
|
+
if (!context.cancelAgentRuntimeAuth)
|
|
166
|
+
throw new PiboWebHttpError("Runtime authentication cancellation is not available", 501);
|
|
167
|
+
return await context.cancelAgentRuntimeAuth(selectedRuntime, {
|
|
168
|
+
providerId: selectedProvider,
|
|
169
|
+
flowId: flowId(input, action),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (action === "logout") {
|
|
173
|
+
if (!context.logoutAgentRuntimeAuth)
|
|
174
|
+
throw new PiboWebHttpError("Runtime authentication logout is not available", 501);
|
|
175
|
+
return await context.logoutAgentRuntimeAuth(selectedRuntime, { providerId: selectedProvider });
|
|
176
|
+
}
|
|
177
|
+
throw new PiboWebHttpError(`Unsupported provider auth action ${action}`, 400);
|
|
25
178
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
throw new PiboWebHttpError("login.apikey requires params.apiKey", 400);
|
|
29
|
-
return setApiKey(provider, input.apiKey);
|
|
179
|
+
catch (error) {
|
|
180
|
+
safeRuntimeAuthError(error);
|
|
30
181
|
}
|
|
31
|
-
if (action === "logout")
|
|
32
|
-
return removeLogin(provider);
|
|
33
|
-
throw new PiboWebHttpError(`Unsupported provider auth action ${action}`, 400);
|
|
34
182
|
}
|
|
35
183
|
export function providerAuthActionResponse(input) {
|
|
36
184
|
return responseJson({
|
package/dist/apps/chat/stream.js
CHANGED
|
@@ -102,6 +102,18 @@ export function chatStreamFramesFromOutputEvent(event, state, options = {}) {
|
|
|
102
102
|
case "execution_result":
|
|
103
103
|
frames.push({ type: "EXECUTION_RESULT", runId: eventId, eventId: event.eventId, action: event.action, result: event.result });
|
|
104
104
|
break;
|
|
105
|
+
case "approval_requested":
|
|
106
|
+
frames.push({ type: "RUNTIME_APPROVAL_REQUESTED", runId: eventId, request: event.request });
|
|
107
|
+
break;
|
|
108
|
+
case "approval_resolved":
|
|
109
|
+
frames.push({ type: "RUNTIME_APPROVAL_RESOLVED", runId: eventId, requestId: event.requestId, resolution: event.resolution });
|
|
110
|
+
break;
|
|
111
|
+
case "user_input_requested":
|
|
112
|
+
frames.push({ type: "RUNTIME_USER_INPUT_REQUESTED", runId: eventId, request: event.request });
|
|
113
|
+
break;
|
|
114
|
+
case "user_input_resolved":
|
|
115
|
+
frames.push({ type: "RUNTIME_USER_INPUT_RESOLVED", runId: eventId, requestId: event.requestId, resolution: event.resolution });
|
|
116
|
+
break;
|
|
105
117
|
case "session_error":
|
|
106
118
|
frames.push({ type: "RUN_ERROR", runId: eventId, message: event.error, errorDetails: event.errorDetails });
|
|
107
119
|
break;
|
|
@@ -27,6 +27,7 @@ export function traceTimelinePageFromView(input) {
|
|
|
27
27
|
let page = {
|
|
28
28
|
piboSessionId: input.trace.piboSessionId,
|
|
29
29
|
piSessionId: input.trace.piSessionId,
|
|
30
|
+
runtimeBinding: input.trace.runtimeBinding,
|
|
30
31
|
title: input.trace.title,
|
|
31
32
|
version: input.trace.version,
|
|
32
33
|
latestStreamId: input.trace.latestStreamId,
|