@tangle-network/agent-runtime 0.274.0 → 0.279.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.
Files changed (61) hide show
  1. package/dist/{activation-DiW4KBY-.d.ts → activation-B5NExoOz.d.ts} +137 -105
  2. package/dist/{activation-t5vg1Zyu.js → activation-BkUdrvqh.js} +2 -2
  3. package/dist/{activation-t5vg1Zyu.js.map → activation-BkUdrvqh.js.map} +1 -1
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-B2GTcMvx.js → coordination-driver-BBL_OgRw.js} +95 -28
  7. package/dist/coordination-driver-BBL_OgRw.js.map +1 -0
  8. package/dist/{delegate-Bmt7uynp.js → delegate-CZc7B-Tl.js} +2 -2
  9. package/dist/{delegate-Bmt7uynp.js.map → delegate-CZc7B-Tl.js.map} +1 -1
  10. package/dist/durable.d.ts +2 -2
  11. package/dist/durable.js +2 -2
  12. package/dist/{graph-9khZscYU.js → graph-Ci8Ufs_f.js} +4 -4
  13. package/dist/{graph-9khZscYU.js.map → graph-Ci8Ufs_f.js.map} +1 -1
  14. package/dist/{improvement-cycle-oQFOTgLd.js → improvement-cycle-Bi43xCVa.js} +649 -213
  15. package/dist/improvement-cycle-Bi43xCVa.js.map +1 -0
  16. package/dist/{index-CjLtO4B3.d.ts → index-Dm8SHDGW.d.ts} +51 -17
  17. package/dist/index.d.ts +9 -9
  18. package/dist/index.js +55 -14
  19. package/dist/index.js.map +1 -1
  20. package/dist/intelligence.d.ts +3 -3
  21. package/dist/intelligence.js +3 -3
  22. package/dist/kernel.d.ts +4 -4
  23. package/dist/kernel.js +8 -8
  24. package/dist/{loop-runner-bin-C-rco77U.js → loop-runner-bin-C9FJshTP.js} +3 -3
  25. package/dist/{loop-runner-bin-C-rco77U.js.map → loop-runner-bin-C9FJshTP.js.map} +1 -1
  26. package/dist/{loop-runner-bin-Ceehl2oB.d.ts → loop-runner-bin-D6khQtoC.d.ts} +3 -3
  27. package/dist/loop-runner-bin.d.ts +1 -1
  28. package/dist/loop-runner-bin.js +1 -1
  29. package/dist/mcp/bin.js +3 -3
  30. package/dist/mcp/index.d.ts +5 -5
  31. package/dist/mcp/index.js +4 -4
  32. package/dist/{openai-tools-D8ZYHReZ.d.ts → openai-tools-H8QPhTVE.d.ts} +2 -2
  33. package/dist/platform.d.ts +91 -1
  34. package/dist/platform.js +162 -6
  35. package/dist/platform.js.map +1 -1
  36. package/dist/profiles.d.ts +2 -2
  37. package/dist/{provision-supervisor-Ds43T8XY.js → provision-supervisor-BvnihiyB.js} +3 -3
  38. package/dist/{provision-supervisor-Ds43T8XY.js.map → provision-supervisor-BvnihiyB.js.map} +1 -1
  39. package/dist/{runtime-CtrgIqQm.js → runtime-DsAHXig2.js} +73 -26
  40. package/dist/runtime-DsAHXig2.js.map +1 -0
  41. package/dist/{server-DnSzxChA.js → server-Dyc1zvug.js} +3 -3
  42. package/dist/{server-DnSzxChA.js.map → server-Dyc1zvug.js.map} +1 -1
  43. package/dist/{stream-agent-turn-C2rtL6P2.d.ts → stream-agent-turn-Bk79CnTw.d.ts} +2 -2
  44. package/dist/{structural-rollout-DN8CVdpp.js → structural-rollout-D-0X6lsU.js} +2 -2
  45. package/dist/{structural-rollout-DN8CVdpp.js.map → structural-rollout-D-0X6lsU.js.map} +1 -1
  46. package/dist/{substrate-DPIUXsZ5.d.ts → substrate-CHQ5GYnU.d.ts} +2 -2
  47. package/dist/{supervise-CFyAWebz.js → supervise-DBQdrp7H.js} +171 -13
  48. package/dist/supervise-DBQdrp7H.js.map +1 -0
  49. package/dist/{supervisor-C50SI_Ww.js → supervisor-DtlPj9me.js} +372 -77
  50. package/dist/supervisor-DtlPj9me.js.map +1 -0
  51. package/dist/testing.d.ts +2 -2
  52. package/dist/testing.js +60 -60
  53. package/dist/tui/index.d.ts +1 -1
  54. package/dist/tui/index.js +1 -1
  55. package/dist/{types-r7Fzum3M.d.ts → types-D56jQad-.d.ts} +92 -66
  56. package/package.json +10 -7
  57. package/dist/coordination-driver-B2GTcMvx.js.map +0 -1
  58. package/dist/improvement-cycle-oQFOTgLd.js.map +0 -1
  59. package/dist/runtime-CtrgIqQm.js.map +0 -1
  60. package/dist/supervise-CFyAWebz.js.map +0 -1
  61. package/dist/supervisor-C50SI_Ww.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { At as createPropagatingTraceEmitter, Mt as readTraceContextFromEnv, Nt as traceContextToEnv, Ta as SandboxClient, jt as mergeTraceEnv, kt as TraceContext, ma as LoopSandboxPlacement } from "../types-r7Fzum3M.js";
