@noodleseed/one 0.129.2 → 0.131.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/bin.js +0 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/intents-ops.d.ts +3 -0
- package/dist/commands/intents-ops.d.ts.map +1 -0
- package/dist/commands/intents-ops.js +147 -0
- package/dist/commands/intents-ops.js.map +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +4 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.d.ts +21 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.js +10 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.js.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/elevation.d.ts +7 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/elevation.d.ts.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/elevation.js +5 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/elevation.js.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/embed-store.d.ts +5 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/embed-store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/embed-store.js.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/index.d.ts +1 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/index.js +1 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/postgres-assistant.d.ts +8 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/postgres-assistant.d.ts.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/postgres-assistant.js +24 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/postgres-assistant.js.map +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/session-resume.d.ts +22 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/session-resume.d.ts.map +1 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/session-resume.js +28 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/session-resume.js.map +1 -0
- package/node_modules/@noodle-borg/assistant-gateway/package.json +1 -1
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-hosted-observability.d.ts.map +1 -1
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-hosted-observability.js +66 -1
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-hosted-observability.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.js +9 -0
- package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/knowledge/dist/fusion.d.ts +2 -1
- package/node_modules/@noodle-borg/knowledge/dist/fusion.d.ts.map +1 -1
- package/node_modules/@noodle-borg/knowledge/dist/fusion.js +3 -2
- package/node_modules/@noodle-borg/knowledge/dist/fusion.js.map +1 -1
- package/node_modules/@noodle-borg/knowledge-operations/dist/crawl-lifecycle.d.ts.map +1 -1
- package/node_modules/@noodle-borg/knowledge-operations/dist/crawl-lifecycle.js +7 -2
- package/node_modules/@noodle-borg/knowledge-operations/dist/crawl-lifecycle.js.map +1 -1
- package/node_modules/@noodle-borg/module/dist/index.d.ts +1 -0
- package/node_modules/@noodle-borg/module/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/module/dist/index.js +1 -0
- package/node_modules/@noodle-borg/module/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/module/dist/intent.d.ts +54 -0
- package/node_modules/@noodle-borg/module/dist/intent.d.ts.map +1 -0
- package/node_modules/@noodle-borg/module/dist/intent.js +11 -0
- package/node_modules/@noodle-borg/module/dist/intent.js.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/index.d.ts +6 -0
- package/node_modules/@noodle-borg/observability/dist/index.d.ts.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/index.js +6 -0
- package/node_modules/@noodle-borg/observability/dist/index.js.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/intent-capture.d.ts +65 -0
- package/node_modules/@noodle-borg/observability/dist/intent-capture.d.ts.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/intent-capture.js +327 -0
- package/node_modules/@noodle-borg/observability/dist/intent-capture.js.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/request-event-buffer.d.ts.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/request-event-buffer.js.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/request-events-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/request-events-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/request-events.d.ts.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/request-events.js.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/runtime.d.ts +11 -0
- package/node_modules/@noodle-borg/observability/dist/runtime.d.ts.map +1 -0
- package/node_modules/@noodle-borg/observability/dist/runtime.js +29 -0
- package/node_modules/@noodle-borg/observability/dist/runtime.js.map +1 -0
- package/node_modules/@noodle-borg/observability/package.json +32 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/tools.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/handlers/tools.js +22 -3
- package/node_modules/@noodle-borg/protocol/dist/handlers/tools.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/index.d.ts +1 -0
- package/node_modules/@noodle-borg/protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/index.js +1 -0
- package/node_modules/@noodle-borg/protocol/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/intent-capture.d.ts +47 -0
- package/node_modules/@noodle-borg/protocol/dist/intent-capture.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/intent-capture.js +101 -0
- package/node_modules/@noodle-borg/protocol/dist/intent-capture.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts +5 -2
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.js +9 -7
- package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/observation.d.ts +3 -0
- package/node_modules/@noodle-borg/protocol/dist/observation.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/observation.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts +4 -0
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/v2/server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/v2/server.js +23 -4
- package/node_modules/@noodle-borg/protocol/dist/v2/server.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/package.json +1 -0
- package/node_modules/@noodle-borg/service/dist/archive-preflight.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/archive-preflight.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/archive-preflight.js +19 -0
- package/node_modules/@noodle-borg/service/dist/archive-preflight.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/index.d.ts +1 -3
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +1 -3
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/main.js +2 -0
- package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/observability-runtime.d.ts +25 -0
- package/node_modules/@noodle-borg/service/dist/observability-runtime.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/observability-runtime.js +61 -0
- package/node_modules/@noodle-borg/service/dist/observability-runtime.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/options.d.ts +10 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-elevation.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-elevation.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-elevation.js +3 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-elevation.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-embeds.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-embeds.js +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-embeds.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant.js +70 -30
- package/node_modules/@noodle-borg/service/dist/routes/assistant.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture-dispatch.d.ts +11 -0
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture-dispatch.js +22 -0
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture.d.ts +20 -0
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture.js +158 -0
- package/node_modules/@noodle-borg/service/dist/routes/intent-capture.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +3 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js +6 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +16 -16
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +3 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +25 -32
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/package.json +2 -1
- package/node_modules/@noodle-borg/transport-http/dist/handler.d.ts +6 -1
- package/node_modules/@noodle-borg/transport-http/dist/handler.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/handler.js +4 -0
- package/node_modules/@noodle-borg/transport-http/dist/handler.js.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/request-capture.d.ts +15 -1
- package/node_modules/@noodle-borg/transport-http/dist/request-capture.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/request-capture.js +51 -3
- package/node_modules/@noodle-borg/transport-http/dist/request-capture.js.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.d.ts +3 -1
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.js +21 -5
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.js.map +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts +40 -2
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts.map +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js +26 -2
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js.map +1 -1
- package/node_modules/@noodleseed/assistant/README.md +23 -1
- package/node_modules/@noodleseed/assistant/dist/{chunk-DLUINP4W.js → chunk-LEKEIHJV.js} +61 -33
- package/node_modules/@noodleseed/assistant/dist/{chunk-DLUINP4W.js.map → chunk-LEKEIHJV.js.map} +1 -1
- package/node_modules/@noodleseed/assistant/dist/{chunk-52XT7BLR.js → chunk-ZPZHPXIQ.js} +129 -82
- package/node_modules/@noodleseed/assistant/dist/chunk-ZPZHPXIQ.js.map +1 -0
- package/node_modules/@noodleseed/assistant/dist/{client-7o7n2nqw.d.cts → client-BZ7xPwfW.d.cts} +14 -5
- package/node_modules/@noodleseed/assistant/dist/{client-CysBQBdd.d.ts → client-BkJlpN5N.d.ts} +14 -5
- package/node_modules/@noodleseed/assistant/dist/client.cjs +127 -80
- package/node_modules/@noodleseed/assistant/dist/client.cjs.map +1 -1
- package/node_modules/@noodleseed/assistant/dist/client.d.cts +1 -1
- package/node_modules/@noodleseed/assistant/dist/client.d.ts +1 -1
- package/node_modules/@noodleseed/assistant/dist/client.js +1 -1
- package/node_modules/@noodleseed/assistant/dist/embed.global.js +65 -65
- package/node_modules/@noodleseed/assistant/dist/index.cjs +186 -111
- package/node_modules/@noodleseed/assistant/dist/index.cjs.map +1 -1
- package/node_modules/@noodleseed/assistant/dist/index.d.cts +2 -2
- package/node_modules/@noodleseed/assistant/dist/index.d.ts +2 -2
- package/node_modules/@noodleseed/assistant/dist/index.js +2 -2
- package/node_modules/@noodleseed/assistant/dist/react/client.cjs +127 -80
- package/node_modules/@noodleseed/assistant/dist/react/client.cjs.map +1 -1
- package/node_modules/@noodleseed/assistant/dist/react/client.d.cts +1 -1
- package/node_modules/@noodleseed/assistant/dist/react/client.d.ts +1 -1
- package/node_modules/@noodleseed/assistant/dist/react/client.js +1 -1
- package/node_modules/@noodleseed/assistant/dist/react.cjs +187 -111
- package/node_modules/@noodleseed/assistant/dist/react.cjs.map +1 -1
- package/node_modules/@noodleseed/assistant/dist/react.d.cts +8 -1
- package/node_modules/@noodleseed/assistant/dist/react.d.ts +8 -1
- package/node_modules/@noodleseed/assistant/dist/react.js +3 -2
- package/node_modules/@noodleseed/assistant/dist/react.js.map +1 -1
- package/node_modules/@noodleseed/assistant/dist/server.cjs +1 -0
- package/node_modules/@noodleseed/assistant/dist/server.cjs.map +1 -1
- package/node_modules/@noodleseed/assistant/dist/server.d.cts +15 -0
- package/node_modules/@noodleseed/assistant/dist/server.d.ts +15 -0
- package/node_modules/@noodleseed/assistant/dist/server.js +1 -0
- package/node_modules/@noodleseed/assistant/dist/server.js.map +1 -1
- package/node_modules/@noodleseed/assistant/package.json +1 -1
- package/package.json +3 -2
- package/node_modules/@noodle-borg/service/dist/store/request-event-buffer.d.ts.map +0 -1
- package/node_modules/@noodle-borg/service/dist/store/request-event-buffer.js.map +0 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.d.ts.map +0 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.js.map +0 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events.d.ts.map +0 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events.js.map +0 -1
- package/node_modules/@noodleseed/assistant/dist/chunk-52XT7BLR.js.map +0 -1
- /package/node_modules/@noodle-borg/{service/dist/store → observability/dist}/request-event-buffer.d.ts +0 -0
- /package/node_modules/@noodle-borg/{service/dist/store → observability/dist}/request-event-buffer.js +0 -0
- /package/node_modules/@noodle-borg/{service/dist/store → observability/dist}/request-events-postgres.d.ts +0 -0
- /package/node_modules/@noodle-borg/{service/dist/store → observability/dist}/request-events-postgres.js +0 -0
- /package/node_modules/@noodle-borg/{service/dist/store → observability/dist}/request-events.d.ts +0 -0
- /package/node_modules/@noodle-borg/{service/dist/store → observability/dist}/request-events.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement, RefAttributes } from 'react';
|
|
2
2
|
import { a as AssistantThemeMode } from './appearance-Cc-eqSbp.cjs';
|
|
3
3
|
import { AssistantAppearance, AssistantAppearanceWarning, NoodleAssistantElement } from './index.cjs';
|
|
4
|
-
import { c as AssistantClient, d as AssistantViewAvailableDetail, A as AssistantPageContext, a as AssistantContext, e as AssistantModelContextUpdate, f as AssistantClientEvent, g as AssistantErrorDetail } from './client-
|
|
4
|
+
import { c as AssistantClient, d as AssistantViewAvailableDetail, A as AssistantPageContext, a as AssistantContext, e as AssistantModelContextUpdate, f as AssistantClientEvent, g as AssistantErrorDetail } from './client-BZ7xPwfW.cjs';
|
|
5
5
|
import 'ai';
|
|
6
6
|
|
|
7
7
|
interface NoodleAppViewProps {
|
|
@@ -37,6 +37,13 @@ interface NoodleAssistantProps<TPageContext extends AssistantPageContext = Assis
|
|
|
37
37
|
readonly pageContext?: TPageContext;
|
|
38
38
|
readonly modelContext?: AssistantModelContextUpdate;
|
|
39
39
|
readonly onEvent?: (event: AssistantClientEvent) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Fires at most once per component instance, when the element's shadow DOM is rendered and its
|
|
42
|
+
* imperative API (`sendMessage`, `confirmTool`, …) is callable — NOT when a session exists (listen
|
|
43
|
+
* for the `session_started` client event via `onEvent` for that). It fires whether the element
|
|
44
|
+
* upgraded before or after this component mounted, and the first callback identity wins: a later
|
|
45
|
+
* re-render with a different `onReady` is never invoked.
|
|
46
|
+
*/
|
|
40
47
|
readonly onReady?: () => void;
|
|
41
48
|
readonly onError?: (error: AssistantErrorDetail) => void;
|
|
42
49
|
readonly onAppearanceWarning?: (warning: AssistantAppearanceWarning) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement, RefAttributes } from 'react';
|
|
2
2
|
import { a as AssistantThemeMode } from './appearance-Cc-eqSbp.js';
|
|
3
3
|
import { AssistantAppearance, AssistantAppearanceWarning, NoodleAssistantElement } from './index.js';
|
|
4
|
-
import { c as AssistantClient, d as AssistantViewAvailableDetail, A as AssistantPageContext, a as AssistantContext, e as AssistantModelContextUpdate, f as AssistantClientEvent, g as AssistantErrorDetail } from './client-
|
|
4
|
+
import { c as AssistantClient, d as AssistantViewAvailableDetail, A as AssistantPageContext, a as AssistantContext, e as AssistantModelContextUpdate, f as AssistantClientEvent, g as AssistantErrorDetail } from './client-BkJlpN5N.js';
|
|
5
5
|
import 'ai';
|
|
6
6
|
|
|
7
7
|
interface NoodleAppViewProps {
|
|
@@ -37,6 +37,13 @@ interface NoodleAssistantProps<TPageContext extends AssistantPageContext = Assis
|
|
|
37
37
|
readonly pageContext?: TPageContext;
|
|
38
38
|
readonly modelContext?: AssistantModelContextUpdate;
|
|
39
39
|
readonly onEvent?: (event: AssistantClientEvent) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Fires at most once per component instance, when the element's shadow DOM is rendered and its
|
|
42
|
+
* imperative API (`sendMessage`, `confirmTool`, …) is callable — NOT when a session exists (listen
|
|
43
|
+
* for the `session_started` client event via `onEvent` for that). It fires whether the element
|
|
44
|
+
* upgraded before or after this component mounted, and the first callback identity wins: a later
|
|
45
|
+
* re-render with a different `onReady` is never invoked.
|
|
46
|
+
*/
|
|
40
47
|
readonly onReady?: () => void;
|
|
41
48
|
readonly onError?: (error: AssistantErrorDetail) => void;
|
|
42
49
|
readonly onAppearanceWarning?: (warning: AssistantAppearanceWarning) => void;
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
registerNoodleAssistant,
|
|
4
4
|
unmountAssistantApp,
|
|
5
5
|
updateAssistantAppTheme
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-LEKEIHJV.js";
|
|
7
|
+
import "./chunk-ZPZHPXIQ.js";
|
|
8
8
|
import "./chunk-3YYTUJPJ.js";
|
|
9
9
|
import "./chunk-5FUTL2UF.js";
|
|
10
10
|
|
|
@@ -79,6 +79,7 @@ var NoodleAssistantWithRef = forwardRef(
|
|
|
79
79
|
const ready = () => {
|
|
80
80
|
if (readyNotified.current) return;
|
|
81
81
|
readyNotified.current = true;
|
|
82
|
+
console.debug("[noodle-assistant] ready");
|
|
82
83
|
props.onReady?.();
|
|
83
84
|
};
|
|
84
85
|
const error = (event) => props.onError?.(event.detail);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react.ts","../src/react-app-view.ts"],"sourcesContent":["import {\n createElement,\n forwardRef,\n type ReactElement,\n type RefAttributes,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport type { AssistantThemeMode } from './appearance.js';\nimport type { AssistantAppearance, AssistantAppearanceWarning } from './host-appearance.js';\n\nexport type { AssistantAppearance, AssistantAppearanceWarning } from './host-appearance.js';\n\nimport type {\n AssistantClientEvent,\n AssistantContext,\n AssistantModelContextUpdate,\n AssistantPageContext,\n} from './client.js';\nimport { type NoodleAssistantElement, registerNoodleAssistant } from './element.js';\nimport type { AssistantErrorDetail } from './transport.js';\n\nexport { NoodleAppView, type NoodleAppViewProps } from './react-app-view.js';\n\nexport interface NoodleAssistantProps<\n TPageContext extends AssistantPageContext = AssistantContext,\n> {\n /** In-app mount: the customer backend route that exchanges an embed secret for a session. */\n readonly sessionEndpoint?: string;\n /** Public mount: the non-secret embed id `noodle deploy` printed. Exclusive with `sessionEndpoint`. */\n readonly embedId?: string;\n /** Only for a dev or self-hosted service; a published page needs no origin. */\n readonly serviceUrl?: string;\n readonly theme?: AssistantThemeMode;\n readonly appearance?: AssistantAppearance;\n readonly open?: boolean;\n readonly className?: string;\n readonly context?: AssistantContext;\n readonly pageContext?: TPageContext;\n readonly modelContext?: AssistantModelContextUpdate;\n readonly onEvent?: (event: AssistantClientEvent) => void;\n readonly onReady?: () => void;\n readonly onError?: (error: AssistantErrorDetail) => void;\n readonly onAppearanceWarning?: (warning: AssistantAppearanceWarning) => void;\n readonly onSessionExpired?: () => void;\n}\n\nconst NoodleAssistantWithRef = forwardRef<NoodleAssistantElement, NoodleAssistantProps>(\n function NoodleAssistant(props, forwardedRef): ReactElement {\n const ref = useRef<NoodleAssistantElement>(null);\n const readyNotified = useRef(false);\n useImperativeHandle(forwardedRef, () => ref.current as NoodleAssistantElement, []);\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n const ready = () => {\n if (readyNotified.current) return;\n readyNotified.current = true;\n props.onReady?.();\n };\n const error = (event: Event) =>\n props.onError?.((event as CustomEvent<AssistantErrorDetail>).detail);\n const expired = () => props.onSessionExpired?.();\n const assistantEvent = (event: Event) =>\n props.onEvent?.((event as CustomEvent<AssistantClientEvent>).detail);\n const appearanceWarning = (event: Event) =>\n props.onAppearanceWarning?.((event as CustomEvent<AssistantAppearanceWarning>).detail);\n element.addEventListener('assistant-ready', ready);\n element.addEventListener('assistant-error', error);\n element.addEventListener('assistant-session-expired', expired);\n element.addEventListener('assistant-event', assistantEvent);\n element.addEventListener('assistant-appearance-warning', appearanceWarning);\n registerNoodleAssistant();\n element.sessionEndpoint = props.sessionEndpoint ?? '';\n element.embedId = props.embedId ?? '';\n element.serviceUrl = props.serviceUrl ?? '';\n element.appearance = props.appearance;\n element.toggleAttribute('open', props.open === true);\n if (props.context) element.updateContext(props.context);\n if (props.pageContext) element.updatePageContext(props.pageContext);\n if (props.modelContext) element.updateModelContext(props.modelContext);\n // The canonical entry may have registered and upgraded the element before this effect ran.\n // Readiness is sticky once the shadow root exists, so late React listeners still fire once.\n if (element.shadowRoot) ready();\n return () => {\n element.removeEventListener('assistant-ready', ready);\n element.removeEventListener('assistant-error', error);\n element.removeEventListener('assistant-session-expired', expired);\n element.removeEventListener('assistant-event', assistantEvent);\n element.removeEventListener('assistant-appearance-warning', appearanceWarning);\n };\n }, [\n props.context,\n props.appearance,\n props.modelContext,\n props.onError,\n props.onAppearanceWarning,\n props.onEvent,\n props.onReady,\n props.onSessionExpired,\n props.open,\n props.pageContext,\n props.sessionEndpoint,\n props.embedId,\n props.serviceUrl,\n ]);\n return createElement('noodle-assistant', {\n ref,\n class: props.className,\n ...(props.sessionEndpoint ? { 'session-endpoint': props.sessionEndpoint } : {}),\n ...(props.embedId ? { 'embed-id': props.embedId } : {}),\n ...(props.serviceUrl ? { 'service-url': props.serviceUrl } : {}),\n ...(props.theme ? { theme: props.theme } : {}),\n });\n },\n);\n\nexport const NoodleAssistant = NoodleAssistantWithRef as <\n TPageContext extends AssistantPageContext = AssistantContext,\n>(\n props: NoodleAssistantProps<TPageContext> & RefAttributes<NoodleAssistantElement>,\n) => ReactElement;\n","import { createElement, type ReactElement, useEffect, useRef } from 'react';\nimport { mountAssistantApp, unmountAssistantApp, updateAssistantAppTheme } from './app-host.js';\nimport type { AssistantClient, AssistantViewAvailableDetail } from './client.js';\n\nexport interface NoodleAppViewProps {\n readonly client: AssistantClient;\n readonly view: AssistantViewAvailableDetail;\n readonly theme?: 'light' | 'dark';\n readonly className?: string;\n readonly onError?: (failure: {\n readonly code: 'view_render_timeout';\n readonly retryable: false;\n }) => void;\n}\n\n/**\n * Securely hosts one service-resolved MCP App inside a customer-owned React renderer.\n *\n * The bridge lifetime follows semantic view identity, so ordinary parent rerenders cannot reset an\n * in-progress App interaction.\n */\nexport function NoodleAppView({\n client,\n view,\n theme = 'light',\n className,\n onError,\n}: NoodleAppViewProps): ReactElement {\n const container = useRef<HTMLDivElement>(null);\n const mounted = useRef<HTMLElement>(null);\n const current = useRef({ view, theme, onError });\n const viewId = view.id;\n const resourceUri = view.resourceUri;\n\n useEffect(() => {\n current.current = { view, theme, onError };\n });\n\n useEffect(() => {\n const host = container.current;\n if (!host) return;\n const initialView = { ...current.current.view, id: viewId, resourceUri };\n const sandboxUrl = client.appSandboxUrl?.();\n const card = mountAssistantApp(\n initialView,\n {\n client,\n sendMessage: (message) => client.sendMessage(message),\n updateModelContext: (update) => client.updateModelContext(update),\n theme: current.current.theme,\n },\n {\n ...(sandboxUrl ? { sandboxUrl } : {}),\n getDetail: () => current.current.view,\n onRenderFailure: (failure) => current.current.onError?.(failure),\n },\n );\n if (!card) return;\n mounted.current = card;\n host.replaceChildren(card);\n return () => {\n if (mounted.current === card) mounted.current = null;\n void unmountAssistantApp(card);\n };\n }, [client, resourceUri, viewId]);\n\n useEffect(() => {\n if (mounted.current) updateAssistantAppTheme(mounted.current, theme);\n }, [theme]);\n\n return createElement('div', { ref: container, className });\n}\n"],"mappings":";;;;;;;;;;;AAAA;AAAA,EACE,iBAAAA;AAAA,EACA;AAAA,EAGA,aAAAC;AAAA,EACA;AAAA,EACA,UAAAC;AAAA,OACK;;;ACRP,SAAS,eAAkC,WAAW,cAAc;AAqB7D,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AACF,GAAqC;AACnC,QAA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,gBAAQ,oBAAoB,gCAAgC,iBAAiB;AAAA,MAC/E;AAAA,IACF,GAAG;AAAA,MACD,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR,CAAC;AACD,WAAOC,eAAc,oBAAoB;AAAA,MACvC;AAAA,MACA,OAAO,MAAM;AAAA,MACb,GAAI,MAAM,kBAAkB,EAAE,oBAAoB,MAAM,gBAAgB,IAAI,CAAC;AAAA,MAC7E,GAAI,MAAM,UAAU,EAAE,YAAY,MAAM,QAAQ,IAAI,CAAC;AAAA,MACrD,GAAI,MAAM,aAAa,EAAE,eAAe,MAAM,WAAW,IAAI,CAAC;AAAA,MAC9D,GAAI,MAAM,QAAQ,EAAE,OAAO,MAAM,MAAM,IAAI,CAAC;AAAA,IAC9C,CAAC;AAAA,EACH;AACF;AAEO,IAAMC,mBAAkB;","names":["createElement","useEffect","useRef","useRef","useEffect","createElement","NoodleAssistant"]}
|
|
1
|
+
{"version":3,"sources":["../src/react.ts","../src/react-app-view.ts"],"sourcesContent":["import {\n createElement,\n forwardRef,\n type ReactElement,\n type RefAttributes,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport type { AssistantThemeMode } from './appearance.js';\nimport type { AssistantAppearance, AssistantAppearanceWarning } from './host-appearance.js';\n\nexport type { AssistantAppearance, AssistantAppearanceWarning } from './host-appearance.js';\n\nimport type {\n AssistantClientEvent,\n AssistantContext,\n AssistantModelContextUpdate,\n AssistantPageContext,\n} from './client.js';\nimport { type NoodleAssistantElement, registerNoodleAssistant } from './element.js';\nimport type { AssistantErrorDetail } from './transport.js';\n\nexport { NoodleAppView, type NoodleAppViewProps } from './react-app-view.js';\n\nexport interface NoodleAssistantProps<\n TPageContext extends AssistantPageContext = AssistantContext,\n> {\n /** In-app mount: the customer backend route that exchanges an embed secret for a session. */\n readonly sessionEndpoint?: string;\n /** Public mount: the non-secret embed id `noodle deploy` printed. Exclusive with `sessionEndpoint`. */\n readonly embedId?: string;\n /** Only for a dev or self-hosted service; a published page needs no origin. */\n readonly serviceUrl?: string;\n readonly theme?: AssistantThemeMode;\n readonly appearance?: AssistantAppearance;\n readonly open?: boolean;\n readonly className?: string;\n readonly context?: AssistantContext;\n readonly pageContext?: TPageContext;\n readonly modelContext?: AssistantModelContextUpdate;\n readonly onEvent?: (event: AssistantClientEvent) => void;\n /**\n * Fires at most once per component instance, when the element's shadow DOM is rendered and its\n * imperative API (`sendMessage`, `confirmTool`, …) is callable — NOT when a session exists (listen\n * for the `session_started` client event via `onEvent` for that). It fires whether the element\n * upgraded before or after this component mounted, and the first callback identity wins: a later\n * re-render with a different `onReady` is never invoked.\n */\n readonly onReady?: () => void;\n readonly onError?: (error: AssistantErrorDetail) => void;\n readonly onAppearanceWarning?: (warning: AssistantAppearanceWarning) => void;\n readonly onSessionExpired?: () => void;\n}\n\nconst NoodleAssistantWithRef = forwardRef<NoodleAssistantElement, NoodleAssistantProps>(\n function NoodleAssistant(props, forwardedRef): ReactElement {\n const ref = useRef<NoodleAssistantElement>(null);\n const readyNotified = useRef(false);\n useImperativeHandle(forwardedRef, () => ref.current as NoodleAssistantElement, []);\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n const ready = () => {\n if (readyNotified.current) return;\n readyNotified.current = true;\n // The one observable breadcrumb for the readiness path: integrators could previously\n // neither convict nor exonerate this callback for a field failure.\n console.debug('[noodle-assistant] ready');\n props.onReady?.();\n };\n const error = (event: Event) =>\n props.onError?.((event as CustomEvent<AssistantErrorDetail>).detail);\n const expired = () => props.onSessionExpired?.();\n const assistantEvent = (event: Event) =>\n props.onEvent?.((event as CustomEvent<AssistantClientEvent>).detail);\n const appearanceWarning = (event: Event) =>\n props.onAppearanceWarning?.((event as CustomEvent<AssistantAppearanceWarning>).detail);\n element.addEventListener('assistant-ready', ready);\n element.addEventListener('assistant-error', error);\n element.addEventListener('assistant-session-expired', expired);\n element.addEventListener('assistant-event', assistantEvent);\n element.addEventListener('assistant-appearance-warning', appearanceWarning);\n registerNoodleAssistant();\n element.sessionEndpoint = props.sessionEndpoint ?? '';\n element.embedId = props.embedId ?? '';\n element.serviceUrl = props.serviceUrl ?? '';\n element.appearance = props.appearance;\n element.toggleAttribute('open', props.open === true);\n if (props.context) element.updateContext(props.context);\n if (props.pageContext) element.updatePageContext(props.pageContext);\n if (props.modelContext) element.updateModelContext(props.modelContext);\n // The canonical entry may have registered and upgraded the element before this effect ran.\n // Readiness is sticky once the shadow root exists, so late React listeners still fire once.\n if (element.shadowRoot) ready();\n return () => {\n element.removeEventListener('assistant-ready', ready);\n element.removeEventListener('assistant-error', error);\n element.removeEventListener('assistant-session-expired', expired);\n element.removeEventListener('assistant-event', assistantEvent);\n element.removeEventListener('assistant-appearance-warning', appearanceWarning);\n };\n }, [\n props.context,\n props.appearance,\n props.modelContext,\n props.onError,\n props.onAppearanceWarning,\n props.onEvent,\n props.onReady,\n props.onSessionExpired,\n props.open,\n props.pageContext,\n props.sessionEndpoint,\n props.embedId,\n props.serviceUrl,\n ]);\n return createElement('noodle-assistant', {\n ref,\n class: props.className,\n ...(props.sessionEndpoint ? { 'session-endpoint': props.sessionEndpoint } : {}),\n ...(props.embedId ? { 'embed-id': props.embedId } : {}),\n ...(props.serviceUrl ? { 'service-url': props.serviceUrl } : {}),\n ...(props.theme ? { theme: props.theme } : {}),\n });\n },\n);\n\nexport const NoodleAssistant = NoodleAssistantWithRef as <\n TPageContext extends AssistantPageContext = AssistantContext,\n>(\n props: NoodleAssistantProps<TPageContext> & RefAttributes<NoodleAssistantElement>,\n) => ReactElement;\n","import { createElement, type ReactElement, useEffect, useRef } from 'react';\nimport { mountAssistantApp, unmountAssistantApp, updateAssistantAppTheme } from './app-host.js';\nimport type { AssistantClient, AssistantViewAvailableDetail } from './client.js';\n\nexport interface NoodleAppViewProps {\n readonly client: AssistantClient;\n readonly view: AssistantViewAvailableDetail;\n readonly theme?: 'light' | 'dark';\n readonly className?: string;\n readonly onError?: (failure: {\n readonly code: 'view_render_timeout';\n readonly retryable: false;\n }) => void;\n}\n\n/**\n * Securely hosts one service-resolved MCP App inside a customer-owned React renderer.\n *\n * The bridge lifetime follows semantic view identity, so ordinary parent rerenders cannot reset an\n * in-progress App interaction.\n */\nexport function NoodleAppView({\n client,\n view,\n theme = 'light',\n className,\n onError,\n}: NoodleAppViewProps): ReactElement {\n const container = useRef<HTMLDivElement>(null);\n const mounted = useRef<HTMLElement>(null);\n const current = useRef({ view, theme, onError });\n const viewId = view.id;\n const resourceUri = view.resourceUri;\n\n useEffect(() => {\n current.current = { view, theme, onError };\n });\n\n useEffect(() => {\n const host = container.current;\n if (!host) return;\n const initialView = { ...current.current.view, id: viewId, resourceUri };\n const sandboxUrl = client.appSandboxUrl?.();\n const card = mountAssistantApp(\n initialView,\n {\n client,\n sendMessage: (message) => client.sendMessage(message),\n updateModelContext: (update) => client.updateModelContext(update),\n theme: current.current.theme,\n },\n {\n ...(sandboxUrl ? { sandboxUrl } : {}),\n getDetail: () => current.current.view,\n onRenderFailure: (failure) => current.current.onError?.(failure),\n },\n );\n if (!card) return;\n mounted.current = card;\n host.replaceChildren(card);\n return () => {\n if (mounted.current === card) mounted.current = null;\n void unmountAssistantApp(card);\n };\n }, [client, resourceUri, viewId]);\n\n useEffect(() => {\n if (mounted.current) updateAssistantAppTheme(mounted.current, theme);\n }, [theme]);\n\n return createElement('div', { ref: container, className });\n}\n"],"mappings":";;;;;;;;;;;AAAA;AAAA,EACE,iBAAAA;AAAA,EACA;AAAA,EAGA,aAAAC;AAAA,EACA;AAAA,EACA,UAAAC;AAAA,OACK;;;ACRP,SAAS,eAAkC,WAAW,cAAc;AAqB7D,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAA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,6BAA6B,OAAO;AAChE,gBAAQ,oBAAoB,mBAAmB,cAAc;AAC7D,gBAAQ,oBAAoB,gCAAgC,iBAAiB;AAAA,MAC/E;AAAA,IACF,GAAG;AAAA,MACD,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR,CAAC;AACD,WAAOC,eAAc,oBAAoB;AAAA,MACvC;AAAA,MACA,OAAO,MAAM;AAAA,MACb,GAAI,MAAM,kBAAkB,EAAE,oBAAoB,MAAM,gBAAgB,IAAI,CAAC;AAAA,MAC7E,GAAI,MAAM,UAAU,EAAE,YAAY,MAAM,QAAQ,IAAI,CAAC;AAAA,MACrD,GAAI,MAAM,aAAa,EAAE,eAAe,MAAM,WAAW,IAAI,CAAC;AAAA,MAC9D,GAAI,MAAM,QAAQ,EAAE,OAAO,MAAM,MAAM,IAAI,CAAC;AAAA,IAC9C,CAAC;AAAA,EACH;AACF;AAEO,IAAMC,mBAAkB;","names":["createElement","useEffect","useRef","useRef","useEffect","createElement","NoodleAssistant"]}
|
|
@@ -83,6 +83,7 @@ async function createAssistantSession(input, dependencies = {}) {
|
|
|
83
83
|
origin: input.origin,
|
|
84
84
|
user: input.user,
|
|
85
85
|
...input.signInTicket === void 0 ? {} : { signInTicket: input.signInTicket },
|
|
86
|
+
...input.signInTicket !== void 0 && input.resume !== void 0 ? { resume: input.resume } : {},
|
|
86
87
|
...input.claims ? { claims: input.claims } : {},
|
|
87
88
|
...input.context ? { context: input.context } : {},
|
|
88
89
|
...input.preferences ? { preferences: input.preferences } : {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import type { AssistantConfiguration } from './appearance.js';\n\ninterface AssistantSessionExchangeBase {\n readonly serviceUrl: string;\n readonly clientId: string;\n readonly clientSecret: string;\n /** Browser origin to bind into the short-lived assistant session. */\n readonly origin: string;\n /** The signed-in person your backend vouches for — on both arms: an elevation IS this vouching. */\n readonly user: {\n readonly id: string;\n readonly email?: string;\n readonly name?: string;\n readonly tenant?: string;\n readonly roles?: readonly string[];\n readonly scopes?: readonly string[];\n };\n /** Backend-verified user preferences; these outrank untrusted browser presentation hints. */\n readonly preferences?: {\n readonly locale?: string;\n readonly timeZone?: string;\n };\n /**\n * Verified session claims from your authenticated backend. Only claims the server declares in\n * `embeddedAssistant({ sessionClaims })` reach tools (`\\${user.claims.<key>}`) and, when marked\n * `exposeToModel`, the assistant's identity context. Flat scalars only.\n */\n readonly claims?: Readonly<Record<string, string | number | boolean | null>>;\n}\n\n/**\n * Fresh mint XOR mid-conversation sign-in, exclusive rather than merged for the same reason the\n * client's `sessionEndpoint`/`embedId` pair is: the two are different operations, and the wrong\n * combination should fail to typecheck instead of silently picking a meaning.\n *\n * `context` applies only when a session is being created; an elevation keeps the existing\n * conversation, so it is excluded rather than silently ignored. `routing` is allowed on both arms —\n * elevation is the first authenticated moment, so it is the only chance a routed connector's\n * session ever gets its backend-verified customer routes.\n */\nexport type CreateAssistantSessionInput =\n | (AssistantSessionExchangeBase & {\n readonly signInTicket?: undefined;\n readonly context?: Readonly<Record<string, string | number | boolean | null>>;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n })\n | (AssistantSessionExchangeBase & {\n /**\n * Single-use sign-in ticket from the widget's `assistant-sign-in-requested` event\n * (ADR 0201, 5.6b). Spending it binds this signed-in user to the visitor's existing\n * anonymous conversation instead of minting a new one. Unrelated to the server-held\n * interaction continuation, which never reaches browser code.\n */\n readonly signInTicket: string;\n readonly context?: undefined;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n });\n\nexport interface AssistantSession {\n readonly token: string;\n readonly expiresAt: string;\n readonly endpoints: {\n readonly turns: string;\n readonly toolConfirmations: string;\n readonly interactions?: string;\n readonly apps?: string;\n /** Additive hosted sandbox document for widget frames; absent on older services. */\n readonly sandbox?: string;\n };\n readonly configuration?: AssistantConfiguration;\n}\n\n/** The service's refusal codes for a sign-in ticket the exchange would not honour. */\nexport const ASSISTANT_ELEVATION_REFUSAL_CODES = [\n 'elevation_ticket_invalid',\n 'elevation_ticket_expired',\n 'elevation_tenant_mismatch',\n 'elevation_session_unavailable',\n 'elevation_already_signed_in',\n] as const;\nexport type AssistantElevationRefusalCode = (typeof ASSISTANT_ELEVATION_REFUSAL_CODES)[number];\n\n/**\n * Structurally mirrors the browser client's `AssistantErrorDetail` (declared locally: the backend\n * entry must not pull the browser transport module into its graph). `code` is a closed union owned\n * by this package; `serviceCode` passes the service's machine code through additively.\n */\nexport interface AssistantSessionExchangeErrorDetail {\n readonly code: 'session_exchange_failed';\n readonly status: number;\n /** 5xx infrastructure failures may be retried; a refused exchange must not be — tickets are single-use. */\n readonly retryable: boolean;\n /** The service's machine code when the body carried one, e.g. `elevation_ticket_expired`. */\n readonly serviceCode?: string;\n}\n\nexport class AssistantSessionExchangeError extends Error {\n readonly detail: AssistantSessionExchangeErrorDetail;\n\n constructor(detail: AssistantSessionExchangeErrorDetail, message: string) {\n super(message);\n this.name = 'AssistantSessionExchangeError';\n this.detail = detail;\n }\n\n /**\n * The narrowed sign-in refusal, when this failure is one. `elevation_ticket_expired` means the\n * visitor took too long — re-prompt; `elevation_tenant_mismatch` means a client reached for a\n * conversation it does not own — alert someone, never retry.\n */\n get elevationRefusal(): AssistantElevationRefusalCode | undefined {\n const code = this.detail.serviceCode;\n return code !== undefined &&\n (ASSISTANT_ELEVATION_REFUSAL_CODES as readonly string[]).includes(code)\n ? (code as AssistantElevationRefusalCode)\n : undefined;\n }\n}\n\n/** Never throws while reading the body — a proxy can answer with HTML instead of JSON. */\nasync function exchangeError(response: Response): Promise<AssistantSessionExchangeError> {\n const body = (await response.json().catch(() => undefined)) as\n | { readonly error?: unknown; readonly code?: unknown }\n | undefined;\n const serviceCode = typeof body?.code === 'string' ? body.code : undefined;\n return new AssistantSessionExchangeError(\n {\n code: 'session_exchange_failed',\n status: response.status,\n // `elevation_unavailable` is a 503 an operator has to fix; retrying cannot help.\n retryable: response.status >= 500 && serviceCode !== 'elevation_unavailable',\n ...(serviceCode === undefined ? {} : { serviceCode }),\n },\n `Assistant session exchange failed (${response.status})`,\n );\n}\n\nexport async function createAssistantSession(\n input: CreateAssistantSessionInput,\n dependencies: { readonly fetch?: typeof fetch } = {},\n): Promise<AssistantSession> {\n if (input.signInTicket !== undefined && (input as { context?: unknown }).context !== undefined) {\n // Mirrors resolveSessionSource: silently dropping what the service ignores would pick a\n // meaning the developer did not intend.\n throw new Error('context does not apply when spending a sign-in ticket');\n }\n const request = dependencies.fetch ?? fetch;\n const serviceUrl = input.serviceUrl.replace(/\\/$/, '');\n const credentials = Buffer.from(`${input.clientId}:${input.clientSecret}`, 'utf8').toString(\n 'base64',\n );\n const response = await request(`${serviceUrl}/v1/assistant/sessions`, {\n method: 'POST',\n headers: {\n Authorization: `Basic ${credentials}`,\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n origin: input.origin,\n user: input.user,\n ...(input.signInTicket === undefined ? {} : { signInTicket: input.signInTicket }),\n ...(input.claims ? { claims: input.claims } : {}),\n ...(input.context ? { context: input.context } : {}),\n ...(input.preferences ? { preferences: input.preferences } : {}),\n ...(input.routing ? { routing: input.routing } : {}),\n }),\n });\n // A fresh mint answers 201, an elevation 200; both are the same wire shape (ADR 0151).\n if (!response.ok) throw await exchangeError(response);\n return (await response.json()) as AssistantSession;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+EO,IAAM,oCAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA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AAAA,MACnB,QAAQ,MAAM;AAAA,MACd,MAAM,MAAM;AAAA,MACZ,GAAI,MAAM,iBAAiB,SAAY,CAAC,IAAI,EAAE,cAAc,MAAM,aAAa;AAAA,MAC/E,GAAI,MAAM,SAAS,EAAE,QAAQ,MAAM,OAAO,IAAI,CAAC;AAAA,MAC/C,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,MAClD,GAAI,MAAM,cAAc,EAAE,aAAa,MAAM,YAAY,IAAI,CAAC;AAAA,MAC9D,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,IACpD,CAAC;AAAA,EACH,CAAC;AAED,MAAI,CAAC,SAAS,GAAI,OAAM,MAAM,cAAc,QAAQ;AACpD,SAAQ,MAAM,SAAS,KAAK;AAC9B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import type { AssistantConfiguration } from './appearance.js';\n\ninterface AssistantSessionExchangeBase {\n readonly serviceUrl: string;\n readonly clientId: string;\n readonly clientSecret: string;\n /** Browser origin to bind into the short-lived assistant session. */\n readonly origin: string;\n /** The signed-in person your backend vouches for — on both arms: an elevation IS this vouching. */\n readonly user: {\n readonly id: string;\n readonly email?: string;\n readonly name?: string;\n readonly tenant?: string;\n readonly roles?: readonly string[];\n readonly scopes?: readonly string[];\n };\n /** Backend-verified user preferences; these outrank untrusted browser presentation hints. */\n readonly preferences?: {\n readonly locale?: string;\n readonly timeZone?: string;\n };\n /**\n * Verified session claims from your authenticated backend. Only claims the server declares in\n * `embeddedAssistant({ sessionClaims })` reach tools (`\\${user.claims.<key>}`) and, when marked\n * `exposeToModel`, the assistant's identity context. Flat scalars only.\n */\n readonly claims?: Readonly<Record<string, string | number | boolean | null>>;\n}\n\n/**\n * Fresh mint XOR mid-conversation sign-in, exclusive rather than merged for the same reason the\n * client's `sessionEndpoint`/`embedId` pair is: the two are different operations, and the wrong\n * combination should fail to typecheck instead of silently picking a meaning.\n *\n * `context` applies only when a session is being created; an elevation keeps the existing\n * conversation, so it is excluded rather than silently ignored. `routing` is allowed on both arms —\n * elevation is the first authenticated moment, so it is the only chance a routed connector's\n * session ever gets its backend-verified customer routes.\n */\nexport type CreateAssistantSessionInput =\n | (AssistantSessionExchangeBase & {\n readonly signInTicket?: undefined;\n readonly context?: Readonly<Record<string, string | number | boolean | null>>;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n /** Resume applies only when spending a sign-in ticket; a fresh mint has nothing pending. */\n readonly resume?: undefined;\n })\n | (AssistantSessionExchangeBase & {\n /**\n * Single-use sign-in ticket from the widget's `assistant-sign-in-requested` event\n * (ADR 0201, 5.6b). Spending it binds this signed-in user to the visitor's existing\n * anonymous conversation instead of minting a new one. Unrelated to the server-held\n * interaction continuation, which never reaches browser code.\n */\n readonly signInTicket: string;\n readonly context?: undefined;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n /**\n * Whether the service resumes the intercepted tool call as the elevated session's first\n * turn (issue #1177). ON by default — omit it and the visitor's pending question answers\n * itself after sign-in; pass `false` if your application provides its own affordance.\n */\n readonly resume?: boolean;\n });\n\nexport interface AssistantSession {\n readonly token: string;\n readonly expiresAt: string;\n readonly endpoints: {\n readonly turns: string;\n readonly toolConfirmations: string;\n readonly interactions?: string;\n readonly apps?: string;\n /** Additive hosted sandbox document for widget frames; absent on older services. */\n readonly sandbox?: string;\n };\n /**\n * Present only on an elevation that armed the one-shot resume of the intercepted tool. Forward\n * the response body unchanged and the widget answers with one automatic turn.\n */\n readonly resume?: { readonly tool: string };\n readonly configuration?: AssistantConfiguration;\n}\n\n/** The service's refusal codes for a sign-in ticket the exchange would not honour. */\nexport const ASSISTANT_ELEVATION_REFUSAL_CODES = [\n 'elevation_ticket_invalid',\n 'elevation_ticket_expired',\n 'elevation_tenant_mismatch',\n 'elevation_session_unavailable',\n 'elevation_already_signed_in',\n] as const;\nexport type AssistantElevationRefusalCode = (typeof ASSISTANT_ELEVATION_REFUSAL_CODES)[number];\n\n/**\n * Structurally mirrors the browser client's `AssistantErrorDetail` (declared locally: the backend\n * entry must not pull the browser transport module into its graph). `code` is a closed union owned\n * by this package; `serviceCode` passes the service's machine code through additively.\n */\nexport interface AssistantSessionExchangeErrorDetail {\n readonly code: 'session_exchange_failed';\n readonly status: number;\n /** 5xx infrastructure failures may be retried; a refused exchange must not be — tickets are single-use. */\n readonly retryable: boolean;\n /** The service's machine code when the body carried one, e.g. `elevation_ticket_expired`. */\n readonly serviceCode?: string;\n}\n\nexport class AssistantSessionExchangeError extends Error {\n readonly detail: AssistantSessionExchangeErrorDetail;\n\n constructor(detail: AssistantSessionExchangeErrorDetail, message: string) {\n super(message);\n this.name = 'AssistantSessionExchangeError';\n this.detail = detail;\n }\n\n /**\n * The narrowed sign-in refusal, when this failure is one. `elevation_ticket_expired` means the\n * visitor took too long — re-prompt; `elevation_tenant_mismatch` means a client reached for a\n * conversation it does not own — alert someone, never retry.\n */\n get elevationRefusal(): AssistantElevationRefusalCode | undefined {\n const code = this.detail.serviceCode;\n return code !== undefined &&\n (ASSISTANT_ELEVATION_REFUSAL_CODES as readonly string[]).includes(code)\n ? (code as AssistantElevationRefusalCode)\n : undefined;\n }\n}\n\n/** Never throws while reading the body — a proxy can answer with HTML instead of JSON. */\nasync function exchangeError(response: Response): Promise<AssistantSessionExchangeError> {\n const body = (await response.json().catch(() => undefined)) as\n | { readonly error?: unknown; readonly code?: unknown }\n | undefined;\n const serviceCode = typeof body?.code === 'string' ? body.code : undefined;\n return new AssistantSessionExchangeError(\n {\n code: 'session_exchange_failed',\n status: response.status,\n // `elevation_unavailable` is a 503 an operator has to fix; retrying cannot help.\n retryable: response.status >= 500 && serviceCode !== 'elevation_unavailable',\n ...(serviceCode === undefined ? {} : { serviceCode }),\n },\n `Assistant session exchange failed (${response.status})`,\n );\n}\n\nexport async function createAssistantSession(\n input: CreateAssistantSessionInput,\n dependencies: { readonly fetch?: typeof fetch } = {},\n): Promise<AssistantSession> {\n if (input.signInTicket !== undefined && (input as { context?: unknown }).context !== undefined) {\n // Mirrors resolveSessionSource: silently dropping what the service ignores would pick a\n // meaning the developer did not intend.\n throw new Error('context does not apply when spending a sign-in ticket');\n }\n const request = dependencies.fetch ?? fetch;\n const serviceUrl = input.serviceUrl.replace(/\\/$/, '');\n const credentials = Buffer.from(`${input.clientId}:${input.clientSecret}`, 'utf8').toString(\n 'base64',\n );\n const response = await request(`${serviceUrl}/v1/assistant/sessions`, {\n method: 'POST',\n headers: {\n Authorization: `Basic ${credentials}`,\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n origin: input.origin,\n user: input.user,\n ...(input.signInTicket === undefined ? {} : { signInTicket: input.signInTicket }),\n ...(input.signInTicket !== undefined && input.resume !== undefined\n ? { resume: input.resume }\n : {}),\n ...(input.claims ? { claims: input.claims } : {}),\n ...(input.context ? { context: input.context } : {}),\n ...(input.preferences ? { preferences: input.preferences } : {}),\n ...(input.routing ? { routing: input.routing } : {}),\n }),\n });\n // A fresh mint answers 201, an elevation 200; both are the same wire shape (ADR 0151).\n if (!response.ok) throw await exchangeError(response);\n return (await response.json()) as AssistantSession;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4FO,IAAM,oCAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAiBO,IAAM,gCAAN,cAA4C,MAAM;AAAA,EAC9C;AAAA,EAET,YAAY,QAA6C,SAAiB;AACxE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,mBAA8D;AAChE,UAAM,OAAO,KAAK,OAAO;AACzB,WAAO,SAA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AAI,CAAC;AAAA,MAC/C,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,MAClD,GAAI,MAAM,cAAc,EAAE,aAAa,MAAM,YAAY,IAAI,CAAC;AAAA,MAC9D,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,IACpD,CAAC;AAAA,EACH,CAAC;AAED,MAAI,CAAC,SAAS,GAAI,OAAM,MAAM,cAAc,QAAQ;AACpD,SAAQ,MAAM,SAAS,KAAK;AAC9B;","names":[]}
|
|
@@ -44,6 +44,8 @@ type CreateAssistantSessionInput = (AssistantSessionExchangeBase & {
|
|
|
44
44
|
readonly routing?: {
|
|
45
45
|
readonly endpoints: Readonly<Record<string, string>>;
|
|
46
46
|
};
|
|
47
|
+
/** Resume applies only when spending a sign-in ticket; a fresh mint has nothing pending. */
|
|
48
|
+
readonly resume?: undefined;
|
|
47
49
|
}) | (AssistantSessionExchangeBase & {
|
|
48
50
|
/**
|
|
49
51
|
* Single-use sign-in ticket from the widget's `assistant-sign-in-requested` event
|
|
@@ -57,6 +59,12 @@ type CreateAssistantSessionInput = (AssistantSessionExchangeBase & {
|
|
|
57
59
|
readonly routing?: {
|
|
58
60
|
readonly endpoints: Readonly<Record<string, string>>;
|
|
59
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Whether the service resumes the intercepted tool call as the elevated session's first
|
|
64
|
+
* turn (issue #1177). ON by default — omit it and the visitor's pending question answers
|
|
65
|
+
* itself after sign-in; pass `false` if your application provides its own affordance.
|
|
66
|
+
*/
|
|
67
|
+
readonly resume?: boolean;
|
|
60
68
|
});
|
|
61
69
|
interface AssistantSession {
|
|
62
70
|
readonly token: string;
|
|
@@ -69,6 +77,13 @@ interface AssistantSession {
|
|
|
69
77
|
/** Additive hosted sandbox document for widget frames; absent on older services. */
|
|
70
78
|
readonly sandbox?: string;
|
|
71
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* Present only on an elevation that armed the one-shot resume of the intercepted tool. Forward
|
|
82
|
+
* the response body unchanged and the widget answers with one automatic turn.
|
|
83
|
+
*/
|
|
84
|
+
readonly resume?: {
|
|
85
|
+
readonly tool: string;
|
|
86
|
+
};
|
|
72
87
|
readonly configuration?: AssistantConfiguration;
|
|
73
88
|
}
|
|
74
89
|
/** The service's refusal codes for a sign-in ticket the exchange would not honour. */
|
|
@@ -44,6 +44,8 @@ type CreateAssistantSessionInput = (AssistantSessionExchangeBase & {
|
|
|
44
44
|
readonly routing?: {
|
|
45
45
|
readonly endpoints: Readonly<Record<string, string>>;
|
|
46
46
|
};
|
|
47
|
+
/** Resume applies only when spending a sign-in ticket; a fresh mint has nothing pending. */
|
|
48
|
+
readonly resume?: undefined;
|
|
47
49
|
}) | (AssistantSessionExchangeBase & {
|
|
48
50
|
/**
|
|
49
51
|
* Single-use sign-in ticket from the widget's `assistant-sign-in-requested` event
|
|
@@ -57,6 +59,12 @@ type CreateAssistantSessionInput = (AssistantSessionExchangeBase & {
|
|
|
57
59
|
readonly routing?: {
|
|
58
60
|
readonly endpoints: Readonly<Record<string, string>>;
|
|
59
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Whether the service resumes the intercepted tool call as the elevated session's first
|
|
64
|
+
* turn (issue #1177). ON by default — omit it and the visitor's pending question answers
|
|
65
|
+
* itself after sign-in; pass `false` if your application provides its own affordance.
|
|
66
|
+
*/
|
|
67
|
+
readonly resume?: boolean;
|
|
60
68
|
});
|
|
61
69
|
interface AssistantSession {
|
|
62
70
|
readonly token: string;
|
|
@@ -69,6 +77,13 @@ interface AssistantSession {
|
|
|
69
77
|
/** Additive hosted sandbox document for widget frames; absent on older services. */
|
|
70
78
|
readonly sandbox?: string;
|
|
71
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* Present only on an elevation that armed the one-shot resume of the intercepted tool. Forward
|
|
82
|
+
* the response body unchanged and the widget answers with one automatic turn.
|
|
83
|
+
*/
|
|
84
|
+
readonly resume?: {
|
|
85
|
+
readonly tool: string;
|
|
86
|
+
};
|
|
72
87
|
readonly configuration?: AssistantConfiguration;
|
|
73
88
|
}
|
|
74
89
|
/** The service's refusal codes for a sign-in ticket the exchange would not honour. */
|
|
@@ -59,6 +59,7 @@ async function createAssistantSession(input, dependencies = {}) {
|
|
|
59
59
|
origin: input.origin,
|
|
60
60
|
user: input.user,
|
|
61
61
|
...input.signInTicket === void 0 ? {} : { signInTicket: input.signInTicket },
|
|
62
|
+
...input.signInTicket !== void 0 && input.resume !== void 0 ? { resume: input.resume } : {},
|
|
62
63
|
...input.claims ? { claims: input.claims } : {},
|
|
63
64
|
...input.context ? { context: input.context } : {},
|
|
64
65
|
...input.preferences ? { preferences: input.preferences } : {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import type { AssistantConfiguration } from './appearance.js';\n\ninterface AssistantSessionExchangeBase {\n readonly serviceUrl: string;\n readonly clientId: string;\n readonly clientSecret: string;\n /** Browser origin to bind into the short-lived assistant session. */\n readonly origin: string;\n /** The signed-in person your backend vouches for — on both arms: an elevation IS this vouching. */\n readonly user: {\n readonly id: string;\n readonly email?: string;\n readonly name?: string;\n readonly tenant?: string;\n readonly roles?: readonly string[];\n readonly scopes?: readonly string[];\n };\n /** Backend-verified user preferences; these outrank untrusted browser presentation hints. */\n readonly preferences?: {\n readonly locale?: string;\n readonly timeZone?: string;\n };\n /**\n * Verified session claims from your authenticated backend. Only claims the server declares in\n * `embeddedAssistant({ sessionClaims })` reach tools (`\\${user.claims.<key>}`) and, when marked\n * `exposeToModel`, the assistant's identity context. Flat scalars only.\n */\n readonly claims?: Readonly<Record<string, string | number | boolean | null>>;\n}\n\n/**\n * Fresh mint XOR mid-conversation sign-in, exclusive rather than merged for the same reason the\n * client's `sessionEndpoint`/`embedId` pair is: the two are different operations, and the wrong\n * combination should fail to typecheck instead of silently picking a meaning.\n *\n * `context` applies only when a session is being created; an elevation keeps the existing\n * conversation, so it is excluded rather than silently ignored. `routing` is allowed on both arms —\n * elevation is the first authenticated moment, so it is the only chance a routed connector's\n * session ever gets its backend-verified customer routes.\n */\nexport type CreateAssistantSessionInput =\n | (AssistantSessionExchangeBase & {\n readonly signInTicket?: undefined;\n readonly context?: Readonly<Record<string, string | number | boolean | null>>;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n })\n | (AssistantSessionExchangeBase & {\n /**\n * Single-use sign-in ticket from the widget's `assistant-sign-in-requested` event\n * (ADR 0201, 5.6b). Spending it binds this signed-in user to the visitor's existing\n * anonymous conversation instead of minting a new one. Unrelated to the server-held\n * interaction continuation, which never reaches browser code.\n */\n readonly signInTicket: string;\n readonly context?: undefined;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n });\n\nexport interface AssistantSession {\n readonly token: string;\n readonly expiresAt: string;\n readonly endpoints: {\n readonly turns: string;\n readonly toolConfirmations: string;\n readonly interactions?: string;\n readonly apps?: string;\n /** Additive hosted sandbox document for widget frames; absent on older services. */\n readonly sandbox?: string;\n };\n readonly configuration?: AssistantConfiguration;\n}\n\n/** The service's refusal codes for a sign-in ticket the exchange would not honour. */\nexport const ASSISTANT_ELEVATION_REFUSAL_CODES = [\n 'elevation_ticket_invalid',\n 'elevation_ticket_expired',\n 'elevation_tenant_mismatch',\n 'elevation_session_unavailable',\n 'elevation_already_signed_in',\n] as const;\nexport type AssistantElevationRefusalCode = (typeof ASSISTANT_ELEVATION_REFUSAL_CODES)[number];\n\n/**\n * Structurally mirrors the browser client's `AssistantErrorDetail` (declared locally: the backend\n * entry must not pull the browser transport module into its graph). `code` is a closed union owned\n * by this package; `serviceCode` passes the service's machine code through additively.\n */\nexport interface AssistantSessionExchangeErrorDetail {\n readonly code: 'session_exchange_failed';\n readonly status: number;\n /** 5xx infrastructure failures may be retried; a refused exchange must not be — tickets are single-use. */\n readonly retryable: boolean;\n /** The service's machine code when the body carried one, e.g. `elevation_ticket_expired`. */\n readonly serviceCode?: string;\n}\n\nexport class AssistantSessionExchangeError extends Error {\n readonly detail: AssistantSessionExchangeErrorDetail;\n\n constructor(detail: AssistantSessionExchangeErrorDetail, message: string) {\n super(message);\n this.name = 'AssistantSessionExchangeError';\n this.detail = detail;\n }\n\n /**\n * The narrowed sign-in refusal, when this failure is one. `elevation_ticket_expired` means the\n * visitor took too long — re-prompt; `elevation_tenant_mismatch` means a client reached for a\n * conversation it does not own — alert someone, never retry.\n */\n get elevationRefusal(): AssistantElevationRefusalCode | undefined {\n const code = this.detail.serviceCode;\n return code !== undefined &&\n (ASSISTANT_ELEVATION_REFUSAL_CODES as readonly string[]).includes(code)\n ? (code as AssistantElevationRefusalCode)\n : undefined;\n }\n}\n\n/** Never throws while reading the body — a proxy can answer with HTML instead of JSON. */\nasync function exchangeError(response: Response): Promise<AssistantSessionExchangeError> {\n const body = (await response.json().catch(() => undefined)) as\n | { readonly error?: unknown; readonly code?: unknown }\n | undefined;\n const serviceCode = typeof body?.code === 'string' ? body.code : undefined;\n return new AssistantSessionExchangeError(\n {\n code: 'session_exchange_failed',\n status: response.status,\n // `elevation_unavailable` is a 503 an operator has to fix; retrying cannot help.\n retryable: response.status >= 500 && serviceCode !== 'elevation_unavailable',\n ...(serviceCode === undefined ? {} : { serviceCode }),\n },\n `Assistant session exchange failed (${response.status})`,\n );\n}\n\nexport async function createAssistantSession(\n input: CreateAssistantSessionInput,\n dependencies: { readonly fetch?: typeof fetch } = {},\n): Promise<AssistantSession> {\n if (input.signInTicket !== undefined && (input as { context?: unknown }).context !== undefined) {\n // Mirrors resolveSessionSource: silently dropping what the service ignores would pick a\n // meaning the developer did not intend.\n throw new Error('context does not apply when spending a sign-in ticket');\n }\n const request = dependencies.fetch ?? fetch;\n const serviceUrl = input.serviceUrl.replace(/\\/$/, '');\n const credentials = Buffer.from(`${input.clientId}:${input.clientSecret}`, 'utf8').toString(\n 'base64',\n );\n const response = await request(`${serviceUrl}/v1/assistant/sessions`, {\n method: 'POST',\n headers: {\n Authorization: `Basic ${credentials}`,\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n origin: input.origin,\n user: input.user,\n ...(input.signInTicket === undefined ? {} : { signInTicket: input.signInTicket }),\n ...(input.claims ? { claims: input.claims } : {}),\n ...(input.context ? { context: input.context } : {}),\n ...(input.preferences ? { preferences: input.preferences } : {}),\n ...(input.routing ? { routing: input.routing } : {}),\n }),\n });\n // A fresh mint answers 201, an elevation 200; both are the same wire shape (ADR 0151).\n if (!response.ok) throw await exchangeError(response);\n return (await response.json()) as AssistantSession;\n}\n"],"mappings":";;;AA+EO,IAAM,oCAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAiBO,IAAM,gCAAN,cAA4C,MAAM;AAAA,EAC9C;AAAA,EAET,YAAY,QAA6C,SAAiB;AACxE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,mBAA8D;AAChE,UAAM,OAAO,KAAK,OAAO;AACzB,WAAO,SAAS,UACb,kCAAwD,SAAS,IAAI,IACnE,OACD;AAAA,EACN;AACF;AAGA,eAAe,cAAc,UAA4D;AACvF,QAAM,OAAQ,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,MAAS;AAGzD,QAAM,cAAc,OAAO,MAAM,SAAS,WAAW,KAAK,OAAO;AACjE,SAAO,IAAI;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,QAAQ,SAAS;AAAA;AAAA,MAEjB,WAAW,SAAS,UAAU,OAAO,gBAAgB;AAAA,MACrD,GAAI,gBAAgB,SAAY,CAAC,IAAI,EAAE,YAAY;AAAA,IACrD;AAAA,IACA,sCAAsC,SAAS,MAAM;AAAA,EACvD;AACF;AAEA,eAAsB,uBACpB,OACA,eAAkD,CAAC,GACxB;AAC3B,MAAI,MAAM,iBAAiB,UAAc,MAAgC,YAAY,QAAW;AAG9F,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,QAAM,UAAU,aAAa,SAAS;AACtC,QAAM,aAAa,MAAM,WAAW,QAAQ,OAAO,EAAE;AACrD,QAAM,cAAc,OAAO,KAAK,GAAG,MAAM,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,EAAE;AAAA,IACjF;AAAA,EACF;AACA,QAAM,WAAW,MAAM,QAAQ,GAAG,UAAU,0BAA0B;AAAA,IACpE,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,eAAe,SAAS,WAAW;AAAA,MACnC,QAAQ;AAAA,MACR,gBAAgB;AAAA,IAClB;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB,QAAQ,MAAM;AAAA,MACd,MAAM,MAAM;AAAA,MACZ,GAAI,MAAM,iBAAiB,SAAY,CAAC,IAAI,EAAE,cAAc,MAAM,aAAa;AAAA,MAC/E,GAAI,MAAM,SAAS,EAAE,QAAQ,MAAM,OAAO,IAAI,CAAC;AAAA,MAC/C,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,MAClD,GAAI,MAAM,cAAc,EAAE,aAAa,MAAM,YAAY,IAAI,CAAC;AAAA,MAC9D,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,IACpD,CAAC;AAAA,EACH,CAAC;AAED,MAAI,CAAC,SAAS,GAAI,OAAM,MAAM,cAAc,QAAQ;AACpD,SAAQ,MAAM,SAAS,KAAK;AAC9B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import type { AssistantConfiguration } from './appearance.js';\n\ninterface AssistantSessionExchangeBase {\n readonly serviceUrl: string;\n readonly clientId: string;\n readonly clientSecret: string;\n /** Browser origin to bind into the short-lived assistant session. */\n readonly origin: string;\n /** The signed-in person your backend vouches for — on both arms: an elevation IS this vouching. */\n readonly user: {\n readonly id: string;\n readonly email?: string;\n readonly name?: string;\n readonly tenant?: string;\n readonly roles?: readonly string[];\n readonly scopes?: readonly string[];\n };\n /** Backend-verified user preferences; these outrank untrusted browser presentation hints. */\n readonly preferences?: {\n readonly locale?: string;\n readonly timeZone?: string;\n };\n /**\n * Verified session claims from your authenticated backend. Only claims the server declares in\n * `embeddedAssistant({ sessionClaims })` reach tools (`\\${user.claims.<key>}`) and, when marked\n * `exposeToModel`, the assistant's identity context. Flat scalars only.\n */\n readonly claims?: Readonly<Record<string, string | number | boolean | null>>;\n}\n\n/**\n * Fresh mint XOR mid-conversation sign-in, exclusive rather than merged for the same reason the\n * client's `sessionEndpoint`/`embedId` pair is: the two are different operations, and the wrong\n * combination should fail to typecheck instead of silently picking a meaning.\n *\n * `context` applies only when a session is being created; an elevation keeps the existing\n * conversation, so it is excluded rather than silently ignored. `routing` is allowed on both arms —\n * elevation is the first authenticated moment, so it is the only chance a routed connector's\n * session ever gets its backend-verified customer routes.\n */\nexport type CreateAssistantSessionInput =\n | (AssistantSessionExchangeBase & {\n readonly signInTicket?: undefined;\n readonly context?: Readonly<Record<string, string | number | boolean | null>>;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n /** Resume applies only when spending a sign-in ticket; a fresh mint has nothing pending. */\n readonly resume?: undefined;\n })\n | (AssistantSessionExchangeBase & {\n /**\n * Single-use sign-in ticket from the widget's `assistant-sign-in-requested` event\n * (ADR 0201, 5.6b). Spending it binds this signed-in user to the visitor's existing\n * anonymous conversation instead of minting a new one. Unrelated to the server-held\n * interaction continuation, which never reaches browser code.\n */\n readonly signInTicket: string;\n readonly context?: undefined;\n /** Backend-verified connector routes keyed by authored `customerEndpoint` name. */\n readonly routing?: {\n readonly endpoints: Readonly<Record<string, string>>;\n };\n /**\n * Whether the service resumes the intercepted tool call as the elevated session's first\n * turn (issue #1177). ON by default — omit it and the visitor's pending question answers\n * itself after sign-in; pass `false` if your application provides its own affordance.\n */\n readonly resume?: boolean;\n });\n\nexport interface AssistantSession {\n readonly token: string;\n readonly expiresAt: string;\n readonly endpoints: {\n readonly turns: string;\n readonly toolConfirmations: string;\n readonly interactions?: string;\n readonly apps?: string;\n /** Additive hosted sandbox document for widget frames; absent on older services. */\n readonly sandbox?: string;\n };\n /**\n * Present only on an elevation that armed the one-shot resume of the intercepted tool. Forward\n * the response body unchanged and the widget answers with one automatic turn.\n */\n readonly resume?: { readonly tool: string };\n readonly configuration?: AssistantConfiguration;\n}\n\n/** The service's refusal codes for a sign-in ticket the exchange would not honour. */\nexport const ASSISTANT_ELEVATION_REFUSAL_CODES = [\n 'elevation_ticket_invalid',\n 'elevation_ticket_expired',\n 'elevation_tenant_mismatch',\n 'elevation_session_unavailable',\n 'elevation_already_signed_in',\n] as const;\nexport type AssistantElevationRefusalCode = (typeof ASSISTANT_ELEVATION_REFUSAL_CODES)[number];\n\n/**\n * Structurally mirrors the browser client's `AssistantErrorDetail` (declared locally: the backend\n * entry must not pull the browser transport module into its graph). `code` is a closed union owned\n * by this package; `serviceCode` passes the service's machine code through additively.\n */\nexport interface AssistantSessionExchangeErrorDetail {\n readonly code: 'session_exchange_failed';\n readonly status: number;\n /** 5xx infrastructure failures may be retried; a refused exchange must not be — tickets are single-use. */\n readonly retryable: boolean;\n /** The service's machine code when the body carried one, e.g. `elevation_ticket_expired`. */\n readonly serviceCode?: string;\n}\n\nexport class AssistantSessionExchangeError extends Error {\n readonly detail: AssistantSessionExchangeErrorDetail;\n\n constructor(detail: AssistantSessionExchangeErrorDetail, message: string) {\n super(message);\n this.name = 'AssistantSessionExchangeError';\n this.detail = detail;\n }\n\n /**\n * The narrowed sign-in refusal, when this failure is one. `elevation_ticket_expired` means the\n * visitor took too long — re-prompt; `elevation_tenant_mismatch` means a client reached for a\n * conversation it does not own — alert someone, never retry.\n */\n get elevationRefusal(): AssistantElevationRefusalCode | undefined {\n const code = this.detail.serviceCode;\n return code !== undefined &&\n (ASSISTANT_ELEVATION_REFUSAL_CODES as readonly string[]).includes(code)\n ? (code as AssistantElevationRefusalCode)\n : undefined;\n }\n}\n\n/** Never throws while reading the body — a proxy can answer with HTML instead of JSON. */\nasync function exchangeError(response: Response): Promise<AssistantSessionExchangeError> {\n const body = (await response.json().catch(() => undefined)) as\n | { readonly error?: unknown; readonly code?: unknown }\n | undefined;\n const serviceCode = typeof body?.code === 'string' ? body.code : undefined;\n return new AssistantSessionExchangeError(\n {\n code: 'session_exchange_failed',\n status: response.status,\n // `elevation_unavailable` is a 503 an operator has to fix; retrying cannot help.\n retryable: response.status >= 500 && serviceCode !== 'elevation_unavailable',\n ...(serviceCode === undefined ? {} : { serviceCode }),\n },\n `Assistant session exchange failed (${response.status})`,\n );\n}\n\nexport async function createAssistantSession(\n input: CreateAssistantSessionInput,\n dependencies: { readonly fetch?: typeof fetch } = {},\n): Promise<AssistantSession> {\n if (input.signInTicket !== undefined && (input as { context?: unknown }).context !== undefined) {\n // Mirrors resolveSessionSource: silently dropping what the service ignores would pick a\n // meaning the developer did not intend.\n throw new Error('context does not apply when spending a sign-in ticket');\n }\n const request = dependencies.fetch ?? fetch;\n const serviceUrl = input.serviceUrl.replace(/\\/$/, '');\n const credentials = Buffer.from(`${input.clientId}:${input.clientSecret}`, 'utf8').toString(\n 'base64',\n );\n const response = await request(`${serviceUrl}/v1/assistant/sessions`, {\n method: 'POST',\n headers: {\n Authorization: `Basic ${credentials}`,\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n origin: input.origin,\n user: input.user,\n ...(input.signInTicket === undefined ? {} : { signInTicket: input.signInTicket }),\n ...(input.signInTicket !== undefined && input.resume !== undefined\n ? { resume: input.resume }\n : {}),\n ...(input.claims ? { claims: input.claims } : {}),\n ...(input.context ? { context: input.context } : {}),\n ...(input.preferences ? { preferences: input.preferences } : {}),\n ...(input.routing ? { routing: input.routing } : {}),\n }),\n });\n // A fresh mint answers 201, an elevation 200; both are the same wire shape (ADR 0151).\n if (!response.ok) throw await exchangeError(response);\n return (await response.json()) as AssistantSession;\n}\n"],"mappings":";;;AA4FO,IAAM,oCAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAiBO,IAAM,gCAAN,cAA4C,MAAM;AAAA,EAC9C;AAAA,EAET,YAAY,QAA6C,SAAiB;AACxE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,mBAA8D;AAChE,UAAM,OAAO,KAAK,OAAO;AACzB,WAAO,SAAS,UACb,kCAAwD,SAAS,IAAI,IACnE,OACD;AAAA,EACN;AACF;AAGA,eAAe,cAAc,UAA4D;AACvF,QAAM,OAAQ,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,MAAS;AAGzD,QAAM,cAAc,OAAO,MAAM,SAAS,WAAW,KAAK,OAAO;AACjE,SAAO,IAAI;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,QAAQ,SAAS;AAAA;AAAA,MAEjB,WAAW,SAAS,UAAU,OAAO,gBAAgB;AAAA,MACrD,GAAI,gBAAgB,SAAY,CAAC,IAAI,EAAE,YAAY;AAAA,IACrD;AAAA,IACA,sCAAsC,SAAS,MAAM;AAAA,EACvD;AACF;AAEA,eAAsB,uBACpB,OACA,eAAkD,CAAC,GACxB;AAC3B,MAAI,MAAM,iBAAiB,UAAc,MAAgC,YAAY,QAAW;AAG9F,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,QAAM,UAAU,aAAa,SAAS;AACtC,QAAM,aAAa,MAAM,WAAW,QAAQ,OAAO,EAAE;AACrD,QAAM,cAAc,OAAO,KAAK,GAAG,MAAM,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,EAAE;AAAA,IACjF;AAAA,EACF;AACA,QAAM,WAAW,MAAM,QAAQ,GAAG,UAAU,0BAA0B;AAAA,IACpE,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,eAAe,SAAS,WAAW;AAAA,MACnC,QAAQ;AAAA,MACR,gBAAgB;AAAA,IAClB;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB,QAAQ,MAAM;AAAA,MACd,MAAM,MAAM;AAAA,MACZ,GAAI,MAAM,iBAAiB,SAAY,CAAC,IAAI,EAAE,cAAc,MAAM,aAAa;AAAA,MAC/E,GAAI,MAAM,iBAAiB,UAAa,MAAM,WAAW,SACrD,EAAE,QAAQ,MAAM,OAAO,IACvB,CAAC;AAAA,MACL,GAAI,MAAM,SAAS,EAAE,QAAQ,MAAM,OAAO,IAAI,CAAC;AAAA,MAC/C,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,MAClD,GAAI,MAAM,cAAc,EAAE,aAAa,MAAM,YAAY,IAAI,CAAC;AAAA,MAC9D,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;AAAA,IACpD,CAAC;AAAA,EACH,CAAC;AAED,MAAI,CAAC,SAAS,GAAI,OAAM,MAAM,cAAc,QAAQ;AACpD,SAAQ,MAAM,SAAS,KAAK;AAC9B;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/assistant",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Embed the Noodle Seed customer-branded assistant in your web app with a Web Component, managed or custom React UI, DOM-free client, and backend session helper. Authoring and deploying the server is @noodleseed/one.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/one",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.131.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Noodle CLI by Noodle Seed — author, run, and deploy declarative MCP servers. Embedding the assistant in your own web app is @noodleseed/assistant.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"@noodle-borg/module",
|
|
105
105
|
"@noodle-borg/module-audit",
|
|
106
106
|
"@noodle-borg/oauth-client-registry",
|
|
107
|
+
"@noodle-borg/observability",
|
|
107
108
|
"@noodle-borg/openapi-import",
|
|
108
109
|
"@noodle-borg/plugin-distribution",
|
|
109
110
|
"@noodle-borg/protocol",
|
|
@@ -236,7 +237,7 @@
|
|
|
236
237
|
"@jitl/quickjs-wasmfile-release-sync": "0.32.0",
|
|
237
238
|
"@modelcontextprotocol/client": "2.0.0",
|
|
238
239
|
"@modelcontextprotocol/server": "2.0.0",
|
|
239
|
-
"@noodle-borg/agent-kit": "0.
|
|
240
|
+
"@noodle-borg/agent-kit": "0.77.0",
|
|
240
241
|
"@noodle-borg/app-audit": "0.0.0",
|
|
241
242
|
"@noodle-borg/app-package": "0.0.0",
|
|
242
243
|
"@noodle-borg/auth": "0.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-event-buffer.d.ts","sourceRoot":"","sources":["../../src/store/request-event-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI/E;;;;;;GAMG;AACH,qBAAa,kBAAkB;;gBAUjB,IAAI,EAAE,gBAAgB,EAAE,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO;IAKlE,4FAA4F;IAC5F,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAyBvC,4DAA4D;IAC5D,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,qDAAqD;IACrD,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,mEAAmE;IAC7D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B"}
|
|
@@ -1 +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AAC;gBACH,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC;YAAC,MAAM,CAAC;gBACP,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,iEAAiE;YACtF,CAAC;QACH,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,4DAA4D;IAC5D,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,qDAAqD;IACrD,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,mEAAmE;IACnE,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,MAAM,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-events-postgres.d.ts","sourceRoot":"","sources":["../../src/store/request-events-postgres.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAMvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAM/B;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDxE;AAkCD;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,iBAAiB;;gBAIrD,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IAK1D,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2C7C,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAmCxE,wGAAwG;IAClG,KAAK,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;CAO9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-events-postgres.js","sourceRoot":"","sources":["../../src/store/request-events-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAGL,4BAA4B,EAO5B,aAAa,GAGd,MAAM,qBAAqB,CAAC;AAG7B,mFAAmF;AACnF,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAU;IACvD,MAAM,IAAI,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgChB,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,KAAK,CAAC;;;GAGhB,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,KAAK,CAAC;;;GAGhB,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,KAAK,CAAC;;;;GAIhB,CAAC,CAAC;IACH,mGAAmG;IACnG,MAAM,IAAI,CAAC,KAAK,CAAC;;;GAGhB,CAAC,CAAC;AACL,CAAC;AAkCD;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAC3B,KAAK,CAAO;IACZ,IAAI,CAAa;IAE1B,YAAY,IAAU,EAAE,UAAgC,EAAE;QACxD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,YAAY;QACV,OAAO,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,IAAI,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AAC;KAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-events.d.ts","sourceRoot":"","sources":["../../src/store/request-events.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEvB,MAAM,qBAAqB,CAAC;AAoD7B;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,iBAAiB;;gBAIrD,GAAG,GAAE,MAAoB;IAIrC,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7C,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;CAQnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-events.js","sourceRoot":"","sources":["../../src/store/request-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,4BAA4B,EAK5B,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,GAAG,MAAM,CAAC;AAE3B,SAAS,cAAc,CAAC,KAAwB;IAC9C,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO;QACL,EAAE,EAAE,UAAU,EAAE;QAChB,aAAa,EAAE,4BAA4B;QAC3C,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO;QACt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