2
- import { $d as DefinedAnalystRecord, $f as DelegateResult, $p as DelegateUiAuditArgs, Af as downMessageRefusalReasons, Am as DelegationPersistenceError, Ap as detachedTurnEvents, Bd as AnalystToolGroupName, Bf as environmentReader, Bp as DelegationTaskQueue, Cm as DelegationTraceCaps, Cp as DetachedSessionRefParts, Df as analystToolGroupNames, Dm as capDelegationTrace, Dp as DriveTurnTick, Ef as WorkerWatchOptions, Em as buildDelegationTraceSpans, Ep as DriveTurnCapableBox, Fd as AnalystDefinitionIssue, Ff as ResolvedSpawnResourcePath, Fm as InMemoryDelegationStore, Fp as DelegationRecord, Gd as AuthorizedDownMessage, Gf as createInProcessTransport, Gp as DelegateCodeArgs, Hd as AuthoredAnalystDefinition, Hf as resolveSpawnResourcePaths, Hp as SubmitInput, Id as AnalystFindingEvent, If as SPAWN_RESOURCE_PATH_MAX_BYTES, Im as CoderOutput, Ip as DelegationResumeContext, Jd as CoordinationEvent, Jf as DELEGATE_INPUT_SCHEMA, Jp as DelegateFeedbackArgs, Kd as ContinuationInstruction, Kf as createMcpServer, Kp as DelegateCodeConfig, Ld as AnalystKind, Lf as SpawnResourceBytes, Lp as DelegationResumeDriver, Mf as parseAuthoredAnalystDefinition, Mm as DelegationStore, Mp as parseDetachedSessionRef, Nf as questionEscalationTargets, Nm as FileDelegationStore, Np as runDetachedTurn, Om as composeLoopTraceEmitters, Op as RunDetachedTurnOptions, Pd as ANALYST_DEFINITION_BOUNDS, Pf as ResolveSpawnResourcePathsResult, Pm as FileDelegationStoreOptions, Pp as DelegationArgs, Qd as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, Qf as DelegateHandlerOptions, Qp as DelegateResearchResult, Rf as SpawnResourceRead, Rp as DelegationResumeTick, Sm as DELEGATION_TRACE_MAX_SPANS, Sp as createSiblingSandboxExecutor, Tf as WorkerSpawnContext, Tm as DelegationTraceSpan, Tp as DetachedTurnResumeDriverOptions, Ud as AuthoredAnalystLimits, Uf as McpServer, Up as SubmitOutput, Vf as hostDirectoryReader, Vp as DelegationTaskQueueOptions, Wd as AuthorizeDownMessage, Wf as McpServerOptions, Wp as hashIdempotencyInput, Xd as CoordinationTools, Xf as DelegateArgs, Xp as DelegateResearchArgs, Yf as DELEGATE_TOOL_NAME, Yp as DelegateFeedbackResult, Zd as CoordinationToolsOptions, Zf as DelegateError, Zp as DelegateResearchConfig, _f as QuestionUrgency, _m as UiAuditLensFilter, _p as DelegationExecutor, af as EventAcknowledgement, am as DelegationHistoryArgs, ap as eventToSnapshot, bm as CappedDelegationTrace, bp as SiblingSandboxExecutorOptions, cf as Question, cm as DelegationProfile, cp as CoderReviewer, df as QuestionEscalationRecord, dm as DelegationStatus, dp as DetachedWinnerSelection, ef as DownMessageAuthorizationInput, em as DelegateUiAuditConfig, ep as createDelegateHandler, ff as QuestionEscalationTarget, fm as DelegationStatusArgs, fp as SettleDetachedCoderTurnOptions, gf as QuestionRecord, gm as ResearchOutputShape, gp as settleDetachedCoderTurn, hf as QuestionPolicy, hm as FeedbackRefersTo, hp as detachedSessionDelegate, if as EscalateQuestion, im as DelegationFeedbackSnapshot, ip as InMemoryFeedbackStore, jm as DelegationStateCorruptError, jp as formatDetachedSessionRef, kf as createCoordinationTools, km as createDelegationTraceCollector, kp as createDetachedTurnResumeDriver, lf as QuestionDecision, lm as DelegationProgress, lp as DelegateRunCtx, mf as QuestionOption, mm as FeedbackRating, mp as coderTaskFromArgs, nf as DownMessageDeliveryOutcome, nm as DelegateUiAuditRoute, np as FeedbackEvent, of as MakeWorkerAgent, om as DelegationHistoryEntry, op as CoderDelegate, pf as QuestionLevel, pm as DelegationStatusResult, pp as UiAuditorDelegate, qf as DELEGATE_DESCRIPTION, qp as DelegateCodeResult, rf as DownMessageEvent, rm as DelegationError, rp as FeedbackStore, sf as ManagerReentryState, sm as DelegationHistoryResult, sp as CoderReview, tf as DownMessageDeliveryAttempt, tm as DelegateUiAuditResult, tp as validateDelegateArgs, uf as QuestionEscalationOutcome, um as DelegationResultPayload, up as DetachedSessionDelegateOptions, vf as SettledWorker, vm as UiAuditorDelegationOutput, vp as FleetHandle, wm as DelegationTraceCollector, wp as DetachedTurn, xm as DELEGATION_TRACE_MAX_BYTES, xp as createFleetWorkspaceExecutor, ym as delegationProfiles, yp as FleetWorkspaceExecutorOptions, zd as AnalystRegistry, zf as SpawnResourceReader, zp as DelegationRunContext } from "../index-CjLtO4B3.js";
3
- import { An as DEFAULT_LOCAL_HARNESS, Cn as WorktreeHandle, Dn as CodexExecutionEvidence, En as removeWorktree, Fn as harnessSupportsReasoningEffort, In as localHarnessExecutable, Ln as parseCodexTokenUsage, Mn as LocalHarness, Nn as LocalHarnessResult, On as CodexExecutionPolicy, Pn as RunLocalHarnessOptions, Rn as runLocalHarness, Sn as RemoveWorktreeOptions, Tn as createWorktree, bn as DiffResult, dr as JsonRpcMessage, fr as JsonRpcResponse, hr as McpTransport, jn as LOCAL_HARNESSES, kn as CodexTokenUsage, mr as McpToolDescriptor, pr as McpToolAnnotations, vn as CreateWorktreeOptions, wn as captureWorktreeDiff, xn as GitRunner, yn as DiffOptions } from "../stream-agent-turn-C2rtL6P2.js";
4
- import { d as ResearchSource, o as UiLens } from "../substrate-DPIUXsZ5.js";
1
+ import { At as TraceContext, Mt as mergeTraceEnv, Nt as readTraceContextFromEnv, Pt as traceContextToEnv, ba as SandboxClient, jt as createPropagatingTraceEmitter, la as LoopSandboxPlacement } from "../types-D56jQad-.js";
2
+ import { $d as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, $f as DelegateHandlerOptions, $p as DelegateResearchResult, Af as createCoordinationTools, Am as createDelegationTraceCollector, Ap as createDetachedTurnResumeDriver, Bd as AnalystRegistry, Bf as SpawnResourceReader, Bp as DelegationRunContext, Cm as DELEGATION_TRACE_MAX_SPANS, Cp as createSiblingSandboxExecutor, Df as WorkerWatchOptions, Dm as buildDelegationTraceSpans, Dp as DriveTurnCapableBox, Ef as WorkerSpawnContext, Em as DelegationTraceSpan, Ep as DetachedTurnResumeDriverOptions, Fd as ANALYST_DEFINITION_BOUNDS, Ff as ResolveSpawnResourcePathsResult, Fm as FileDelegationStoreOptions, Fp as DelegationArgs, Gd as AuthorizeDownMessage, Gf as McpServerOptions, Gp as hashIdempotencyInput, Hf as hostDirectoryReader, Hp as DelegationTaskQueueOptions, Id as AnalystDefinitionIssue, If as ResolvedSpawnResourcePath, Im as InMemoryDelegationStore, Ip as DelegationRecord, Jf as DELEGATE_DESCRIPTION, Jp as DelegateCodeResult, Kd as AuthorizedDownMessage, Kf as createInProcessTransport, Kp as DelegateCodeArgs, Ld as AnalystFindingEvent, Lf as SPAWN_RESOURCE_PATH_MAX_BYTES, Lm as CoderOutput, Lp as DelegationResumeContext, Mm as DelegationStateCorruptError, Mp as formatDetachedSessionRef, Nf as parseAuthoredAnalystDefinition, Nm as DelegationStore, Np as parseDetachedSessionRef, Of as analystToolGroupNames, Om as capDelegationTrace, Op as DriveTurnTick, Pf as questionEscalationTargets, Pm as FileDelegationStore, Pp as runDetachedTurn, Qd as CoordinationToolsOptions, Qf as DelegateError, Qp as DelegateResearchConfig, Rd as AnalystKind, Rf as SpawnResourceBytes, Rp as DelegationResumeDriver, Sm as DELEGATION_TRACE_MAX_BYTES, Sp as createFleetWorkspaceExecutor, Tm as DelegationTraceCollector, Tp as DetachedTurn, Ud as AuthoredAnalystDefinition, Uf as resolveSpawnResourcePaths, Up as SubmitInput, Vd as AnalystToolGroupName, Vf as environmentReader, Vp as DelegationTaskQueue, Wd as AuthoredAnalystLimits, Wf as McpServer, Wp as SubmitOutput, Xf as DELEGATE_TOOL_NAME, Xp as DelegateFeedbackResult, Yd as CoordinationEvent, Yf as DELEGATE_INPUT_SCHEMA, Yp as DelegateFeedbackArgs, Zd as CoordinationTools, Zf as DelegateArgs, Zp as DelegateResearchArgs, _f as QuestionRecord, _m as ResearchOutputShape, _p as settleDetachedCoderTurn, af as EscalateQuestion, am as DelegationFeedbackSnapshot, ap as InMemoryFeedbackStore, bm as delegationProfiles, bp as FleetWorkspaceExecutorOptions, cf as ManagerReentryState, cm as DelegationHistoryResult, cp as CoderReview, df as QuestionEscalationOutcome, dm as DelegationResultPayload, dp as DetachedSessionDelegateOptions, ef as DefinedAnalystRecord, em as DelegateUiAuditArgs, ep as DelegateResult, ff as QuestionEscalationRecord, fm as DelegationStatus, fp as DetachedWinnerSelection, gf as QuestionPolicy, gm as FeedbackRefersTo, gp as detachedSessionDelegate, hf as QuestionOption, hm as FeedbackRating, hp as coderTaskFromArgs, if as DownMessageEvent, im as DelegationError, ip as FeedbackStore, jf as downMessageRefusalReasons, jm as DelegationPersistenceError, jp as detachedTurnEvents, km as composeLoopTraceEmitters, kp as RunDetachedTurnOptions, lf as Question, lm as DelegationProfile, lp as CoderReviewer, mf as QuestionLevel, mm as DelegationStatusResult, mp as UiAuditorDelegate, nf as DownMessageDeliveryAttempt, nm as DelegateUiAuditResult, np as validateDelegateArgs, of as EventAcknowledgement, om as DelegationHistoryArgs, op as eventToSnapshot, pf as QuestionEscalationTarget, pm as DelegationStatusArgs, pp as SettleDetachedCoderTurnOptions, qd as ContinuationInstruction, qf as createMcpServer, qp as DelegateCodeConfig, rf as DownMessageDeliveryOutcome, rm as DelegateUiAuditRoute, rp as FeedbackEvent, sf as MakeWorkerAgent, sm as DelegationHistoryEntry, sp as CoderDelegate, tf as DownMessageAuthorizationInput, tm as DelegateUiAuditConfig, tp as createDelegateHandler, uf as QuestionDecision, um as DelegationProgress, up as DelegateRunCtx, vf as QuestionUrgency, vm as UiAuditLensFilter, vp as DelegationExecutor, wm as DelegationTraceCaps, wp as DetachedSessionRefParts, xm as CappedDelegationTrace, xp as SiblingSandboxExecutorOptions, yf as SettledWorker, ym as UiAuditorDelegationOutput, yp as FleetHandle, zf as SpawnResourceRead, zp as DelegationResumeTick } from "../index-Dm8SHDGW.js";
3
+ import { An as DEFAULT_LOCAL_HARNESS, Cn as WorktreeHandle, Dn as CodexExecutionEvidence, En as removeWorktree, Fn as harnessSupportsReasoningEffort, In as localHarnessExecutable, Ln as parseCodexTokenUsage, Mn as LocalHarness, Nn as LocalHarnessResult, On as CodexExecutionPolicy, Pn as RunLocalHarnessOptions, Rn as runLocalHarness, Sn as RemoveWorktreeOptions, Tn as createWorktree, bn as DiffResult, dr as JsonRpcMessage, fr as JsonRpcResponse, hr as McpTransport, jn as LOCAL_HARNESSES, kn as CodexTokenUsage, mr as McpToolDescriptor, pr as McpToolAnnotations, vn as CreateWorktreeOptions, wn as captureWorktreeDiff, xn as GitRunner, yn as DiffOptions } from "../stream-agent-turn-Bk79CnTw.js";
4
+ import { d as ResearchSource, o as UiLens } from "../substrate-CHQ5GYnU.js";
5
5
  import { a as KbGateResult, i as FactJudgeVerdict, n as FactCandidate, o as createKbGate, r as FactJudge, t as CreateKbGateOptions } from "../kb-gate-C8z2juK8.js";
6
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-D8ZYHReZ.js";
6
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-H8QPhTVE.js";
7
7
  import { AgentProfileMcpServer, HarnessType } from "@tangle-network/agent-interface";
8
8
  //#region src/mcp/codex-diagnostics.d.ts
9
9
  /** Bounded, credential-redacted process context attached when reproducible Codex output fails
package/dist/mcp/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { $r as runWorktreeHarness, Ar as createPropagatingTraceEmitter, Bn as runAgentRounds, Ln as createSandboxForSpec, Mr as readTraceContextFromEnv, Nr as traceContextToEnv, Sa as sleep, Ta as throwIfAborted, Wn as assertBoxlessPromptOptions, _a as deleteBoxSafe, ci as parseCodexTokenUsage, ct as environmentReader, ei as captureWorktreeDiff, ii as LOCAL_HARNESSES, jr as mergeTraceEnv, li as CodexExecutionDiagnosticError, lt as hostDirectoryReader, ni as removeWorktree, oi as harnessSupportsReasoningEffort, ri as DEFAULT_LOCAL_HARNESS, si as localHarnessExecutable, st as SPAWN_RESOURCE_PATH_MAX_BYTES, ti as createWorktree, ut as resolveSpawnResourcePaths, wa as throwAbort } from "../supervisor-C50SI_Ww.js";
1
+ import { $r as runWorktreeHarness, Fr as traceContextToEnv, Hn as runAgentRounds, Kn as assertBoxlessPromptOptions, Mr as createPropagatingTraceEmitter, Nr as mergeTraceEnv, Pr as readTraceContextFromEnv, Sa as sleep, Ta as throwIfAborted, _a as deleteBoxSafe, ci as parseCodexTokenUsage, dt as hostDirectoryReader, ei as captureWorktreeDiff, ft as resolveSpawnResourcePaths, ii as LOCAL_HARNESSES, li as CodexExecutionDiagnosticError, lt as SPAWN_RESOURCE_PATH_MAX_BYTES, ni as removeWorktree, oi as harnessSupportsReasoningEffort, ri as DEFAULT_LOCAL_HARNESS, si as localHarnessExecutable, ti as createWorktree, ut as environmentReader, wa as throwAbort, zn as createSandboxForSpec } from "../supervisor-DtlPj9me.js";
2
2
  import { i as ConfigError, m as ValidationError } from "../errors-DodWX-cb.js";
3
3
  import { t as assertExecutableAgentProfile } from "../model-policy-BbSCSak0.js";
4
- import { O as runCoderChecks, mt as selectValidWinner } from "../runtime-CtrgIqQm.js";
5
- import { A as createCoordinationTools, D as analystToolGroupNames, E as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, F as questionEscalationTargets, M as downMessageRefusalReasons, P as parseAuthoredAnalystDefinition, T as ANALYST_DEFINITION_BOUNDS } from "../coordination-driver-B2GTcMvx.js";
4
+ import { O as runCoderChecks, mt as selectValidWinner } from "../runtime-DsAHXig2.js";
5
+ import { A as createCoordinationTools, D as analystToolGroupNames, E as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, F as questionEscalationTargets, M as downMessageRefusalReasons, P as parseAuthoredAnalystDefinition, T as ANALYST_DEFINITION_BOUNDS } from "../coordination-driver-BBL_OgRw.js";
6
6
  import { n as SUPPORTED_PROTOCOL_VERSIONS, r as createStdioToolServer } from "../tool-server-Dqer2M4_.js";
7
7
  import { t as createKbGate } from "../kb-gate-DpaSwXVx.js";
8
8
  import { _ as InMemoryFeedbackStore, a as validateDelegationStatusArgs, c as DELEGATION_HISTORY_TOOL_NAME, d as delegationProfiles, f as DELEGATE_FEEDBACK_DESCRIPTION, g as validateDelegateFeedbackArgs, h as createDelegateFeedbackHandler, i as createDelegationStatusHandler, l as createDelegationHistoryHandler, m as DELEGATE_FEEDBACK_TOOL_NAME, n as DELEGATION_STATUS_INPUT_SCHEMA, o as DELEGATION_HISTORY_DESCRIPTION, p as DELEGATE_FEEDBACK_INPUT_SCHEMA, r as DELEGATION_STATUS_TOOL_NAME, s as DELEGATION_HISTORY_INPUT_SCHEMA, t as DELEGATION_STATUS_DESCRIPTION, u as validateDelegationHistoryArgs, v as eventToSnapshot } from "../delegation-status-CF4D0NZ_.js";
9
9
  import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-DoQ32vpe.js";
10
10
  import { t as coderTaskToPrompt } from "../coder-yhVWbdWc.js";
11
- import { C as composeLoopTraceEmitters, S as capDelegationTrace, _ as FileDelegationStore, a as DELEGATE_UI_AUDIT_TOOL_NAME, b as DELEGATION_TRACE_MAX_SPANS, c as DELEGATE_DESCRIPTION, d as createDelegateHandler, f as validateDelegateArgs, g as DelegationStateCorruptError, h as DelegationPersistenceError, i as DELEGATE_UI_AUDIT_INPUT_SCHEMA, l as DELEGATE_INPUT_SCHEMA, m as hashIdempotencyInput, n as createMcpServer, o as createDelegateUiAuditHandler, p as DelegationTaskQueue, r as DELEGATE_UI_AUDIT_DESCRIPTION, s as validateDelegateUiAuditArgs, t as createInProcessTransport, u as DELEGATE_TOOL_NAME, v as InMemoryDelegationStore, w as createDelegationTraceCollector, x as buildDelegationTraceSpans, y as DELEGATION_TRACE_MAX_BYTES } from "../server-DnSzxChA.js";
11
+ import { C as composeLoopTraceEmitters, S as capDelegationTrace, _ as FileDelegationStore, a as DELEGATE_UI_AUDIT_TOOL_NAME, b as DELEGATION_TRACE_MAX_SPANS, c as DELEGATE_DESCRIPTION, d as createDelegateHandler, f as validateDelegateArgs, g as DelegationStateCorruptError, h as DelegationPersistenceError, i as DELEGATE_UI_AUDIT_INPUT_SCHEMA, l as DELEGATE_INPUT_SCHEMA, m as hashIdempotencyInput, n as createMcpServer, o as createDelegateUiAuditHandler, p as DelegationTaskQueue, r as DELEGATE_UI_AUDIT_DESCRIPTION, s as validateDelegateUiAuditArgs, t as createInProcessTransport, u as DELEGATE_TOOL_NAME, v as InMemoryDelegationStore, w as createDelegationTraceCollector, x as buildDelegationTraceSpans, y as DELEGATION_TRACE_MAX_BYTES } from "../server-Dyc1zvug.js";
12
12
  import { a as createMemoryToolServer, c as resolveMemoryFromEnv, i as MEMORY_NAME_ENV, n as MEMORY_ITEMS_ENV, o as parseMemoryItems, r as MEMORY_LOG_ENV, s as readMemoryItemsFile, t as MEMORY_FILE_ENV } from "../memory-server-DXQ8IxGR.js";
13
13
  import { agentProfileSchema } from "@tangle-network/agent-interface";
14
14
  import { randomUUID } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import { Za as OpenAIChatTool } from "./types-r7Fzum3M.js";
1
+ import { Ka as OpenAIChatTool } from "./types-D56jQad-.js";
2
2
  //#region src/mcp/openai-tools.d.ts
3
3
  /**
4
4
  *
@@ -21,4 +21,4 @@ declare function mcpToolsForRuntimeMcp(): OpenAIChatTool[];
21
21
  declare function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[];
22
22
  //#endregion
23
23
  export { mcpToolsForRuntimeMcpSubset as n, mcpToolsForRuntimeMcp as t };
24
- //# sourceMappingURL=openai-tools-D8ZYHReZ.d.ts.map
24
+ //# sourceMappingURL=openai-tools-H8QPhTVE.d.ts.map
@@ -260,5 +260,95 @@ declare class PlatformHubClient {
260
260
  private request;
261
261
  }
262
262
  //#endregion
263
- export { type AuthorizeUrlOptions, type CatalogResult, type ConnectionHealth, type ConnectionHealthResult, type ExchangeCodeResult, type ExecInput, type HealthCheck, type MintTokenInput, type MintTokenResult, PlatformAuthClient, type PlatformAuthClientOptions, PlatformAuthError, type PlatformCatalogProvider, type PlatformConnection, PlatformHubClient, type PlatformHubClientOptions, PlatformHubError, type PlatformHubStatus, type StartAuthInput, type StartAuthResult };
263
+ //#region src/platform/oidc.d.ts
264
+ /**
265
+ * Server-side OpenID Connect client for the Tangle authorization server
266
+ * (Better Auth `oauthProvider`, mounted at `/api/auth/oauth2/*`).
267
+ *
268
+ * This is the standard authorization-code + S256 PKCE path. It returns OIDC
269
+ * tokens and a verified identity, not the `sk-tan` API key that
270
+ * {@link PlatformAuthClient} returns. Identity scopes do not authorize paid
271
+ * platform calls, so a consumer that uses the legacy API key as its Hub
272
+ * bearer must keep {@link PlatformAuthClient} until it no longer needs one.
273
+ *
274
+ * The client id and redirect URI must be registered in the platform's
275
+ * `oauthClient` registry. The legacy `TRUSTED_APPS` registration does not
276
+ * carry over.
277
+ */
278
+ interface PlatformOidcClientOptions {
279
+ /** Platform base URL, e.g. `https://id.tangle.tools`. */
280
+ baseUrl: string;
281
+ /** Client id from the platform `oauthClient` registry. */
282
+ clientId: string;
283
+ /**
284
+ * Client secret for a confidential client. Sent with HTTP Basic, the
285
+ * provider's default `client_secret_basic` method. Omit for a public client
286
+ * registered with `token_endpoint_auth_method: none`.
287
+ */
288
+ clientSecret?: string;
289
+ /** Registered callback URI. */
290
+ redirectUri: string;
291
+ /** Requested scopes. Defaults to `openid profile email offline_access`. */
292
+ scope?: string;
293
+ /** Override the global fetch (useful for tests + edge runtimes). */
294
+ fetchImpl?: typeof fetch;
295
+ }
296
+ interface OidcAuthorizeUrlOptions {
297
+ /** Required CSRF token; the consumer verifies it on the callback. */
298
+ state: string;
299
+ /** RFC 7636 S256 code challenge. See {@link createPkcePair}. */
300
+ codeChallenge: string;
301
+ /** OIDC nonce; the consumer checks it against the ID token. */
302
+ nonce?: string;
303
+ prompt?: 'login' | 'consent' | 'none';
304
+ /** Pre-fill the email field on the login screen. */
305
+ loginHint?: string;
306
+ }
307
+ interface OidcTokens {
308
+ accessToken: string;
309
+ tokenType: string;
310
+ expiresIn?: number;
311
+ refreshToken?: string;
312
+ idToken?: string;
313
+ scope?: string;
314
+ }
315
+ interface OidcUser {
316
+ id: string;
317
+ email: string;
318
+ emailVerified: true;
319
+ name?: string;
320
+ }
321
+ interface OidcExchangeResult {
322
+ tokens: OidcTokens;
323
+ user: OidcUser;
324
+ }
325
+ /** Create an RFC 7636 verifier and its S256 challenge with Web Crypto. */
326
+ declare function createPkcePair(): Promise<{
327
+ verifier: string;
328
+ challenge: string;
329
+ }>;
330
+ /** Standard OIDC authorization-code + PKCE client for "Sign in with Tangle". */
331
+ declare class PlatformOidcClient {
332
+ private readonly baseUrl;
333
+ private readonly clientId;
334
+ private readonly clientSecret;
335
+ private readonly redirectUri;
336
+ private readonly scope;
337
+ private readonly fetchImpl;
338
+ constructor(options: PlatformOidcClientOptions);
339
+ /** Build the `/api/auth/oauth2/authorize` URL for a browser redirect. */
340
+ authorizeUrl(options: OidcAuthorizeUrlOptions): string;
341
+ /** Exchange the callback code, then resolve the verified identity from userinfo. */
342
+ exchange(code: string, codeVerifier: string): Promise<OidcExchangeResult>;
343
+ /** Redeem a refresh token. Store the returned refresh token; the provider rotates it. */
344
+ refresh(refreshToken: string): Promise<OidcTokens>;
345
+ /** Read the verified identity behind an access token. */
346
+ userinfo(accessToken: string): Promise<OidcUser>;
347
+ /** Revoke an access or refresh token (RFC 7009). Disconnect revokes the refresh token. */
348
+ revoke(token: string, tokenTypeHint?: 'access_token' | 'refresh_token'): Promise<void>;
349
+ private token;
350
+ private post;
351
+ }
352
+ //#endregion
353
+ export { type AuthorizeUrlOptions, type CatalogResult, type ConnectionHealth, type ConnectionHealthResult, type ExchangeCodeResult, type ExecInput, type HealthCheck, type MintTokenInput, type MintTokenResult, type OidcAuthorizeUrlOptions, type OidcExchangeResult, type OidcTokens, type OidcUser, PlatformAuthClient, type PlatformAuthClientOptions, PlatformAuthError, type PlatformCatalogProvider, type PlatformConnection, PlatformHubClient, type PlatformHubClientOptions, PlatformHubError, type PlatformHubStatus, PlatformOidcClient, type PlatformOidcClientOptions, type StartAuthInput, type StartAuthResult, createPkcePair };
264
354
  //# sourceMappingURL=platform.d.ts.map
package/dist/platform.js CHANGED
@@ -10,10 +10,10 @@ var PlatformAuthError = class extends Error {
10
10
  this.name = "PlatformAuthError";
11
11
  }
12
12
  };
13
- function isRecord(value) {
13
+ function isRecord$1(value) {
14
14
  return value !== null && typeof value === "object" && !Array.isArray(value);
15
15
  }
16
- function isNonemptyString(value) {
16
+ function isNonemptyString$1(value) {
17
17
  return typeof value === "string" && value.trim().length > 0;
18
18
  }
19
19
  /** Validate the platform's verified identity before consumers create a local session. */
@@ -21,15 +21,15 @@ function parseExchangeResult(body, status) {
21
21
  const invalid = () => {
22
22
  throw new PlatformAuthError("Platform exchange response has no valid verified identity", status, { code: "INVALID_EXCHANGE_RESPONSE" });
23
23
  };
24
- if (!isRecord(body) || !isNonemptyString(body.apiKey) || body.emailVerified !== true || !isRecord(body.user)) return invalid();
24
+ if (!isRecord$1(body) || !isNonemptyString$1(body.apiKey) || body.emailVerified !== true || !isRecord$1(body.user)) return invalid();
25
25
  const user = body.user;
26
- if (!isNonemptyString(user.id) || !isNonemptyString(user.email)) return invalid();
26
+ if (!isNonemptyString$1(user.id) || !isNonemptyString$1(user.email)) return invalid();
27
27
  const email = user.email.trim();
28
28
  if (email.length > 320 || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) || /(?:@users\.noreply\.tangle\.tools$|^0x[a-f0-9]{40}@tangle\.tools$)/i.test(email)) return invalid();
29
29
  if (user.name !== void 0 && user.name !== null && typeof user.name !== "string") return invalid();
30
30
  let plan = null;
31
31
  if (body.subscription !== void 0) {
32
- if (!isRecord(body.subscription) || !isNonemptyString(body.subscription.plan)) return invalid();
32
+ if (!isRecord$1(body.subscription) || !isNonemptyString$1(body.subscription.plan)) return invalid();
33
33
  plan = { tier: body.subscription.plan };
34
34
  }
35
35
  return {
@@ -220,6 +220,162 @@ var PlatformHubClient = class {
220
220
  }
221
221
  };
222
222
  //#endregion
223
- export { PlatformAuthClient, PlatformAuthError, PlatformHubClient, PlatformHubError };
223
+ //#region src/platform/oidc.ts
224
+ /**
225
+ * Server-side OpenID Connect client for the Tangle authorization server
226
+ * (Better Auth `oauthProvider`, mounted at `/api/auth/oauth2/*`).
227
+ *
228
+ * This is the standard authorization-code + S256 PKCE path. It returns OIDC
229
+ * tokens and a verified identity, not the `sk-tan` API key that
230
+ * {@link PlatformAuthClient} returns. Identity scopes do not authorize paid
231
+ * platform calls, so a consumer that uses the legacy API key as its Hub
232
+ * bearer must keep {@link PlatformAuthClient} until it no longer needs one.
233
+ *
234
+ * The client id and redirect URI must be registered in the platform's
235
+ * `oauthClient` registry. The legacy `TRUSTED_APPS` registration does not
236
+ * carry over.
237
+ */
238
+ const DEFAULT_SCOPE = "openid profile email offline_access";
239
+ function isRecord(value) {
240
+ return value !== null && typeof value === "object" && !Array.isArray(value);
241
+ }
242
+ function isNonemptyString(value) {
243
+ return typeof value === "string" && value.trim().length > 0;
244
+ }
245
+ function base64url(bytes) {
246
+ let binary = "";
247
+ for (const byte of bytes) binary += String.fromCharCode(byte);
248
+ return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
249
+ }
250
+ /** Create an RFC 7636 verifier and its S256 challenge with Web Crypto. */
251
+ async function createPkcePair() {
252
+ const verifier = base64url(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)));
253
+ const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(verifier));
254
+ return {
255
+ verifier,
256
+ challenge: base64url(new Uint8Array(digest))
257
+ };
258
+ }
259
+ function oauthError(body, fallback) {
260
+ if (!isRecord(body)) return fallback;
261
+ if (isNonemptyString(body.error_description)) return body.error_description;
262
+ if (isNonemptyString(body.error)) return body.error;
263
+ return fallback;
264
+ }
265
+ function parseTokens(body, status) {
266
+ if (!isRecord(body) || !isNonemptyString(body.access_token)) throw new PlatformAuthError("Platform token response is malformed", status, { code: "INVALID_TOKEN_RESPONSE" });
267
+ return {
268
+ accessToken: body.access_token,
269
+ tokenType: isNonemptyString(body.token_type) ? body.token_type : "Bearer",
270
+ ...typeof body.expires_in === "number" ? { expiresIn: body.expires_in } : {},
271
+ ...isNonemptyString(body.refresh_token) ? { refreshToken: body.refresh_token } : {},
272
+ ...isNonemptyString(body.id_token) ? { idToken: body.id_token } : {},
273
+ ...isNonemptyString(body.scope) ? { scope: body.scope } : {}
274
+ };
275
+ }
276
+ /** Standard OIDC authorization-code + PKCE client for "Sign in with Tangle". */
277
+ var PlatformOidcClient = class {
278
+ baseUrl;
279
+ clientId;
280
+ clientSecret;
281
+ redirectUri;
282
+ scope;
283
+ fetchImpl;
284
+ constructor(options) {
285
+ if (!options.baseUrl) throw new Error("PlatformOidcClient: baseUrl is required");
286
+ if (!options.clientId) throw new Error("PlatformOidcClient: clientId is required");
287
+ if (!options.redirectUri) throw new Error("PlatformOidcClient: redirectUri is required");
288
+ this.baseUrl = options.baseUrl.replace(/\/+$/, "");
289
+ this.clientId = options.clientId;
290
+ this.clientSecret = options.clientSecret || void 0;
291
+ this.redirectUri = options.redirectUri;
292
+ this.scope = options.scope ?? DEFAULT_SCOPE;
293
+ this.fetchImpl = options.fetchImpl ?? ((url, init) => fetch(url, init));
294
+ }
295
+ /** Build the `/api/auth/oauth2/authorize` URL for a browser redirect. */
296
+ authorizeUrl(options) {
297
+ if (!options.state) throw new Error("PlatformOidcClient.authorizeUrl: state is required for CSRF");
298
+ if (!options.codeChallenge) throw new Error("PlatformOidcClient.authorizeUrl: codeChallenge is required for PKCE");
299
+ const url = new URL("/api/auth/oauth2/authorize", this.baseUrl);
300
+ url.searchParams.set("client_id", this.clientId);
301
+ url.searchParams.set("redirect_uri", this.redirectUri);
302
+ url.searchParams.set("response_type", "code");
303
+ url.searchParams.set("scope", this.scope);
304
+ url.searchParams.set("state", options.state);
305
+ url.searchParams.set("code_challenge", options.codeChallenge);
306
+ url.searchParams.set("code_challenge_method", "S256");
307
+ if (options.nonce) url.searchParams.set("nonce", options.nonce);
308
+ if (options.prompt) url.searchParams.set("prompt", options.prompt);
309
+ if (options.loginHint) url.searchParams.set("login_hint", options.loginHint);
310
+ return url.toString();
311
+ }
312
+ /** Exchange the callback code, then resolve the verified identity from userinfo. */
313
+ async exchange(code, codeVerifier) {
314
+ if (!code) throw new Error("PlatformOidcClient.exchange: code is required");
315
+ if (!codeVerifier) throw new Error("PlatformOidcClient.exchange: codeVerifier is required for PKCE");
316
+ const tokens = await this.token({
317
+ grant_type: "authorization_code",
318
+ code,
319
+ redirect_uri: this.redirectUri,
320
+ code_verifier: codeVerifier
321
+ });
322
+ return {
323
+ tokens,
324
+ user: await this.userinfo(tokens.accessToken)
325
+ };
326
+ }
327
+ /** Redeem a refresh token. Store the returned refresh token; the provider rotates it. */
328
+ async refresh(refreshToken) {
329
+ if (!refreshToken) throw new Error("PlatformOidcClient.refresh: refreshToken is required");
330
+ return this.token({
331
+ grant_type: "refresh_token",
332
+ refresh_token: refreshToken
333
+ });
334
+ }
335
+ /** Read the verified identity behind an access token. */
336
+ async userinfo(accessToken) {
337
+ const res = await this.fetchImpl(`${this.baseUrl}/api/auth/oauth2/userinfo`, { headers: { authorization: `Bearer ${accessToken}` } });
338
+ const body = await res.json().catch(() => null);
339
+ if (!res.ok) throw new PlatformAuthError(oauthError(body, `Platform userinfo failed (${res.status})`), res.status, body);
340
+ if (!isRecord(body) || !isNonemptyString(body.sub) || !isNonemptyString(body.email) || body.email_verified !== true) throw new PlatformAuthError("Platform userinfo has no verified identity", res.status, { code: "INVALID_USERINFO_RESPONSE" });
341
+ return {
342
+ id: body.sub,
343
+ email: body.email,
344
+ emailVerified: true,
345
+ ...isNonemptyString(body.name) ? { name: body.name } : {}
346
+ };
347
+ }
348
+ /** Revoke an access or refresh token (RFC 7009). Disconnect revokes the refresh token. */
349
+ async revoke(token, tokenTypeHint) {
350
+ if (!token) throw new Error("PlatformOidcClient.revoke: token is required");
351
+ const res = await this.post("/api/auth/oauth2/revoke", {
352
+ token,
353
+ ...tokenTypeHint ? { token_type_hint: tokenTypeHint } : {}
354
+ });
355
+ if (!res.ok) {
356
+ const body = await res.json().catch(() => null);
357
+ throw new PlatformAuthError(oauthError(body, `Platform revoke failed (${res.status})`), res.status, body);
358
+ }
359
+ }
360
+ async token(params) {
361
+ const res = await this.post("/api/auth/oauth2/token", params);
362
+ const body = await res.json().catch(() => null);
363
+ if (!res.ok) throw new PlatformAuthError(oauthError(body, `Platform token request failed (${res.status})`), res.status, body);
364
+ return parseTokens(body, res.status);
365
+ }
366
+ post(path, params) {
367
+ const body = new URLSearchParams(params);
368
+ const headers = { "content-type": "application/x-www-form-urlencoded" };
369
+ if (this.clientSecret) headers.authorization = `Basic ${btoa(`${this.clientId}:${this.clientSecret}`)}`;
370
+ else body.set("client_id", this.clientId);
371
+ return this.fetchImpl(`${this.baseUrl}${path}`, {
372
+ method: "POST",
373
+ headers,
374
+ body
375
+ });
376
+ }
377
+ };
378
+ //#endregion
379
+ export { PlatformAuthClient, PlatformAuthError, PlatformHubClient, PlatformHubError, PlatformOidcClient, createPkcePair };
224
380
 
225
381
  //# sourceMappingURL=platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","names":[],"sources":["../src/platform/auth.ts","../src/platform/integrations.ts"],"sourcesContent":["/**\n * Server-side client for the Tangle platform's cross-site SSO bridge.\n *\n * Consumer apps (gtm-agent, tax-agent, legal-agent, creative-agent, …)\n * use this to:\n * 1. Build an /authorize URL that lands the user on id.tangle.tools\n * and brings them back with a single-use code.\n * 2. Exchange that code for an API key + the user's identity.\n *\n * The platform endpoint contract is documented in\n * `products/platform/api/src/routes/cross-site.ts`. This client only\n * speaks HTTP — no SDK weight, no transitive deps.\n */\n\nexport interface PlatformAuthClientOptions {\n /** Platform base URL, e.g. `https://id.tangle.tools`. */\n baseUrl: string\n /** App id as registered in the platform's TRUSTED_APPS registry. */\n appId: string\n /** Override the global fetch (useful for tests + edge runtimes). */\n fetchImpl?: typeof fetch\n}\n\nexport interface AuthorizeUrlOptions {\n /** Required CSRF token; the consumer verifies it on the callback. */\n state: string\n /**\n * Final redirect URI. Must be one of the URIs registered for `appId`\n * on the platform. Omit to use the first registered URI.\n */\n redirectUri?: string\n /** Force the login screen even if a session is already active. */\n prompt?: 'login'\n /** Pre-fill the email field on the login screen. */\n email?: string\n}\n\nexport interface ExchangeCodeResult {\n apiKey: string\n emailVerified: true\n user: {\n id: string\n email: string\n name?: string | null\n }\n /** Null when the platform could not provide a subscription. This is not a paid-access grant. */\n plan: {\n tier: string\n } | null\n}\n\n/** Thrown when a `PlatformAuthClient` request returns a non-success status. */\nexport class PlatformAuthError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly body: unknown,\n ) {\n super(message)\n this.name = 'PlatformAuthError'\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction isNonemptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0\n}\n\n/** Validate the platform's verified identity before consumers create a local session. */\nfunction parseExchangeResult(body: unknown, status: number): ExchangeCodeResult {\n const invalid = (): never => {\n // A successful but malformed response can contain the one-time API secret.\n throw new PlatformAuthError(\n 'Platform exchange response has no valid verified identity',\n status,\n { code: 'INVALID_EXCHANGE_RESPONSE' },\n )\n }\n if (\n !isRecord(body) ||\n !isNonemptyString(body.apiKey) ||\n body.emailVerified !== true ||\n !isRecord(body.user)\n )\n return invalid()\n const user = body.user\n if (!isNonemptyString(user.id) || !isNonemptyString(user.email)) return invalid()\n const email = user.email.trim()\n if (\n email.length > 320 ||\n !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email) ||\n /(?:@users\\.noreply\\.tangle\\.tools$|^0x[a-f0-9]{40}@tangle\\.tools$)/i.test(email)\n )\n return invalid()\n if (user.name !== undefined && user.name !== null && typeof user.name !== 'string')\n return invalid()\n let plan: ExchangeCodeResult['plan'] = null\n if (body.subscription !== undefined) {\n if (!isRecord(body.subscription) || !isNonemptyString(body.subscription.plan)) return invalid()\n plan = { tier: body.subscription.plan }\n }\n return {\n apiKey: body.apiKey,\n emailVerified: true,\n user: { id: user.id, email, ...(user.name !== undefined ? { name: user.name } : {}) },\n plan,\n }\n}\n\n/** HTTP client for the Tangle Platform SSO: builds authorize URLs and exchanges auth codes for API keys. */\nexport class PlatformAuthClient {\n private readonly baseUrl: string\n private readonly appId: string\n private readonly fetchImpl: typeof fetch\n\n constructor(options: PlatformAuthClientOptions) {\n if (!options.baseUrl) throw new Error('PlatformAuthClient: baseUrl is required')\n if (!options.appId) throw new Error('PlatformAuthClient: appId is required')\n this.baseUrl = options.baseUrl.replace(/\\/+$/, '')\n this.appId = options.appId\n this.fetchImpl =\n options.fetchImpl ??\n ((url: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => fetch(url, init))\n }\n\n /**\n * Build the URL the user is redirected to in order to start SSO.\n * The platform redirects back to one of `appId`'s registered\n * `redirectUris` with `?code=...&app=...&state=...`.\n */\n authorizeUrl(options: AuthorizeUrlOptions): string {\n if (!options.state) {\n throw new Error('PlatformAuthClient.authorizeUrl: state is required for CSRF')\n }\n const url = new URL('/cross-site/authorize', this.baseUrl)\n url.searchParams.set('app', this.appId)\n url.searchParams.set('state', options.state)\n if (options.redirectUri) url.searchParams.set('redirect', options.redirectUri)\n if (options.prompt) url.searchParams.set('prompt', options.prompt)\n if (options.email) url.searchParams.set('email', options.email)\n return url.toString()\n }\n\n /**\n * Exchange a single-use auth code (delivered to the consumer's\n * callback by the platform) for an API key + the user's identity.\n * Codes are single-use and expire ~5 minutes after issue.\n */\n async exchange(code: string): Promise<ExchangeCodeResult> {\n if (!code) throw new Error('PlatformAuthClient.exchange: code is required')\n const res = await this.fetchImpl(`${this.baseUrl}/cross-site/exchange`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ code, app: this.appId }),\n })\n const body = await res.json().catch(() => null)\n if (!res.ok) {\n const message =\n body && typeof body === 'object' && 'error' in body && typeof body.error === 'string'\n ? body.error\n : `Platform exchange failed (${res.status})`\n throw new PlatformAuthError(message, res.status, body)\n }\n return parseExchangeResult(body, res.status)\n }\n}\n","/**\n * Server-side client for the Tangle platform's integration hub\n * (`/v1/hub/*`). Consumer apps use this instead of rolling their own\n * OAuth + connection tables.\n *\n * Auth: the caller supplies a bearer (either the user's API key from\n * cross-site exchange, or a platform service token) on construction.\n *\n * Endpoint contract (authoritative): the platform's `src/lib/hub-contract.ts`\n * + `src/routes/hub.ts`. The platform wraps every response in\n * `{ success, data }`; non-2xx or `success:false` surfaces as `PlatformHubError`\n * carrying the real upstream status.\n */\n\nexport interface PlatformHubClientOptions {\n /** Platform base URL, e.g. `https://id.tangle.tools`. */\n baseUrl: string\n /** Bearer credential — user API key or service token. */\n bearer: string\n /** Override fetch (tests + edge runtimes). */\n fetchImpl?: typeof fetch\n}\n\n/** A live integration connection, as returned by `/v1/hub/connections`. */\nexport interface PlatformConnection {\n id: string\n providerId: string\n displayName: string\n accountDisplay: string | null\n scopes: string[]\n status: 'active' | 'revoked' | 'unhealthy' | 'reconnect_required' | (string & {})\n health: 'unknown' | 'healthy' | 'unhealthy' | 'rate_limited' | (string & {})\n createdAt: string\n updatedAt: string\n lastUsedAt: string | null\n}\n\n/** A connectable provider in the catalog (`/v1/hub/providers`). */\nexport interface PlatformCatalogProvider {\n providerId: string\n title?: string\n authKind?: string\n category?: string\n scopes?: string[]\n capabilityCount?: number\n native?: boolean\n /** Whether the OAuth app's credentials are wired — the UI offers Connect\n * only when true. */\n configured?: boolean\n [k: string]: unknown\n}\n\nexport interface CatalogResult {\n providers: PlatformCatalogProvider[]\n /** Count of substrate-bundled connectors behind the catalog. */\n substrateBundled?: number\n [k: string]: unknown\n}\n\nexport interface StartAuthInput {\n /** The provider to connect (goes in the URL path). */\n providerId: string\n /** Accepted for interface compatibility; the platform's start endpoint is\n * provider-level and does not consume a connector id. */\n connectorId?: string\n /** Where the platform redirects the user back to after OAuth. */\n returnUrl: string\n /** Accepted for interface compatibility; not consumed by the start endpoint. */\n requestedScopes?: string[]\n /** CLI flow flag — affects the platform's post-auth redirect handling. */\n cli?: boolean\n}\n\nexport interface StartAuthResult {\n /** The URL to send the user to. Normalized across the platform's two start\n * branches: github returns `authorizationUrl`, substrate returns\n * `redirectUrl`. */\n authorizationUrl: string\n state: string\n expiresAt?: string\n scopes?: string[]\n}\n\nexport interface ConnectionHealth {\n status: 'unknown' | 'healthy' | 'unhealthy' | 'rate_limited' | (string & {})\n checkedAt: string\n error?: { code: string; message: string }\n}\n\nexport interface ConnectionHealthResult {\n connection: PlatformConnection\n health: ConnectionHealth\n}\n\n/** Last-known health for a connection, derived from the connection row. */\nexport interface HealthCheck {\n connectionId: string\n providerId: string\n /** Mirrors `PlatformConnection.health`. */\n status: ConnectionHealth['status']\n checkedAt?: string\n}\n\nexport interface MintTokenInput {\n /** The hub action the token authorizes (e.g. `slack.chat.postMessage`). */\n actionPath: string\n /** Bind to a specific connection, or … */\n connectionId?: string\n /** … resolve the connection by provider for the calling user. */\n provider?: string\n}\n\nexport interface MintTokenResult {\n tokenId: string\n token: string\n expiresAt: string\n}\n\nexport interface ExecInput {\n /** The hub action path to execute. */\n path: string\n input?: unknown\n connectionId?: string\n}\n\nexport interface PlatformHubStatus {\n contract?: unknown\n principal: { kind: string; userId: string; [k: string]: unknown }\n connections: { connectedProviderCount: number; unhealthyProviderCount: number }\n}\n\n/** Thrown when a `PlatformHubClient` request returns a non-success status. */\nexport class PlatformHubError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code: string | undefined,\n public readonly body: unknown,\n ) {\n super(message)\n this.name = 'PlatformHubError'\n }\n}\n\ninterface PlatformEnvelope<T> {\n success: boolean\n data?: T\n error?: { code?: string; message?: string } | string\n}\n\n/** HTTP client for the Tangle Platform Hub API: provider catalog, connection flow, and status. */\nexport class PlatformHubClient {\n private readonly baseUrl: string\n private readonly bearer: string\n private readonly fetchImpl: typeof fetch\n\n constructor(options: PlatformHubClientOptions) {\n if (!options.baseUrl) throw new Error('PlatformHubClient: baseUrl is required')\n if (!options.bearer) throw new Error('PlatformHubClient: bearer is required')\n this.baseUrl = options.baseUrl.replace(/\\/+$/, '')\n this.bearer = options.bearer\n this.fetchImpl =\n options.fetchImpl ??\n ((url: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => fetch(url, init))\n }\n\n /** GET /v1/hub/providers — the connectable provider catalog. */\n catalog(): Promise<CatalogResult> {\n return this.request('GET', '/v1/hub/providers')\n }\n\n /** GET /v1/hub/connections — the calling user's live connections. */\n async listConnections(): Promise<PlatformConnection[]> {\n const data = await this.request<{ connections: PlatformConnection[] }>(\n 'GET',\n '/v1/hub/connections',\n )\n return data.connections\n }\n\n /** DELETE /v1/hub/connections/:connectionId — revoke + disable a connection. */\n revokeConnection(connectionId: string): Promise<{ connection: PlatformConnection }> {\n return this.request('DELETE', `/v1/hub/connections/${encodeURIComponent(connectionId)}`)\n }\n\n /**\n * POST /v1/hub/connections/:provider/start — begin OAuth/grant. The provider\n * is taken from the URL; the body carries `returnUrl` (+ `cli`). The platform's\n * two start branches name the URL field differently (github → `authorizationUrl`,\n * substrate → `redirectUrl`); this normalizes to `authorizationUrl`.\n */\n async startAuth(input: StartAuthInput): Promise<StartAuthResult> {\n const body: { returnUrl: string; cli?: boolean } = { returnUrl: input.returnUrl }\n if (input.cli !== undefined) body.cli = input.cli\n const data = await this.request<{\n authorizationUrl?: string\n redirectUrl?: string\n state: string\n expiresAt?: string\n scopes?: string[]\n }>('POST', `/v1/hub/connections/${encodeURIComponent(input.providerId)}/start`, body)\n const authorizationUrl = data.authorizationUrl ?? data.redirectUrl\n if (!authorizationUrl) {\n throw new PlatformHubError(\n 'Platform hub start response missing an authorization URL',\n 502,\n 'HUB_INVALID_START_RESPONSE',\n data,\n )\n }\n return { authorizationUrl, state: data.state, expiresAt: data.expiresAt, scopes: data.scopes }\n }\n\n /**\n * Last-known health for every connection. The platform has no global\n * healthcheck listing — health rides on each connection row — so this derives\n * the list from `listConnections()` (one request, no extra round-trips).\n */\n async listHealthchecks(): Promise<HealthCheck[]> {\n const connections = await this.listConnections()\n return connections.map((c) => ({\n connectionId: c.id,\n providerId: c.providerId,\n status: c.health,\n checkedAt: c.updatedAt,\n }))\n }\n\n /**\n * POST /v1/hub/connections/:connectionId/health — trigger a fresh health\n * probe for one connection and return its updated state.\n */\n checkConnectionHealth(connectionId: string): Promise<ConnectionHealthResult> {\n return this.request('POST', `/v1/hub/connections/${encodeURIComponent(connectionId)}/health`)\n }\n\n /**\n * Trigger a fresh health probe across all of the user's connections. The\n * platform exposes health per-connection only, so this fans out over\n * `listConnections()`. `scheduled` is the number of probes dispatched.\n */\n async runHealthchecks(): Promise<{ scheduled: number }> {\n const connections = await this.listConnections()\n await Promise.allSettled(connections.map((c) => this.checkConnectionHealth(c.id)))\n return { scheduled: connections.length }\n }\n\n /** GET /v1/hub/status — principal + aggregate connection counts. */\n status(): Promise<PlatformHubStatus> {\n return this.request('GET', '/v1/hub/status')\n }\n\n /**\n * POST /v1/hub/tokens — mint a short-lived, action-scoped capability token a\n * sandbox can use to invoke one hub action on the user's behalf without\n * seeing the underlying provider credential.\n */\n mintToken(input: MintTokenInput): Promise<MintTokenResult> {\n return this.request('POST', '/v1/hub/tokens', input)\n }\n\n /** POST /v1/hub/exec — execute a hub action and return its result. */\n async exec(input: ExecInput): Promise<unknown> {\n const data = await this.request<{ result: unknown }>('POST', '/v1/hub/exec', input)\n return data.result\n }\n\n private async request<T>(\n method: 'GET' | 'POST' | 'DELETE' | 'PUT',\n path: string,\n body?: unknown,\n ): Promise<T> {\n const headers: Record<string, string> = {\n authorization: `Bearer ${this.bearer}`,\n accept: 'application/json',\n }\n if (body !== undefined) headers['content-type'] = 'application/json'\n\n const res = await this.fetchImpl(`${this.baseUrl}${path}`, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n })\n const text = await res.text()\n let parsed: PlatformEnvelope<T> | null = null\n if (text) {\n try {\n parsed = JSON.parse(text)\n } catch {\n // fall through to error handling below\n }\n }\n if (!res.ok || (parsed && parsed.success === false)) {\n const code = parsed?.error && typeof parsed.error === 'object' ? parsed.error.code : undefined\n const message =\n (parsed?.error && typeof parsed.error === 'object' && parsed.error.message) ||\n (typeof parsed?.error === 'string' ? parsed.error : `Platform hub error (${res.status})`)\n throw new PlatformHubError(message, res.status, code, parsed ?? text)\n }\n if (!parsed) {\n throw new PlatformHubError(\n `Platform hub returned non-JSON success (${res.status})`,\n res.status,\n undefined,\n text,\n )\n }\n if (parsed.data === undefined) {\n throw new PlatformHubError(\n 'Platform hub envelope missing `data`',\n res.status,\n undefined,\n parsed,\n )\n }\n return parsed.data\n }\n}\n"],"mappings":";;AAoDA,IAAa,oBAAb,cAAuC,MAAM;CAGzB;CACA;CAHlB,YACE,SACA,QACA,MACA;EACA,MAAM,OAAO;EAHG,KAAA,SAAA;EACA,KAAA,OAAA;EAGhB,KAAK,OAAO;CACd;AACF;AAEA,SAAS,SAAS,OAAkD;CAClE,OAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,iBAAiB,OAAiC;CACzD,OAAO,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,SAAS;AAC5D;;AAGA,SAAS,oBAAoB,MAAe,QAAoC;CAC9E,MAAM,gBAAuB;EAE3B,M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AAS,KAAA,GAClB,MAAM,IAAI,iBACR,wCACA,IAAI,QACJ,KAAA,GACA,MACF;EAEF,OAAO,OAAO;CAChB;AACF"}
1
+ {"version":3,"file":"platform.js","names":["isRecord","isNonemptyString"],"sources":["../src/platform/auth.ts","../src/platform/integrations.ts","../src/platform/oidc.ts"],"sourcesContent":["/**\n * Server-side client for the Tangle platform's cross-site SSO bridge.\n *\n * Consumer apps (gtm-agent, tax-agent, legal-agent, creative-agent, …)\n * use this to:\n * 1. Build an /authorize URL that lands the user on id.tangle.tools\n * and brings them back with a single-use code.\n * 2. Exchange that code for an API key + the user's identity.\n *\n * The platform endpoint contract is documented in\n * `products/platform/api/src/routes/cross-site.ts`. This client only\n * speaks HTTP — no SDK weight, no transitive deps.\n */\n\nexport interface PlatformAuthClientOptions {\n /** Platform base URL, e.g. `https://id.tangle.tools`. */\n baseUrl: string\n /** App id as registered in the platform's TRUSTED_APPS registry. */\n appId: string\n /** Override the global fetch (useful for tests + edge runtimes). */\n fetchImpl?: typeof fetch\n}\n\nexport interface AuthorizeUrlOptions {\n /** Required CSRF token; the consumer verifies it on the callback. */\n state: string\n /**\n * Final redirect URI. Must be one of the URIs registered for `appId`\n * on the platform. Omit to use the first registered URI.\n */\n redirectUri?: string\n /** Force the login screen even if a session is already active. */\n prompt?: 'login'\n /** Pre-fill the email field on the login screen. */\n email?: string\n}\n\nexport interface ExchangeCodeResult {\n apiKey: string\n emailVerified: true\n user: {\n id: string\n email: string\n name?: string | null\n }\n /** Null when the platform could not provide a subscription. This is not a paid-access grant. */\n plan: {\n tier: string\n } | null\n}\n\n/** Thrown when a `PlatformAuthClient` request returns a non-success status. */\nexport class PlatformAuthError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly body: unknown,\n ) {\n super(message)\n this.name = 'PlatformAuthError'\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction isNonemptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0\n}\n\n/** Validate the platform's verified identity before consumers create a local session. */\nfunction parseExchangeResult(body: unknown, status: number): ExchangeCodeResult {\n const invalid = (): never => {\n // A successful but malformed response can contain the one-time API secret.\n throw new PlatformAuthError(\n 'Platform exchange response has no valid verified identity',\n status,\n { code: 'INVALID_EXCHANGE_RESPONSE' },\n )\n }\n if (\n !isRecord(body) ||\n !isNonemptyString(body.apiKey) ||\n body.emailVerified !== true ||\n !isRecord(body.user)\n )\n return invalid()\n const user = body.user\n if (!isNonemptyString(user.id) || !isNonemptyString(user.email)) return invalid()\n const email = user.email.trim()\n if (\n email.length > 320 ||\n !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email) ||\n /(?:@users\\.noreply\\.tangle\\.tools$|^0x[a-f0-9]{40}@tangle\\.tools$)/i.test(email)\n )\n return invalid()\n if (user.name !== undefined && user.name !== null && typeof user.name !== 'string')\n return invalid()\n let plan: ExchangeCodeResult['plan'] = null\n if (body.subscription !== undefined) {\n if (!isRecord(body.subscription) || !isNonemptyString(body.subscription.plan)) return invalid()\n plan = { tier: body.subscription.plan }\n }\n return {\n apiKey: body.apiKey,\n emailVerified: true,\n user: { id: user.id, email, ...(user.name !== undefined ? { name: user.name } : {}) },\n plan,\n }\n}\n\n/** HTTP client for the Tangle Platform SSO: builds authorize URLs and exchanges auth codes for API keys. */\nexport class PlatformAuthClient {\n private readonly baseUrl: string\n private readonly appId: string\n private readonly fetchImpl: typeof fetch\n\n constructor(options: PlatformAuthClientOptions) {\n if (!options.baseUrl) throw new Error('PlatformAuthClient: baseUrl is required')\n if (!options.appId) throw new Error('PlatformAuthClient: appId is required')\n this.baseUrl = options.baseUrl.replace(/\\/+$/, '')\n this.appId = options.appId\n this.fetchImpl =\n options.fetchImpl ??\n ((url: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => fetch(url, init))\n }\n\n /**\n * Build the URL the user is redirected to in order to start SSO.\n * The platform redirects back to one of `appId`'s registered\n * `redirectUris` with `?code=...&app=...&state=...`.\n */\n authorizeUrl(options: AuthorizeUrlOptions): string {\n if (!options.state) {\n throw new Error('PlatformAuthClient.authorizeUrl: state is required for CSRF')\n }\n const url = new URL('/cross-site/authorize', this.baseUrl)\n url.searchParams.set('app', this.appId)\n url.searchParams.set('state', options.state)\n if (options.redirectUri) url.searchParams.set('redirect', options.redirectUri)\n if (options.prompt) url.searchParams.set('prompt', options.prompt)\n if (options.email) url.searchParams.set('email', options.email)\n return url.toString()\n }\n\n /**\n * Exchange a single-use auth code (delivered to the consumer's\n * callback by the platform) for an API key + the user's identity.\n * Codes are single-use and expire ~5 minutes after issue.\n */\n async exchange(code: string): Promise<ExchangeCodeResult> {\n if (!code) throw new Error('PlatformAuthClient.exchange: code is required')\n const res = await this.fetchImpl(`${this.baseUrl}/cross-site/exchange`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ code, app: this.appId }),\n })\n const body = await res.json().catch(() => null)\n if (!res.ok) {\n const message =\n body && typeof body === 'object' && 'error' in body && typeof body.error === 'string'\n ? body.error\n : `Platform exchange failed (${res.status})`\n throw new PlatformAuthError(message, res.status, body)\n }\n return parseExchangeResult(body, res.status)\n }\n}\n","/**\n * Server-side client for the Tangle platform's integration hub\n * (`/v1/hub/*`). Consumer apps use this instead of rolling their own\n * OAuth + connection tables.\n *\n * Auth: the caller supplies a bearer (either the user's API key from\n * cross-site exchange, or a platform service token) on construction.\n *\n * Endpoint contract (authoritative): the platform's `src/lib/hub-contract.ts`\n * + `src/routes/hub.ts`. The platform wraps every response in\n * `{ success, data }`; non-2xx or `success:false` surfaces as `PlatformHubError`\n * carrying the real upstream status.\n */\n\nexport interface PlatformHubClientOptions {\n /** Platform base URL, e.g. `https://id.tangle.tools`. */\n baseUrl: string\n /** Bearer credential — user API key or service token. */\n bearer: string\n /** Override fetch (tests + edge runtimes). */\n fetchImpl?: typeof fetch\n}\n\n/** A live integration connection, as returned by `/v1/hub/connections`. */\nexport interface PlatformConnection {\n id: string\n providerId: string\n displayName: string\n accountDisplay: string | null\n scopes: string[]\n status: 'active' | 'revoked' | 'unhealthy' | 'reconnect_required' | (string & {})\n health: 'unknown' | 'healthy' | 'unhealthy' | 'rate_limited' | (string & {})\n createdAt: string\n updatedAt: string\n lastUsedAt: string | null\n}\n\n/** A connectable provider in the catalog (`/v1/hub/providers`). */\nexport interface PlatformCatalogProvider {\n providerId: string\n title?: string\n authKind?: string\n category?: string\n scopes?: string[]\n capabilityCount?: number\n native?: boolean\n /** Whether the OAuth app's credentials are wired — the UI offers Connect\n * only when true. */\n configured?: boolean\n [k: string]: unknown\n}\n\nexport interface CatalogResult {\n providers: PlatformCatalogProvider[]\n /** Count of substrate-bundled connectors behind the catalog. */\n substrateBundled?: number\n [k: string]: unknown\n}\n\nexport interface StartAuthInput {\n /** The provider to connect (goes in the URL path). */\n providerId: string\n /** Accepted for interface compatibility; the platform's start endpoint is\n * provider-level and does not consume a connector id. */\n connectorId?: string\n /** Where the platform redirects the user back to after OAuth. */\n returnUrl: string\n /** Accepted for interface compatibility; not consumed by the start endpoint. */\n requestedScopes?: string[]\n /** CLI flow flag — affects the platform's post-auth redirect handling. */\n cli?: boolean\n}\n\nexport interface StartAuthResult {\n /** The URL to send the user to. Normalized across the platform's two start\n * branches: github returns `authorizationUrl`, substrate returns\n * `redirectUrl`. */\n authorizationUrl: string\n state: string\n expiresAt?: string\n scopes?: string[]\n}\n\nexport interface ConnectionHealth {\n status: 'unknown' | 'healthy' | 'unhealthy' | 'rate_limited' | (string & {})\n checkedAt: string\n error?: { code: string; message: string }\n}\n\nexport interface ConnectionHealthResult {\n connection: PlatformConnection\n health: ConnectionHealth\n}\n\n/** Last-known health for a connection, derived from the connection row. */\nexport interface HealthCheck {\n connectionId: string\n providerId: string\n /** Mirrors `PlatformConnection.health`. */\n status: ConnectionHealth['status']\n checkedAt?: string\n}\n\nexport interface MintTokenInput {\n /** The hub action the token authorizes (e.g. `slack.chat.postMessage`). */\n actionPath: string\n /** Bind to a specific connection, or … */\n connectionId?: string\n /** … resolve the connection by provider for the calling user. */\n provider?: string\n}\n\nexport interface MintTokenResult {\n tokenId: string\n token: string\n expiresAt: string\n}\n\nexport interface ExecInput {\n /** The hub action path to execute. */\n path: string\n input?: unknown\n connectionId?: string\n}\n\nexport interface PlatformHubStatus {\n contract?: unknown\n principal: { kind: string; userId: string; [k: string]: unknown }\n connections: { connectedProviderCount: number; unhealthyProviderCount: number }\n}\n\n/** Thrown when a `PlatformHubClient` request returns a non-success status. */\nexport class PlatformHubError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code: string | undefined,\n public readonly body: unknown,\n ) {\n super(message)\n this.name = 'PlatformHubError'\n }\n}\n\ninterface PlatformEnvelope<T> {\n success: boolean\n data?: T\n error?: { code?: string; message?: string } | string\n}\n\n/** HTTP client for the Tangle Platform Hub API: provider catalog, connection flow, and status. */\nexport class PlatformHubClient {\n private readonly baseUrl: string\n private readonly bearer: string\n private readonly fetchImpl: typeof fetch\n\n constructor(options: PlatformHubClientOptions) {\n if (!options.baseUrl) throw new Error('PlatformHubClient: baseUrl is required')\n if (!options.bearer) throw new Error('PlatformHubClient: bearer is required')\n this.baseUrl = options.baseUrl.replace(/\\/+$/, '')\n this.bearer = options.bearer\n this.fetchImpl =\n options.fetchImpl ??\n ((url: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => fetch(url, init))\n }\n\n /** GET /v1/hub/providers — the connectable provider catalog. */\n catalog(): Promise<CatalogResult> {\n return this.request('GET', '/v1/hub/providers')\n }\n\n /** GET /v1/hub/connections — the calling user's live connections. */\n async listConnections(): Promise<PlatformConnection[]> {\n const data = await this.request<{ connections: PlatformConnection[] }>(\n 'GET',\n '/v1/hub/connections',\n )\n return data.connections\n }\n\n /** DELETE /v1/hub/connections/:connectionId — revoke + disable a connection. */\n revokeConnection(connectionId: string): Promise<{ connection: PlatformConnection }> {\n return this.request('DELETE', `/v1/hub/connections/${encodeURIComponent(connectionId)}`)\n }\n\n /**\n * POST /v1/hub/connections/:provider/start — begin OAuth/grant. The provider\n * is taken from the URL; the body carries `returnUrl` (+ `cli`). The platform's\n * two start branches name the URL field differently (github → `authorizationUrl`,\n * substrate → `redirectUrl`); this normalizes to `authorizationUrl`.\n */\n async startAuth(input: StartAuthInput): Promise<StartAuthResult> {\n const body: { returnUrl: string; cli?: boolean } = { returnUrl: input.returnUrl }\n if (input.cli !== undefined) body.cli = input.cli\n const data = await this.request<{\n authorizationUrl?: string\n redirectUrl?: string\n state: string\n expiresAt?: string\n scopes?: string[]\n }>('POST', `/v1/hub/connections/${encodeURIComponent(input.providerId)}/start`, body)\n const authorizationUrl = data.authorizationUrl ?? data.redirectUrl\n if (!authorizationUrl) {\n throw new PlatformHubError(\n 'Platform hub start response missing an authorization URL',\n 502,\n 'HUB_INVALID_START_RESPONSE',\n data,\n )\n }\n return { authorizationUrl, state: data.state, expiresAt: data.expiresAt, scopes: data.scopes }\n }\n\n /**\n * Last-known health for every connection. The platform has no global\n * healthcheck listing — health rides on each connection row — so this derives\n * the list from `listConnections()` (one request, no extra round-trips).\n */\n async listHealthchecks(): Promise<HealthCheck[]> {\n const connections = await this.listConnections()\n return connections.map((c) => ({\n connectionId: c.id,\n providerId: c.providerId,\n status: c.health,\n checkedAt: c.updatedAt,\n }))\n }\n\n /**\n * POST /v1/hub/connections/:connectionId/health — trigger a fresh health\n * probe for one connection and return its updated state.\n */\n checkConnectionHealth(connectionId: string): Promise<ConnectionHealthResult> {\n return this.request('POST', `/v1/hub/connections/${encodeURIComponent(connectionId)}/health`)\n }\n\n /**\n * Trigger a fresh health probe across all of the user's connections. The\n * platform exposes health per-connection only, so this fans out over\n * `listConnections()`. `scheduled` is the number of probes dispatched.\n */\n async runHealthchecks(): Promise<{ scheduled: number }> {\n const connections = await this.listConnections()\n await Promise.allSettled(connections.map((c) => this.checkConnectionHealth(c.id)))\n return { scheduled: connections.length }\n }\n\n /** GET /v1/hub/status — principal + aggregate connection counts. */\n status(): Promise<PlatformHubStatus> {\n return this.request('GET', '/v1/hub/status')\n }\n\n /**\n * POST /v1/hub/tokens — mint a short-lived, action-scoped capability token a\n * sandbox can use to invoke one hub action on the user's behalf without\n * seeing the underlying provider credential.\n */\n mintToken(input: MintTokenInput): Promise<MintTokenResult> {\n return this.request('POST', '/v1/hub/tokens', input)\n }\n\n /** POST /v1/hub/exec — execute a hub action and return its result. */\n async exec(input: ExecInput): Promise<unknown> {\n const data = await this.request<{ result: unknown }>('POST', '/v1/hub/exec', input)\n return data.result\n }\n\n private async request<T>(\n method: 'GET' | 'POST' | 'DELETE' | 'PUT',\n path: string,\n body?: unknown,\n ): Promise<T> {\n const headers: Record<string, string> = {\n authorization: `Bearer ${this.bearer}`,\n accept: 'application/json',\n }\n if (body !== undefined) headers['content-type'] = 'application/json'\n\n const res = await this.fetchImpl(`${this.baseUrl}${path}`, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n })\n const text = await res.text()\n let parsed: PlatformEnvelope<T> | null = null\n if (text) {\n try {\n parsed = JSON.parse(text)\n } catch {\n // fall through to error handling below\n }\n }\n if (!res.ok || (parsed && parsed.success === false)) {\n const code = parsed?.error && typeof parsed.error === 'object' ? parsed.error.code : undefined\n const message =\n (parsed?.error && typeof parsed.error === 'object' && parsed.error.message) ||\n (typeof parsed?.error === 'string' ? parsed.error : `Platform hub error (${res.status})`)\n throw new PlatformHubError(message, res.status, code, parsed ?? text)\n }\n if (!parsed) {\n throw new PlatformHubError(\n `Platform hub returned non-JSON success (${res.status})`,\n res.status,\n undefined,\n text,\n )\n }\n if (parsed.data === undefined) {\n throw new PlatformHubError(\n 'Platform hub envelope missing `data`',\n res.status,\n undefined,\n parsed,\n )\n }\n return parsed.data\n }\n}\n","/**\n * Server-side OpenID Connect client for the Tangle authorization server\n * (Better Auth `oauthProvider`, mounted at `/api/auth/oauth2/*`).\n *\n * This is the standard authorization-code + S256 PKCE path. It returns OIDC\n * tokens and a verified identity, not the `sk-tan` API key that\n * {@link PlatformAuthClient} returns. Identity scopes do not authorize paid\n * platform calls, so a consumer that uses the legacy API key as its Hub\n * bearer must keep {@link PlatformAuthClient} until it no longer needs one.\n *\n * The client id and redirect URI must be registered in the platform's\n * `oauthClient` registry. The legacy `TRUSTED_APPS` registration does not\n * carry over.\n */\n\nimport { PlatformAuthError } from './auth.js'\n\nexport interface PlatformOidcClientOptions {\n /** Platform base URL, e.g. `https://id.tangle.tools`. */\n baseUrl: string\n /** Client id from the platform `oauthClient` registry. */\n clientId: string\n /**\n * Client secret for a confidential client. Sent with HTTP Basic, the\n * provider's default `client_secret_basic` method. Omit for a public client\n * registered with `token_endpoint_auth_method: none`.\n */\n clientSecret?: string\n /** Registered callback URI. */\n redirectUri: string\n /** Requested scopes. Defaults to `openid profile email offline_access`. */\n scope?: string\n /** Override the global fetch (useful for tests + edge runtimes). */\n fetchImpl?: typeof fetch\n}\n\nexport interface OidcAuthorizeUrlOptions {\n /** Required CSRF token; the consumer verifies it on the callback. */\n state: string\n /** RFC 7636 S256 code challenge. See {@link createPkcePair}. */\n codeChallenge: string\n /** OIDC nonce; the consumer checks it against the ID token. */\n nonce?: string\n prompt?: 'login' | 'consent' | 'none'\n /** Pre-fill the email field on the login screen. */\n loginHint?: string\n}\n\nexport interface OidcTokens {\n accessToken: string\n tokenType: string\n expiresIn?: number\n refreshToken?: string\n idToken?: string\n scope?: string\n}\n\nexport interface OidcUser {\n id: string\n email: string\n emailVerified: true\n name?: string\n}\n\nexport interface OidcExchangeResult {\n tokens: OidcTokens\n user: OidcUser\n}\n\nconst DEFAULT_SCOPE = 'openid profile email offline_access'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction isNonemptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0\n}\n\nfunction base64url(bytes: Uint8Array): string {\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '')\n}\n\n/** Create an RFC 7636 verifier and its S256 challenge with Web Crypto. */\nexport async function createPkcePair(): Promise<{ verifier: string; challenge: string }> {\n const verifier = base64url(crypto.getRandomValues(new Uint8Array(32)))\n const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(verifier))\n return { verifier, challenge: base64url(new Uint8Array(digest)) }\n}\n\nfunction oauthError(body: unknown, fallback: string): string {\n if (!isRecord(body)) return fallback\n if (isNonemptyString(body.error_description)) return body.error_description\n if (isNonemptyString(body.error)) return body.error\n return fallback\n}\n\nfunction parseTokens(body: unknown, status: number): OidcTokens {\n if (!isRecord(body) || !isNonemptyString(body.access_token)) {\n // A malformed success response may still hold a secret; never echo it.\n throw new PlatformAuthError('Platform token response is malformed', status, {\n code: 'INVALID_TOKEN_RESPONSE',\n })\n }\n return {\n accessToken: body.access_token,\n tokenType: isNonemptyString(body.token_type) ? body.token_type : 'Bearer',\n ...(typeof body.expires_in === 'number' ? { expiresIn: body.expires_in } : {}),\n ...(isNonemptyString(body.refresh_token) ? { refreshToken: body.refresh_token } : {}),\n ...(isNonemptyString(body.id_token) ? { idToken: body.id_token } : {}),\n ...(isNonemptyString(body.scope) ? { scope: body.scope } : {}),\n }\n}\n\n/** Standard OIDC authorization-code + PKCE client for \"Sign in with Tangle\". */\nexport class PlatformOidcClient {\n private readonly baseUrl: string\n private readonly clientId: string\n private readonly clientSecret: string | undefined\n private readonly redirectUri: string\n private readonly scope: string\n private readonly fetchImpl: typeof fetch\n\n constructor(options: PlatformOidcClientOptions) {\n if (!options.baseUrl) throw new Error('PlatformOidcClient: baseUrl is required')\n if (!options.clientId) throw new Error('PlatformOidcClient: clientId is required')\n if (!options.redirectUri) throw new Error('PlatformOidcClient: redirectUri is required')\n this.baseUrl = options.baseUrl.replace(/\\/+$/, '')\n this.clientId = options.clientId\n this.clientSecret = options.clientSecret || undefined\n this.redirectUri = options.redirectUri\n this.scope = options.scope ?? DEFAULT_SCOPE\n // Arrow wrapper: an unbound global fetch throws \"Illegal invocation\" on Workers.\n this.fetchImpl =\n options.fetchImpl ??\n ((url: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => fetch(url, init))\n }\n\n /** Build the `/api/auth/oauth2/authorize` URL for a browser redirect. */\n authorizeUrl(options: OidcAuthorizeUrlOptions): string {\n if (!options.state)\n throw new Error('PlatformOidcClient.authorizeUrl: state is required for CSRF')\n if (!options.codeChallenge) {\n throw new Error('PlatformOidcClient.authorizeUrl: codeChallenge is required for PKCE')\n }\n const url = new URL('/api/auth/oauth2/authorize', this.baseUrl)\n url.searchParams.set('client_id', this.clientId)\n url.searchParams.set('redirect_uri', this.redirectUri)\n url.searchParams.set('response_type', 'code')\n url.searchParams.set('scope', this.scope)\n url.searchParams.set('state', options.state)\n url.searchParams.set('code_challenge', options.codeChallenge)\n url.searchParams.set('code_challenge_method', 'S256')\n if (options.nonce) url.searchParams.set('nonce', options.nonce)\n if (options.prompt) url.searchParams.set('prompt', options.prompt)\n if (options.loginHint) url.searchParams.set('login_hint', options.loginHint)\n return url.toString()\n }\n\n /** Exchange the callback code, then resolve the verified identity from userinfo. */\n async exchange(code: string, codeVerifier: string): Promise<OidcExchangeResult> {\n if (!code) throw new Error('PlatformOidcClient.exchange: code is required')\n if (!codeVerifier)\n throw new Error('PlatformOidcClient.exchange: codeVerifier is required for PKCE')\n const tokens = await this.token({\n grant_type: 'authorization_code',\n code,\n redirect_uri: this.redirectUri,\n code_verifier: codeVerifier,\n })\n return { tokens, user: await this.userinfo(tokens.accessToken) }\n }\n\n /** Redeem a refresh token. Store the returned refresh token; the provider rotates it. */\n async refresh(refreshToken: string): Promise<OidcTokens> {\n if (!refreshToken) throw new Error('PlatformOidcClient.refresh: refreshToken is required')\n return this.token({ grant_type: 'refresh_token', refresh_token: refreshToken })\n }\n\n /** Read the verified identity behind an access token. */\n async userinfo(accessToken: string): Promise<OidcUser> {\n const res = await this.fetchImpl(`${this.baseUrl}/api/auth/oauth2/userinfo`, {\n headers: { authorization: `Bearer ${accessToken}` },\n })\n const body: unknown = await res.json().catch(() => null)\n if (!res.ok) {\n throw new PlatformAuthError(\n oauthError(body, `Platform userinfo failed (${res.status})`),\n res.status,\n body,\n )\n }\n if (\n !isRecord(body) ||\n !isNonemptyString(body.sub) ||\n !isNonemptyString(body.email) ||\n body.email_verified !== true\n ) {\n throw new PlatformAuthError('Platform userinfo has no verified identity', res.status, {\n code: 'INVALID_USERINFO_RESPONSE',\n })\n }\n return {\n id: body.sub,\n email: body.email,\n emailVerified: true,\n ...(isNonemptyString(body.name) ? { name: body.name } : {}),\n }\n }\n\n /** Revoke an access or refresh token (RFC 7009). Disconnect revokes the refresh token. */\n async revoke(token: string, tokenTypeHint?: 'access_token' | 'refresh_token'): Promise<void> {\n if (!token) throw new Error('PlatformOidcClient.revoke: token is required')\n const res = await this.post('/api/auth/oauth2/revoke', {\n token,\n ...(tokenTypeHint ? { token_type_hint: tokenTypeHint } : {}),\n })\n if (!res.ok) {\n const body: unknown = await res.json().catch(() => null)\n throw new PlatformAuthError(\n oauthError(body, `Platform revoke failed (${res.status})`),\n res.status,\n body,\n )\n }\n }\n\n private async token(params: Record<string, string>): Promise<OidcTokens> {\n const res = await this.post('/api/auth/oauth2/token', params)\n const body: unknown = await res.json().catch(() => null)\n if (!res.ok) {\n throw new PlatformAuthError(\n oauthError(body, `Platform token request failed (${res.status})`),\n res.status,\n body,\n )\n }\n return parseTokens(body, res.status)\n }\n\n private post(path: string, params: Record<string, string>): Promise<Response> {\n const body = new URLSearchParams(params)\n const headers: Record<string, string> = { 'content-type': 'application/x-www-form-urlencoded' }\n if (this.clientSecret) {\n headers.authorization = `Basic ${btoa(`${this.clientId}:${this.clientSecret}`)}`\n } else {\n body.set('client_id', this.clientId)\n }\n return this.fetchImpl(`${this.baseUrl}${path}`, { method: 'POST', headers, body })\n }\n}\n"],"mappings":";;AAoDA,IAAa,oBAAb,cAAuC,MAAM;CAGzB;CACA;CAHlB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EAC5E,MAAM,OAAO,IAAI,gBAAgB,MAAM;EACvC,MAAM,UAAkC,EAAE,gBAAgB,oCAAoC;EAC9F,IAAI,KAAK,cACP,QAAQ,gBAAgB,SAAS,KAAK,GAAG,KAAK,SAAS,GAAG,KAAK,cAAc;OAE7E,KAAK,IAAI,aAAa,KAAK,QAAQ;EAErC,OAAO,KAAK,UAAU,GAAG,KAAK,UAAU,QAAQ;GAAE,QAAQ;GAAQ;GAAS;EAAK,CAAC;CACnF;AACF"}
@@ -1,5 +1,5 @@
1
- import { Oa as Validator } from "./types-r7Fzum3M.js";
2
- import { _ as CoderTask, a as UiFindingSeverity, c as KnowledgeUpdate, d as ResearchSource, f as ResearchTask, g as researcherProfile, h as multiHarnessResearcherFanout, i as UiFindingScreenshot, l as MultiHarnessResearcherFanoutOptions, m as createResearcherValidator, n as UI_LENSES, o as UiLens, p as ResearcherProfileOptions, r as UiFinding, s as KnowledgeItem, t as UI_FINDING_SEVERITIES, u as ResearchOutput, v as coderTaskToPrompt } from "./substrate-DPIUXsZ5.js";
1
+ import { Ca as Validator } from "./types-D56jQad-.js";
2
+ import { _ as CoderTask, a as UiFindingSeverity, c as KnowledgeUpdate, d as ResearchSource, f as ResearchTask, g as researcherProfile, h as multiHarnessResearcherFanout, i as UiFindingScreenshot, l as MultiHarnessResearcherFanoutOptions, m as createResearcherValidator, n as UI_LENSES, o as UiLens, p as ResearcherProfileOptions, r as UiFinding, s as KnowledgeItem, t as UI_FINDING_SEVERITIES, u as ResearchOutput, v as coderTaskToPrompt } from "./substrate-CHQ5GYnU.js";
3
3
  import { SandboxEvent } from "@tangle-network/sandbox";
4
4
  //#region src/audit/issue-writer.d.ts
5
5
  /** @experimental */
@@ -1,7 +1,7 @@
1
- import { $i as detachedSnapshot, Fi as finalizeRuntimeOwnedPendingExecutor, Ia as armDeadlineTimer, Mi as attestRuntimeOwnedPendingExecutor, Na as abortError, Sa as sleep, Xi as executableAgentProfileSnapshot, _r as environmentGone, br as linkAbort, bt as startRetainedInteractiveRun, dt as interactiveAdmissionSeamKey, fn as taskToPrompt, gn as createInbox, gr as destroyInteractiveEnvironment, hr as retainedCreateMaterial, ht as readWorkerInteractiveBinding, kr as contentAddress, n as createRootHandle, nr as sandboxClientAsProvider, r as createSupervisor, yr as abortError$1, zi as newExecutionAttemptId } from "./supervisor-C50SI_Ww.js";
1
+ import { $i as detachedSnapshot, Fi as finalizeRuntimeOwnedPendingExecutor, Ia as armDeadlineTimer, Mi as attestRuntimeOwnedPendingExecutor, Na as abortError, Sa as sleep, Sr as linkAbort, St as startRetainedInteractiveRun, Xi as executableAgentProfileSnapshot, _r as retainedCreateMaterial, _t as readWorkerInteractiveBinding, ir as sandboxClientAsProvider, jr as contentAddress, mn as taskToPrompt, n as createRootHandle, pt as interactiveAdmissionSeamKey, r as createSupervisor, vn as createInbox, vr as destroyInteractiveEnvironment, xr as abortError$1, yr as environmentGone, zi as newExecutionAttemptId } from "./supervisor-DtlPj9me.js";
2
2
  import { a as concreteProfileModel } from "./model-policy-BbSCSak0.js";
3
3
  import { a as writeAtomicDurableFile } from "./durable-file-DWQA4ooo.js";
4
- import { A as createCoordinationTools, n as createSteerAcknowledger, t as createCancelAcknowledger, v as createFileRunContext } from "./coordination-driver-B2GTcMvx.js";
4
+ import { A as createCoordinationTools, n as createSteerAcknowledger, t as createCancelAcknowledger, v as createFileRunContext } from "./coordination-driver-BBL_OgRw.js";
5
5
  import { h as supervisorRunDir } from "./run-layout-vwd4SwX_.js";
6
6
  import { agentInteractiveSessionControlClaimRequestDigest, agentInteractiveSessionPromptRequestDigest, agentInteractiveSessionStopRequestDigest, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest } from "@tangle-network/agent-interface";
7
7
  import { randomUUID } from "node:crypto";
@@ -1026,4 +1026,4 @@ function writeState(path, state) {
1026
1026
  //#endregion
1027
1027
  export { workerFromInteractiveProvider as n, claimRetainedInteractiveControl as r, provisionSupervisor as t };
1028
1028
 
1029
- //# sourceMappingURL=provision-supervisor-Ds43T8XY.js.map
1029
+ //# sourceMappingURL=provision-supervisor-BvnihiyB.js.map