@geminixiang/mikan 1.0.0-beta.4 → 1.0.0-beta.41
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/CHANGELOG.md +714 -0
- package/README.md +99 -36
- package/dist/adapter.d.ts +11 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +18 -1
- package/dist/adapter.js.map +1 -1
- package/dist/adapters/discord/bot.d.ts +6 -7
- package/dist/adapters/discord/bot.d.ts.map +1 -1
- package/dist/adapters/discord/bot.js +88 -122
- package/dist/adapters/discord/bot.js.map +1 -1
- package/dist/adapters/discord/components.d.ts +33 -0
- package/dist/adapters/discord/components.d.ts.map +1 -0
- package/dist/adapters/discord/components.js +32 -0
- package/dist/adapters/discord/components.js.map +1 -0
- package/dist/adapters/discord/context.d.ts +3 -1
- package/dist/adapters/discord/context.d.ts.map +1 -1
- package/dist/adapters/discord/context.js +66 -217
- package/dist/adapters/discord/context.js.map +1 -1
- package/dist/adapters/discord/format.d.ts +3 -0
- package/dist/adapters/discord/format.d.ts.map +1 -0
- package/dist/adapters/discord/format.js +86 -0
- package/dist/adapters/discord/format.js.map +1 -0
- package/dist/adapters/github/bot.d.ts +89 -0
- package/dist/adapters/github/bot.d.ts.map +1 -0
- package/dist/adapters/github/bot.js +653 -0
- package/dist/adapters/github/bot.js.map +1 -0
- package/dist/adapters/github/client.d.ts +122 -0
- package/dist/adapters/github/client.d.ts.map +1 -0
- package/dist/adapters/github/client.js +314 -0
- package/dist/adapters/github/client.js.map +1 -0
- package/dist/adapters/github/cloudbuild.d.ts +19 -0
- package/dist/adapters/github/cloudbuild.d.ts.map +1 -0
- package/dist/adapters/github/cloudbuild.js +71 -0
- package/dist/adapters/github/cloudbuild.js.map +1 -0
- package/dist/adapters/github/context.d.ts +12 -0
- package/dist/adapters/github/context.d.ts.map +1 -0
- package/dist/adapters/github/context.js +101 -0
- package/dist/adapters/github/context.js.map +1 -0
- package/dist/adapters/github/gcp-auth.d.ts +28 -0
- package/dist/adapters/github/gcp-auth.d.ts.map +1 -0
- package/dist/adapters/github/gcp-auth.js +196 -0
- package/dist/adapters/github/gcp-auth.js.map +1 -0
- package/dist/adapters/github/github-ops.d.ts +91 -0
- package/dist/adapters/github/github-ops.d.ts.map +1 -0
- package/dist/adapters/github/github-ops.js +406 -0
- package/dist/adapters/github/github-ops.js.map +1 -0
- package/dist/adapters/github/ids.d.ts +34 -0
- package/dist/adapters/github/ids.d.ts.map +1 -0
- package/dist/adapters/github/ids.js +57 -0
- package/dist/adapters/github/ids.js.map +1 -0
- package/dist/adapters/github/repo.d.ts +33 -0
- package/dist/adapters/github/repo.d.ts.map +1 -0
- package/dist/adapters/github/repo.js +141 -0
- package/dist/adapters/github/repo.js.map +1 -0
- package/dist/adapters/github/tool-pack.d.ts +14 -0
- package/dist/adapters/github/tool-pack.d.ts.map +1 -0
- package/dist/adapters/github/tool-pack.js +56 -0
- package/dist/adapters/github/tool-pack.js.map +1 -0
- package/dist/adapters/github/tools/checks.d.ts +19 -0
- package/dist/adapters/github/tools/checks.d.ts.map +1 -0
- package/dist/adapters/github/tools/checks.js +105 -0
- package/dist/adapters/github/tools/checks.js.map +1 -0
- package/dist/adapters/github/tools/issue.d.ts +21 -0
- package/dist/adapters/github/tools/issue.d.ts.map +1 -0
- package/dist/adapters/github/tools/issue.js +48 -0
- package/dist/adapters/github/tools/issue.js.map +1 -0
- package/dist/adapters/github/tools/pr.d.ts +22 -0
- package/dist/adapters/github/tools/pr.d.ts.map +1 -0
- package/dist/adapters/github/tools/pr.js +48 -0
- package/dist/adapters/github/tools/pr.js.map +1 -0
- package/dist/adapters/github/tools/read.d.ts +21 -0
- package/dist/adapters/github/tools/read.d.ts.map +1 -0
- package/dist/adapters/github/tools/read.js +141 -0
- package/dist/adapters/github/tools/read.js.map +1 -0
- package/dist/adapters/github/tools/review-reply.d.ts +17 -0
- package/dist/adapters/github/tools/review-reply.d.ts.map +1 -0
- package/dist/adapters/github/tools/review-reply.js +38 -0
- package/dist/adapters/github/tools/review-reply.js.map +1 -0
- package/dist/adapters/github/tools/sync.d.ts +17 -0
- package/dist/adapters/github/tools/sync.d.ts.map +1 -0
- package/dist/adapters/github/tools/sync.js +34 -0
- package/dist/adapters/github/tools/sync.js.map +1 -0
- package/dist/adapters/github/types.d.ts +373 -0
- package/dist/adapters/github/types.d.ts.map +1 -0
- package/dist/adapters/github/types.js +2 -0
- package/dist/adapters/github/types.js.map +1 -0
- package/dist/adapters/intake.d.ts +16 -5
- package/dist/adapters/intake.d.ts.map +1 -1
- package/dist/adapters/intake.js +86 -23
- package/dist/adapters/intake.js.map +1 -1
- package/dist/adapters/markdown-tables.d.ts +37 -0
- package/dist/adapters/markdown-tables.d.ts.map +1 -0
- package/dist/adapters/markdown-tables.js +164 -0
- package/dist/adapters/markdown-tables.js.map +1 -0
- package/dist/adapters/progressive-renderer.d.ts +7 -0
- package/dist/adapters/progressive-renderer.d.ts.map +1 -0
- package/dist/adapters/progressive-renderer.js +440 -0
- package/dist/adapters/progressive-renderer.js.map +1 -0
- package/dist/adapters/shared.d.ts +23 -10
- package/dist/adapters/shared.d.ts.map +1 -1
- package/dist/adapters/shared.js +60 -22
- package/dist/adapters/shared.js.map +1 -1
- package/dist/adapters/slack/assistant.d.ts +101 -0
- package/dist/adapters/slack/assistant.d.ts.map +1 -0
- package/dist/adapters/slack/assistant.js +204 -0
- package/dist/adapters/slack/assistant.js.map +1 -0
- package/dist/adapters/slack/blocks.d.ts +14 -0
- package/dist/adapters/slack/blocks.d.ts.map +1 -1
- package/dist/adapters/slack/blocks.js +105 -147
- package/dist/adapters/slack/blocks.js.map +1 -1
- package/dist/adapters/slack/bot.d.ts +95 -13
- package/dist/adapters/slack/bot.d.ts.map +1 -1
- package/dist/adapters/slack/bot.js +545 -211
- package/dist/adapters/slack/bot.js.map +1 -1
- package/dist/adapters/slack/context.d.ts +3 -1
- package/dist/adapters/slack/context.d.ts.map +1 -1
- package/dist/adapters/slack/context.js +11 -17
- package/dist/adapters/slack/context.js.map +1 -1
- package/dist/adapters/slack/response-lifecycle.d.ts.map +1 -1
- package/dist/adapters/slack/response-lifecycle.js +197 -323
- package/dist/adapters/slack/response-lifecycle.js.map +1 -1
- package/dist/adapters/slack/session.d.ts.map +1 -1
- package/dist/adapters/slack/session.js +7 -11
- package/dist/adapters/slack/session.js.map +1 -1
- package/dist/adapters/slack/stream-limits.d.ts +35 -0
- package/dist/adapters/slack/stream-limits.d.ts.map +1 -0
- package/dist/adapters/slack/stream-limits.js +56 -0
- package/dist/adapters/slack/stream-limits.js.map +1 -0
- package/dist/adapters/slack/tool-pack.d.ts +11 -0
- package/dist/adapters/slack/tool-pack.d.ts.map +1 -0
- package/dist/adapters/slack/tool-pack.js +45 -0
- package/dist/adapters/slack/tool-pack.js.map +1 -0
- package/dist/adapters/slack/tools/attach.js +1 -1
- package/dist/adapters/slack/tools/attach.js.map +1 -1
- package/dist/adapters/slack/tools/blockkit.d.ts +14 -0
- package/dist/adapters/slack/tools/blockkit.d.ts.map +1 -0
- package/dist/adapters/slack/tools/blockkit.js +106 -0
- package/dist/adapters/slack/tools/blockkit.js.map +1 -0
- package/dist/adapters/slack/types.d.ts +40 -2
- package/dist/adapters/slack/types.d.ts.map +1 -1
- package/dist/adapters/slack/types.js.map +1 -1
- package/dist/adapters/telegram/bot.d.ts +8 -9
- package/dist/adapters/telegram/bot.d.ts.map +1 -1
- package/dist/adapters/telegram/bot.js +115 -163
- package/dist/adapters/telegram/bot.js.map +1 -1
- package/dist/adapters/telegram/context.d.ts +2 -0
- package/dist/adapters/telegram/context.d.ts.map +1 -1
- package/dist/adapters/telegram/context.js +53 -188
- package/dist/adapters/telegram/context.js.map +1 -1
- package/dist/adapters/types.d.ts +132 -12
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/adapters/types.js.map +1 -1
- package/dist/agent-events.d.ts +3 -2
- package/dist/agent-events.d.ts.map +1 -1
- package/dist/agent-events.js +19 -1
- package/dist/agent-events.js.map +1 -1
- package/dist/agent.d.ts +14 -19
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +841 -298
- package/dist/agent.js.map +1 -1
- package/dist/cli/arg-grammar.d.ts +25 -0
- package/dist/cli/arg-grammar.d.ts.map +1 -0
- package/dist/cli/arg-grammar.js +61 -0
- package/dist/cli/arg-grammar.js.map +1 -0
- package/dist/cli/boot.d.ts +5 -0
- package/dist/cli/boot.d.ts.map +1 -0
- package/dist/cli/boot.js +117 -0
- package/dist/cli/boot.js.map +1 -0
- package/dist/cli/download.d.ts.map +1 -0
- package/dist/{download.js → cli/download.js} +2 -0
- package/dist/cli/download.js.map +1 -0
- package/dist/cli/ext-dev.d.ts +2 -0
- package/dist/cli/ext-dev.d.ts.map +1 -0
- package/dist/cli/ext-dev.js +188 -0
- package/dist/cli/ext-dev.js.map +1 -0
- package/dist/cli/ext.d.ts +2 -0
- package/dist/cli/ext.d.ts.map +1 -0
- package/dist/cli/ext.js +324 -0
- package/dist/cli/ext.js.map +1 -0
- package/dist/cli/office.d.ts +2 -0
- package/dist/cli/office.d.ts.map +1 -0
- package/dist/cli/office.js +91 -0
- package/dist/cli/office.js.map +1 -0
- package/dist/cli/types.d.ts +16 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/commands/admin.d.ts.map +1 -1
- package/dist/commands/admin.js +3 -2
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/auto-reply.d.ts.map +1 -1
- package/dist/commands/auto-reply.js +5 -9
- package/dist/commands/auto-reply.js.map +1 -1
- package/dist/commands/extensions.d.ts +18 -6
- package/dist/commands/extensions.d.ts.map +1 -1
- package/dist/commands/extensions.js +64 -14
- package/dist/commands/extensions.js.map +1 -1
- package/dist/commands/login.d.ts +2 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +40 -5
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/manifest.d.ts +37 -0
- package/dist/commands/manifest.d.ts.map +1 -0
- package/dist/commands/manifest.js +151 -0
- package/dist/commands/manifest.js.map +1 -0
- package/dist/commands/model.d.ts +2 -3
- package/dist/commands/model.d.ts.map +1 -1
- package/dist/commands/model.js +63 -24
- package/dist/commands/model.js.map +1 -1
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +15 -3
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/registry.d.ts +2 -2
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +1 -2
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/sandbox.d.ts.map +1 -1
- package/dist/commands/sandbox.js +83 -33
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/session-view.d.ts.map +1 -1
- package/dist/commands/session-view.js +6 -3
- package/dist/commands/session-view.js.map +1 -1
- package/dist/commands/types.d.ts +79 -7
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/types.js.map +1 -1
- package/dist/config.d.ts +23 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +222 -135
- package/dist/config.js.map +1 -1
- package/dist/env-manifest.d.ts +30 -0
- package/dist/env-manifest.d.ts.map +1 -0
- package/dist/env-manifest.js +233 -0
- package/dist/env-manifest.js.map +1 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +20 -81
- package/dist/events.js.map +1 -1
- package/dist/execution-resolver.d.ts +7 -8
- package/dist/execution-resolver.d.ts.map +1 -1
- package/dist/execution-resolver.js +106 -110
- package/dist/execution-resolver.js.map +1 -1
- package/dist/extension-schedules.d.ts +31 -0
- package/dist/extension-schedules.d.ts.map +1 -0
- package/dist/extension-schedules.js +229 -0
- package/dist/extension-schedules.js.map +1 -0
- package/dist/harness/auth.d.ts +2 -1
- package/dist/harness/auth.d.ts.map +1 -1
- package/dist/harness/auth.js +11 -5
- package/dist/harness/auth.js.map +1 -1
- package/dist/harness/event-format.d.ts +27 -0
- package/dist/harness/event-format.d.ts.map +1 -0
- package/dist/harness/event-format.js +160 -0
- package/dist/harness/event-format.js.map +1 -0
- package/dist/harness/extensions/loader.d.ts +27 -49
- package/dist/harness/extensions/loader.d.ts.map +1 -1
- package/dist/harness/extensions/loader.js +486 -130
- package/dist/harness/extensions/loader.js.map +1 -1
- package/dist/harness/extensions/registry.d.ts +107 -2
- package/dist/harness/extensions/registry.d.ts.map +1 -1
- package/dist/harness/extensions/registry.js +316 -0
- package/dist/harness/extensions/registry.js.map +1 -1
- package/dist/harness/extensions/types.d.ts +482 -42
- package/dist/harness/extensions/types.d.ts.map +1 -1
- package/dist/harness/extensions/types.js.map +1 -1
- package/dist/harness/index.d.ts +18 -8
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +7 -4
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/models.d.ts +7 -4
- package/dist/harness/models.d.ts.map +1 -1
- package/dist/harness/models.js +46 -24
- package/dist/harness/models.js.map +1 -1
- package/dist/harness/runner.d.ts +50 -54
- package/dist/harness/runner.d.ts.map +1 -1
- package/dist/harness/runner.js +232 -46
- package/dist/harness/runner.js.map +1 -1
- package/dist/harness/session-store.d.ts +11 -5
- package/dist/harness/session-store.d.ts.map +1 -1
- package/dist/harness/session-store.js +141 -36
- package/dist/harness/session-store.js.map +1 -1
- package/dist/harness/settings.d.ts +2 -20
- package/dist/harness/settings.d.ts.map +1 -1
- package/dist/harness/settings.js +12 -1
- package/dist/harness/settings.js.map +1 -1
- package/dist/harness/skills.d.ts +10 -29
- package/dist/harness/skills.d.ts.map +1 -1
- package/dist/harness/skills.js +48 -6
- package/dist/harness/skills.js.map +1 -1
- package/dist/harness/subagent-profiles.d.ts +8 -0
- package/dist/harness/subagent-profiles.d.ts.map +1 -0
- package/dist/harness/subagent-profiles.js +299 -0
- package/dist/harness/subagent-profiles.js.map +1 -0
- package/dist/harness/subagent-runner.d.ts +45 -0
- package/dist/harness/subagent-runner.d.ts.map +1 -0
- package/dist/harness/subagent-runner.js +680 -0
- package/dist/harness/subagent-runner.js.map +1 -0
- package/dist/harness/types.d.ts +267 -1
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js.map +1 -1
- package/dist/harness/usage.d.ts +6 -0
- package/dist/harness/usage.d.ts.map +1 -0
- package/dist/harness/usage.js +32 -0
- package/dist/harness/usage.js.map +1 -0
- package/dist/index.d.ts +36 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/main.js +391 -127
- package/dist/main.js.map +1 -1
- package/dist/observability/instrument.js +7 -5
- package/dist/observability/instrument.js.map +1 -1
- package/dist/observability/sentry.d.ts +2 -0
- package/dist/observability/sentry.d.ts.map +1 -1
- package/dist/observability/sentry.js +10 -2
- package/dist/observability/sentry.js.map +1 -1
- package/dist/office/address.d.ts +31 -0
- package/dist/office/address.d.ts.map +1 -0
- package/dist/office/address.js +113 -0
- package/dist/office/address.js.map +1 -0
- package/dist/office/index.d.ts +11 -0
- package/dist/office/index.d.ts.map +1 -0
- package/dist/office/index.js +11 -0
- package/dist/office/index.js.map +1 -0
- package/dist/office/layout.d.ts +27 -0
- package/dist/office/layout.d.ts.map +1 -0
- package/dist/office/layout.js +97 -0
- package/dist/office/layout.js.map +1 -0
- package/dist/office/migration.d.ts +44 -0
- package/dist/office/migration.d.ts.map +1 -0
- package/dist/office/migration.js +255 -0
- package/dist/office/migration.js.map +1 -0
- package/dist/office/registry.d.ts +75 -0
- package/dist/office/registry.d.ts.map +1 -0
- package/dist/office/registry.js +646 -0
- package/dist/office/registry.js.map +1 -0
- package/dist/office/types.d.ts +71 -0
- package/dist/office/types.d.ts.map +1 -0
- package/dist/office/types.js +2 -0
- package/dist/office/types.js.map +1 -0
- package/dist/packages/admin.d.ts +17 -0
- package/dist/packages/admin.d.ts.map +1 -0
- package/dist/packages/admin.js +98 -0
- package/dist/packages/admin.js.map +1 -0
- package/dist/packages/index.d.ts +6 -0
- package/dist/packages/index.d.ts.map +1 -0
- package/dist/packages/index.js +6 -0
- package/dist/packages/index.js.map +1 -0
- package/dist/packages/inspect.d.ts +11 -0
- package/dist/packages/inspect.d.ts.map +1 -0
- package/dist/packages/inspect.js +98 -0
- package/dist/packages/inspect.js.map +1 -0
- package/dist/packages/materialize.d.ts +40 -0
- package/dist/packages/materialize.d.ts.map +1 -0
- package/dist/packages/materialize.js +297 -0
- package/dist/packages/materialize.js.map +1 -0
- package/dist/packages/resolve.d.ts +25 -0
- package/dist/packages/resolve.d.ts.map +1 -0
- package/dist/packages/resolve.js +208 -0
- package/dist/packages/resolve.js.map +1 -0
- package/dist/packages/source.d.ts +39 -0
- package/dist/packages/source.d.ts.map +1 -0
- package/dist/packages/source.js +189 -0
- package/dist/packages/source.js.map +1 -0
- package/dist/packages/types.d.ts +104 -0
- package/dist/packages/types.d.ts.map +1 -0
- package/dist/packages/types.js +2 -0
- package/dist/packages/types.js.map +1 -0
- package/dist/provisioner.d.ts +66 -0
- package/dist/provisioner.d.ts.map +1 -1
- package/dist/provisioner.js +335 -13
- package/dist/provisioner.js.map +1 -1
- package/dist/runtime/conversation-runtime.d.ts +1 -1
- package/dist/runtime/conversation-runtime.d.ts.map +1 -1
- package/dist/runtime/conversation-runtime.js +562 -118
- package/dist/runtime/conversation-runtime.js.map +1 -1
- package/dist/runtime/session-lifecycle.d.ts +38 -0
- package/dist/runtime/session-lifecycle.d.ts.map +1 -0
- package/dist/runtime/session-lifecycle.js +193 -0
- package/dist/runtime/session-lifecycle.js.map +1 -0
- package/dist/runtime/types.d.ts +66 -7
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js.map +1 -1
- package/dist/sandbox/cloudflare.d.ts +3 -0
- package/dist/sandbox/cloudflare.d.ts.map +1 -1
- package/dist/sandbox/cloudflare.js +13 -1
- package/dist/sandbox/cloudflare.js.map +1 -1
- package/dist/sandbox/container.d.ts +4 -0
- package/dist/sandbox/container.d.ts.map +1 -1
- package/dist/sandbox/container.js +13 -3
- package/dist/sandbox/container.js.map +1 -1
- package/dist/sandbox/firecracker.d.ts +3 -0
- package/dist/sandbox/firecracker.d.ts.map +1 -1
- package/dist/sandbox/firecracker.js +13 -2
- package/dist/sandbox/firecracker.js.map +1 -1
- package/dist/sandbox/gondolin.d.ts +57 -0
- package/dist/sandbox/gondolin.d.ts.map +1 -0
- package/dist/sandbox/gondolin.js +764 -0
- package/dist/sandbox/gondolin.js.map +1 -0
- package/dist/sandbox/host.d.ts +3 -0
- package/dist/sandbox/host.d.ts.map +1 -1
- package/dist/sandbox/host.js +18 -3
- package/dist/sandbox/host.js.map +1 -1
- package/dist/sandbox/identity.d.ts +44 -0
- package/dist/sandbox/identity.d.ts.map +1 -0
- package/dist/sandbox/identity.js +68 -0
- package/dist/sandbox/identity.js.map +1 -0
- package/dist/sandbox/image.d.ts.map +1 -1
- package/dist/sandbox/image.js +2 -0
- package/dist/sandbox/image.js.map +1 -1
- package/dist/sandbox/index.d.ts +17 -4
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +37 -3
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/types.d.ts +65 -1
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sandbox/types.js.map +1 -1
- package/dist/sandbox/utils.d.ts +14 -0
- package/dist/sandbox/utils.d.ts.map +1 -1
- package/dist/sandbox/utils.js +68 -1
- package/dist/sandbox/utils.js.map +1 -1
- package/dist/sessions/chat-history-sync.d.ts +25 -0
- package/dist/sessions/chat-history-sync.d.ts.map +1 -0
- package/dist/sessions/{agent-memory-file-manager.js → chat-history-sync.js} +135 -131
- package/dist/sessions/chat-history-sync.js.map +1 -0
- package/dist/sessions/conversation-log.d.ts +9 -0
- package/dist/sessions/conversation-log.d.ts.map +1 -0
- package/dist/sessions/conversation-log.js +50 -0
- package/dist/sessions/conversation-log.js.map +1 -0
- package/dist/sessions/history-line.d.ts +29 -0
- package/dist/sessions/history-line.d.ts.map +1 -0
- package/dist/sessions/history-line.js +45 -0
- package/dist/sessions/history-line.js.map +1 -0
- package/dist/sessions/rotation.d.ts +2 -0
- package/dist/sessions/rotation.d.ts.map +1 -0
- package/dist/sessions/rotation.js +39 -0
- package/dist/sessions/rotation.js.map +1 -0
- package/dist/sessions/session-key.d.ts +33 -0
- package/dist/sessions/session-key.d.ts.map +1 -0
- package/dist/sessions/session-key.js +115 -0
- package/dist/sessions/session-key.js.map +1 -0
- package/dist/sessions/store.d.ts +15 -7
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +127 -36
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/types.d.ts +19 -5
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js.map +1 -1
- package/dist/settings-mutation.d.ts +40 -0
- package/dist/settings-mutation.d.ts.map +1 -0
- package/dist/settings-mutation.js +61 -0
- package/dist/settings-mutation.js.map +1 -0
- package/dist/subagent-progress.d.ts +39 -0
- package/dist/subagent-progress.d.ts.map +1 -0
- package/dist/subagent-progress.js +225 -0
- package/dist/subagent-progress.js.map +1 -0
- package/dist/tools/bash.d.ts +3 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +26 -18
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +14 -13
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/event.d.ts +1 -1
- package/dist/tools/event.d.ts.map +1 -1
- package/dist/tools/event.js +58 -45
- package/dist/tools/event.js.map +1 -1
- package/dist/tools/generate-image.d.ts +23 -0
- package/dist/tools/generate-image.d.ts.map +1 -0
- package/dist/tools/generate-image.js +65 -0
- package/dist/tools/generate-image.js.map +1 -0
- package/dist/tools/host-fn-tool.d.ts +21 -0
- package/dist/tools/host-fn-tool.d.ts.map +1 -0
- package/dist/tools/host-fn-tool.js +32 -0
- package/dist/tools/host-fn-tool.js.map +1 -0
- package/dist/tools/index.d.ts +19 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +25 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/react.d.ts +15 -0
- package/dist/tools/react.d.ts.map +1 -0
- package/dist/tools/react.js +29 -0
- package/dist/tools/react.js.map +1 -0
- package/dist/tools/read.d.ts +1 -0
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +39 -33
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/sandbox.d.ts +2 -2
- package/dist/tools/sandbox.d.ts.map +1 -1
- package/dist/tools/sandbox.js +14 -9
- package/dist/tools/sandbox.js.map +1 -1
- package/dist/tools/subagent-slots.d.ts +28 -0
- package/dist/tools/subagent-slots.d.ts.map +1 -0
- package/dist/tools/subagent-slots.js +72 -0
- package/dist/tools/subagent-slots.js.map +1 -0
- package/dist/tools/subagent.d.ts +61 -0
- package/dist/tools/subagent.d.ts.map +1 -0
- package/dist/tools/subagent.js +434 -0
- package/dist/tools/subagent.js.map +1 -0
- package/dist/tools/types.d.ts +40 -32
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +2 -8
- package/dist/tools/write.js.map +1 -1
- package/dist/trigger.d.ts +2 -1
- package/dist/trigger.d.ts.map +1 -1
- package/dist/trigger.js +6 -9
- package/dist/trigger.js.map +1 -1
- package/dist/types.d.ts +411 -59
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/dist/utils/file-guards.d.ts +9 -0
- package/dist/utils/file-guards.d.ts.map +1 -1
- package/dist/utils/file-guards.js +44 -1
- package/dist/utils/file-guards.js.map +1 -1
- package/dist/vault/disabled.d.ts +9 -0
- package/dist/vault/disabled.d.ts.map +1 -0
- package/dist/vault/disabled.js +25 -0
- package/dist/vault/disabled.js.map +1 -0
- package/dist/vault/index.d.ts +45 -2
- package/dist/vault/index.d.ts.map +1 -1
- package/dist/vault/index.js +127 -36
- package/dist/vault/index.js.map +1 -1
- package/dist/vault/types.d.ts +6 -2
- package/dist/vault/types.d.ts.map +1 -1
- package/dist/vault/types.js.map +1 -1
- package/dist/web/admin/portal.d.ts +31 -3
- package/dist/web/admin/portal.d.ts.map +1 -1
- package/dist/web/admin/portal.js +850 -345
- package/dist/web/admin/portal.js.map +1 -1
- package/dist/web/admin/provider-models.js +1 -1
- package/dist/web/admin/provider-models.js.map +1 -1
- package/dist/web/admin/types.d.ts +23 -3
- package/dist/web/admin/types.d.ts.map +1 -1
- package/dist/web/admin/types.js.map +1 -1
- package/dist/web/login/oauth.d.ts +2 -3
- package/dist/web/login/oauth.d.ts.map +1 -1
- package/dist/web/login/oauth.js +1 -32
- package/dist/web/login/oauth.js.map +1 -1
- package/dist/web/login/portal.d.ts +1 -1
- package/dist/web/login/portal.d.ts.map +1 -1
- package/dist/web/login/portal.js +13 -36
- package/dist/web/login/portal.js.map +1 -1
- package/dist/web/login/types.d.ts +0 -11
- package/dist/web/login/types.d.ts.map +1 -1
- package/dist/web/login/types.js.map +1 -1
- package/dist/web/portal-shell.d.ts +21 -0
- package/dist/web/portal-shell.d.ts.map +1 -0
- package/dist/{portal-shell.js → web/portal-shell.js} +67 -2
- package/dist/web/portal-shell.js.map +1 -0
- package/dist/web/server.d.ts +3 -2
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +11 -4
- package/dist/web/server.js.map +1 -1
- package/dist/web/session-view/portal.d.ts +1 -1
- package/dist/web/session-view/portal.d.ts.map +1 -1
- package/dist/web/session-view/portal.js +37 -28
- package/dist/web/session-view/portal.js.map +1 -1
- package/dist/web/session-view/service.d.ts +1 -1
- package/dist/web/session-view/service.d.ts.map +1 -1
- package/dist/web/session-view/service.js +61 -18
- package/dist/web/session-view/service.js.map +1 -1
- package/dist/web/session-view/types.d.ts +0 -3
- package/dist/web/session-view/types.d.ts.map +1 -1
- package/dist/web/session-view/types.js.map +1 -1
- package/dist/web/token-store.js +1 -1
- package/dist/web/token-store.js.map +1 -1
- package/dist/workspace-projection/index.d.ts +10 -0
- package/dist/workspace-projection/index.d.ts.map +1 -0
- package/dist/workspace-projection/index.js +120 -0
- package/dist/workspace-projection/index.js.map +1 -0
- package/dist/workspace-projection/types.d.ts +16 -0
- package/dist/workspace-projection/types.d.ts.map +1 -0
- package/dist/workspace-projection/types.js +2 -0
- package/dist/workspace-projection/types.js.map +1 -0
- package/package.json +68 -37
- package/dist/adapters/streaming.d.ts +0 -18
- package/dist/adapters/streaming.d.ts.map +0 -1
- package/dist/adapters/streaming.js +0 -44
- package/dist/adapters/streaming.js.map +0 -1
- package/dist/adapters/telegram/html.d.ts +0 -3
- package/dist/adapters/telegram/html.d.ts.map +0 -1
- package/dist/adapters/telegram/html.js +0 -98
- package/dist/adapters/telegram/html.js.map +0 -1
- package/dist/commands/parse.d.ts +0 -7
- package/dist/commands/parse.d.ts.map +0 -1
- package/dist/commands/parse.js +0 -14
- package/dist/commands/parse.js.map +0 -1
- package/dist/download.d.ts.map +0 -1
- package/dist/download.js.map +0 -1
- package/dist/model-registry.d.ts +0 -4
- package/dist/model-registry.d.ts.map +0 -1
- package/dist/model-registry.js +0 -7
- package/dist/model-registry.js.map +0 -1
- package/dist/portal-shell.d.ts +0 -4
- package/dist/portal-shell.d.ts.map +0 -1
- package/dist/portal-shell.js.map +0 -1
- package/dist/runtime/agent-run-controller.d.ts +0 -31
- package/dist/runtime/agent-run-controller.d.ts.map +0 -1
- package/dist/runtime/agent-run-controller.js +0 -195
- package/dist/runtime/agent-run-controller.js.map +0 -1
- package/dist/sandbox/path-context.d.ts +0 -3
- package/dist/sandbox/path-context.d.ts.map +0 -1
- package/dist/sandbox/path-context.js +0 -20
- package/dist/sandbox/path-context.js.map +0 -1
- package/dist/sessions/agent-memory-file-manager.d.ts +0 -19
- package/dist/sessions/agent-memory-file-manager.d.ts.map +0 -1
- package/dist/sessions/agent-memory-file-manager.js.map +0 -1
- package/dist/sessions/metadata.d.ts +0 -3
- package/dist/sessions/metadata.d.ts.map +0 -1
- package/dist/sessions/metadata.js +0 -11
- package/dist/sessions/metadata.js.map +0 -1
- package/dist/sessions/policy.d.ts +0 -6
- package/dist/sessions/policy.d.ts.map +0 -1
- package/dist/sessions/policy.js +0 -23
- package/dist/sessions/policy.js.map +0 -1
- package/dist/store.d.ts +0 -46
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -177
- package/dist/store.js.map +0 -1
- package/dist/tools/truncate.d.ts +0 -33
- package/dist/tools/truncate.d.ts.map +0 -1
- package/dist/tools/truncate.js +0 -184
- package/dist/tools/truncate.js.map +0 -1
- package/dist/utils/date.d.ts +0 -10
- package/dist/utils/date.d.ts.map +0 -1
- package/dist/utils/date.js +0 -23
- package/dist/utils/date.js.map +0 -1
- package/dist/utils/env.d.ts +0 -3
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/env.js +0 -12
- package/dist/utils/env.js.map +0 -1
- package/dist/utils/fs-atomic.d.ts +0 -10
- package/dist/utils/fs-atomic.d.ts.map +0 -1
- package/dist/utils/fs-atomic.js +0 -45
- package/dist/utils/fs-atomic.js.map +0 -1
- package/dist/utils/html.d.ts +0 -2
- package/dist/utils/html.d.ts.map +0 -1
- package/dist/utils/html.js +0 -4
- package/dist/utils/html.js.map +0 -1
- package/dist/utils/http-body.d.ts +0 -10
- package/dist/utils/http-body.d.ts.map +0 -1
- package/dist/utils/http-body.js +0 -34
- package/dist/utils/http-body.js.map +0 -1
- package/dist/vault/routing.d.ts +0 -3
- package/dist/vault/routing.d.ts.map +0 -1
- package/dist/vault/routing.js +0 -13
- package/dist/vault/routing.js.map +0 -1
- package/dist/web/agent-events/portal.d.ts +0 -3
- package/dist/web/agent-events/portal.d.ts.map +0 -1
- package/dist/web/agent-events/portal.js +0 -18
- package/dist/web/agent-events/portal.js.map +0 -1
- package/dist/web/request.d.ts +0 -3
- package/dist/web/request.d.ts.map +0 -1
- package/dist/web/request.js +0 -13
- package/dist/web/request.js.map +0 -1
- package/dist/web/session-view/command.d.ts +0 -4
- package/dist/web/session-view/command.d.ts.map +0 -1
- package/dist/web/session-view/command.js +0 -7
- package/dist/web/session-view/command.js.map +0 -1
- /package/dist/{download.d.ts → cli/download.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/sessions/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAGzD;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IACrD,OAAO,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,MAAM,QAAQ,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,UAAkB,EAAE,GAAW;IACvE,MAAM,YAAY,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACvD,IAAI,YAAY,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC;QAAE,OAAO,YAAY,CAAC;IACjF,OAAO,wBAAwB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,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UAAU,CAAC,WAAW,CAAC,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AACvF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,UAAkB;IAC1D,OAAO,wBAAwB,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { randomUUID } from \"crypto\";\nimport { existsSync, mkdirSync, rmSync } from \"fs\";\nimport { basename, dirname, join } from \"path\";\nimport { SessionStore } from \"../harness/index.js\";\nimport { isRecord, parseJsonValue, readTextFileIfExists } from \"../utils/file-guards.js\";\nimport { atomicWritePrivateFile } from \"../utils/fs-atomic.js\";\nimport { isPlatformHistorySession } from \"./metadata.js\";\nexport type { ResolvedSessionScope, ThreadRootMessage } from \"./types.js\";\n\n/**\n * Returns the shared session directory for a conversation.\n * Channel sessions use a current pointer within this directory.\n * Thread sessions are stored as fixed files within the same directory.\n */\nexport function getChannelSessionDir(channelDir: string): string {\n return join(channelDir, \"sessions\");\n}\n\n/**\n * Resolves the current active session file for a session directory.\n * Reads the \"current\" pointer file; creates a new session if none exists\n * or the pointed-to file is missing.\n */\nexport function resolveSessionFile(sessionDir: string): string {\n const existing = tryResolveCurrentSession(sessionDir);\n if (existing) return existing;\n return createNewSessionFile(sessionDir);\n}\n\n/**\n * Resolve the current active session file for a session directory.\n * Creates a fully initialized persistent session with the provided cwd when none exists.\n */\nexport function resolveManagedSessionFile(sessionDir: string, cwd: string): string {\n const existingPath = getCurrentSessionPath(sessionDir);\n if (existingPath && !isPlatformHistorySession(existingPath)) return existingPath;\n return createManagedSessionFile(sessionDir, cwd);\n}\n\n/**\n * Extracts the short UUID from a session file path.\n * e.g. \"2026-04-05T00-00_7b54cf90.jsonl\" → \"7b54cf90\"\n */\nexport function extractSessionUuid(sessionFile: string): string {\n return basename(sessionFile).replace(\".jsonl\", \"\").split(\"_\").pop()!;\n}\n\n/**\n * Extracts the thread/suffix part of a session key.\n * \"channelId:threadId\" → \"threadId\", \"channelId\" → \"channelId\"\n */\nexport function extractSessionSuffix(sessionKey: string): string {\n const parts = sessionKey.split(\":\");\n return parts.length > 1 ? parts[parts.length - 1] : sessionKey;\n}\n\n/**\n * Creates an empty timestamped file and updates the \"current\" pointer.\n * Used only by tests for placeholder-file scenarios.\n *\n * Order matters: write the session file first, then atomic-rename the pointer\n * last so a crash mid-create never leaves \"current\" pointing at a missing file.\n */\nexport function createNewSessionFile(sessionDir: string): string {\n mkdirSync(sessionDir, { recursive: true });\n const filename = createSessionFilename();\n const filePath = join(sessionDir, filename);\n atomicWritePrivateFile(filePath, \"\");\n atomicWritePrivateFile(join(sessionDir, \"current\"), filename);\n return filePath;\n}\n\n/**\n * Creates a new persistent session file with a proper SessionManager header and cwd.\n * Also updates the \"current\" pointer. Header is written before the pointer flips so a\n * partial create cannot leave \"current\" pointing at a missing file.\n */\nexport function createManagedSessionFile(sessionDir: string, cwd: string): string {\n mkdirSync(sessionDir, { recursive: true });\n const sessionId = randomUUID();\n const sessionFile = join(sessionDir, createSessionFilename(sessionId));\n writeSessionHeader(sessionFile, cwd, sessionId);\n setCurrentPointer(sessionDir, sessionFile);\n return sessionFile;\n}\n\n/**\n * Open a session file with an explicit cwd, even if the file does not exist yet.\n * This avoids SessionStore.open() falling back to process.cwd() for fresh sessions.\n */\nexport function openManagedSession(sessionFile: string, cwd: string): SessionStore {\n if (shouldRecreatePreinitializedSession(sessionFile)) {\n rmSync(sessionFile, { force: true });\n }\n\n return SessionStore.open(sessionFile, cwd);\n}\n\nfunction createSessionFilename(sessionId = randomUUID()): string {\n const timestamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n return `${timestamp}_${sessionId.slice(0, 8)}.jsonl`;\n}\n\nfunction setCurrentPointer(sessionDir: string, sessionFilePath: string): void {\n const filename = sessionFilePath.split(\"/\").pop()!;\n mkdirSync(sessionDir, { recursive: true });\n atomicWritePrivateFile(join(sessionDir, \"current\"), filename);\n}\n\n/**\n * Creates or overwrites a fixed-path session file with a valid session header.\n */\nexport function createManagedSessionFileAtPath(sessionFile: string, cwd: string): string {\n writeSessionHeader(sessionFile, cwd);\n return sessionFile;\n}\n\nfunction writeSessionHeader(sessionFile: string, cwd: string, sessionId = randomUUID()): void {\n const sessionDir = dirname(sessionFile);\n mkdirSync(sessionDir, { recursive: true });\n const header = {\n type: \"session\",\n version: 3,\n id: sessionId,\n timestamp: new Date().toISOString(),\n cwd,\n };\n atomicWritePrivateFile(sessionFile, `${JSON.stringify(header)}\\n`);\n}\n\n/**\n * Returns the fixed session file path for a Slack thread.\n */\nexport function getThreadSessionFile(channelDir: string, sessionKey: string): string {\n return join(getChannelSessionDir(channelDir), `${extractSessionSuffix(sessionKey)}.jsonl`);\n}\n\nfunction hasSessionHeader(sessionFile: string): boolean {\n try {\n const raw = readTextFileIfExists(sessionFile);\n if (raw === undefined) return false;\n const lines = raw.split(\"\\n\");\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n const entry = parseSessionEntry(trimmed);\n return entry.type === \"session\";\n }\n } catch {\n return false;\n }\n return false;\n}\n\nfunction shouldRecreatePreinitializedSession(sessionFile: string): boolean {\n try {\n const raw = readTextFileIfExists(sessionFile);\n if (raw === undefined) return false;\n const entries = raw\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter(Boolean)\n .map(parseSessionEntry);\n\n return entries.length === 1 && entries[0]?.type === \"session\";\n } catch {\n return false;\n }\n}\n\nfunction parseSessionEntry(line: string): { type?: string } {\n return parseJsonValue(\n line,\n (value): value is { type?: string } => isRecord(value),\n (detail) => (detail === \"unexpected JSON shape\" ? \"expected a JSON object\" : detail),\n );\n}\n\nfunction getCurrentSessionPath(sessionDir: string): string | null {\n const pointerFile = join(sessionDir, \"current\");\n const filename = readTextFileIfExists(pointerFile)?.trim();\n if (!filename) return null;\n return join(sessionDir, filename);\n}\n\n/**\n * Try to resolve an existing current session file.\n * Returns null if no current pointer exists or the pointed file has no valid session header.\n */\nexport function tryResolveCurrentSession(sessionDir: string): string | null {\n const fullPath = getCurrentSessionPath(sessionDir);\n if (fullPath && existsSync(fullPath) && hasSessionHeader(fullPath)) return fullPath;\n return null;\n}\n\n/**\n * Try to resolve an existing thread session file.\n * Returns the file path if found, or null if no valid thread session exists yet.\n */\nexport function tryResolveThreadSession(sessionFile: string): string | null {\n return existsSync(sessionFile) && hasSessionHeader(sessionFile) ? sessionFile : null;\n}\n\n/**\n * Resolve the channel's current session file path.\n * Returns null if no channel session exists.\n */\nexport function resolveChannelSessionFile(channelDir: string): string | null {\n return tryResolveCurrentSession(getChannelSessionDir(channelDir));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/sessions/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,sBAAsB,EACtB,QAAQ,EACR,cAAc,EACd,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvE,MAAM,UAAU,wBAAwB,CAAC,WAAmB;IAC1D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,SAAS,EAA+B,CAAC;QACvF,OAAO,MAAM,EAAE,MAAM,EAAE,IAAI,KAAK,kBAAkB,CAAC;IACrD,CAAC;IAAC,MA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,GAAG,KAA8C,CAAC;QACzE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,OAAO,SAAS,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACzE,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;QAClD,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { existsSync, lstatSync, mkdirSync, readdirSync, rmSync } from \"node:fs\";\nimport { basename, dirname, join, relative, resolve, sep } from \"node:path\";\nimport { SessionStore } from \"../harness/index.js\";\nimport {\n atomicWritePrivateFile,\n isRecord,\n parseJsonValue,\n readTextFileIfExists,\n} from \"../utils/file-guards.js\";\nimport { officeSessionsDir } from \"../office/index.js\";\nimport { assertSessionSuffix, threadSuffixOf } from \"./session-key.js\";\nexport type { ResolvedSessionScope, ThreadRootMessage } from \"./types.js\";\nexport type { MikanSessionHeader } from \"./types.js\";\nimport type { MikanSessionHeader } from \"./types.js\";\n\nexport function isPlatformHistorySession(sessionFile: string): boolean {\n try {\n const header = SessionStore.open(sessionFile).getHeader() as MikanSessionHeader | null;\n return header?.source?.kind === \"platform-history\";\n } catch {\n return false;\n }\n}\n\n/**\n * Resolves the current active session file for a session directory.\n * Reads the \"current\" pointer file; creates a new session if none exists\n * or the pointed-to file is missing.\n */\nexport function resolveSessionFile(sessionDir: string): string {\n const existing = tryResolveCurrentSession(sessionDir);\n if (existing) return existing;\n return createNewSessionFile(sessionDir);\n}\n\n/**\n * Resolve the current active session file for a session directory.\n * Creates a fully initialized persistent session with the provided cwd when none exists.\n */\nexport function resolveManagedSessionFile(sessionDir: string, cwd: string): string {\n const existingPath = getCurrentSessionPath(sessionDir);\n if (existingPath && !isPlatformHistorySession(existingPath)) return existingPath;\n return createManagedSessionFile(sessionDir, cwd);\n}\n\n/**\n * Extracts the short UUID from a session file path.\n * e.g. \"2026-04-05T00-00_7b54cf90.jsonl\" → \"7b54cf90\"\n */\nexport function extractSessionUuid(sessionFile: string): string {\n return basename(sessionFile).replace(\".jsonl\", \"\").split(\"_\").pop()!;\n}\n\n/**\n * Extracts the thread/suffix part of a session key.\n * \"channelId:threadId\" → \"threadId\", \"channelId\" → \"channelId\"\n */\nexport function extractSessionSuffix(sessionKey: string): string {\n return assertSessionSuffix(threadSuffixOf(sessionKey) ?? sessionKey);\n}\n\n/**\n * Resolve one child path and prove it remains inside its owning directory.\n * Identity validation is the first guard; containment is defense in depth for\n * every session path derived from platform-controlled values.\n */\nfunction resolveChildPath(root: string, child: string): string {\n const resolvedRoot = resolve(root);\n const resolvedChild = resolve(resolvedRoot, child);\n const relation = relative(resolvedRoot, resolvedChild);\n if (!relation || relation === \"..\" || relation.startsWith(`..${sep}`)) {\n throw new Error(`Session path escapes its owning directory: ${JSON.stringify(child)}`);\n }\n return resolvedChild;\n}\n\n/**\n * Creates an empty timestamped file and updates the \"current\" pointer.\n * Used only by tests for placeholder-file scenarios.\n *\n * Order matters: write the session file first, then atomic-rename the pointer\n * last so a crash mid-create never leaves \"current\" pointing at a missing file.\n */\nexport function createNewSessionFile(sessionDir: string): string {\n mkdirSync(sessionDir, { recursive: true });\n const filename = createSessionFilename();\n const filePath = join(sessionDir, filename);\n atomicWritePrivateFile(filePath, \"\");\n atomicWritePrivateFile(join(sessionDir, \"current\"), filename);\n return filePath;\n}\n\n/**\n * Creates a new persistent session file with a proper SessionManager header and cwd.\n * Also updates the \"current\" pointer. Header is written before the pointer flips so a\n * partial create cannot leave \"current\" pointing at a missing file.\n */\nexport function createManagedSessionFile(sessionDir: string, cwd: string): string {\n mkdirSync(sessionDir, { recursive: true });\n const sessionId = randomUUID();\n const sessionFile = join(sessionDir, createSessionFilename(sessionId));\n writeSessionHeader(sessionFile, cwd, sessionId);\n setCurrentPointer(sessionDir, sessionFile);\n return sessionFile;\n}\n\n/**\n * Open a session file with an explicit cwd, even if the file does not exist yet.\n * This avoids SessionStore.open() falling back to process.cwd() for fresh sessions.\n */\nexport function openManagedSession(sessionFile: string, cwd: string): SessionStore {\n if (shouldRecreatePreinitializedSession(sessionFile)) {\n rmSync(sessionFile, { force: true });\n }\n\n return SessionStore.open(sessionFile, cwd);\n}\n\nfunction createSessionFilename(sessionId = randomUUID()): string {\n const timestamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n return `${timestamp}_${sessionId.slice(0, 8)}.jsonl`;\n}\n\nfunction setCurrentPointer(sessionDir: string, sessionFilePath: string): void {\n const filename = sessionFilePath.split(\"/\").pop()!;\n mkdirSync(sessionDir, { recursive: true });\n atomicWritePrivateFile(join(sessionDir, \"current\"), filename);\n}\n\n/**\n * Creates or overwrites a fixed-path session file with a valid session header.\n */\nexport interface ParentSessionRef {\n path: string;\n id: string;\n}\n\nexport function createManagedSessionFileAtPath(\n sessionFile: string,\n cwd: string,\n parent?: ParentSessionRef,\n): string {\n writeSessionHeader(sessionFile, cwd, undefined, parent);\n return sessionFile;\n}\n\nfunction writeSessionHeader(\n sessionFile: string,\n cwd: string,\n sessionId = randomUUID(),\n parent?: ParentSessionRef,\n): void {\n mkdirSync(dirname(sessionFile), { recursive: true });\n // The header format (and its version) is owned by the harness store; this\n // layer only decides the path and the id.\n SessionStore.create(sessionFile, cwd, {\n id: sessionId,\n ...(parent ? { parentSession: parent.path, parentSessionId: parent.id } : {}),\n });\n}\n\n/**\n * Returns the fixed session file path for a Slack thread.\n */\nexport function getThreadSessionFile(channelDir: string, sessionKey: string): string {\n const sessionDir = officeSessionsDir(channelDir);\n return resolveChildPath(sessionDir, `${extractSessionSuffix(sessionKey)}.jsonl`);\n}\n\nfunction isRegularSessionFile(sessionFile: string): boolean {\n try {\n return lstatSync(sessionFile).isFile();\n } catch {\n return false;\n }\n}\n\nfunction hasSessionHeader(sessionFile: string): boolean {\n try {\n const raw = readTextFileIfExists(sessionFile);\n if (raw === undefined) return false;\n const lines = raw.split(\"\\n\");\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n const entry = parseSessionEntry(trimmed);\n return entry.type === \"session\";\n }\n } catch {\n return false;\n }\n return false;\n}\n\nfunction shouldRecreatePreinitializedSession(sessionFile: string): boolean {\n try {\n const raw = readTextFileIfExists(sessionFile);\n if (raw === undefined) return false;\n const entries = raw\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter(Boolean)\n .map(parseSessionEntry);\n\n if (entries.length !== 1 || entries[0]?.type !== \"session\") return false;\n // Sessions with lineage metadata are fully initialized — preserve them.\n const h = entries[0] as { parentSession?: unknown; parentSessionId?: unknown };\n if (h.parentSession || h.parentSessionId) return false;\n return true;\n } catch {\n return false;\n }\n}\n\nfunction parseSessionEntry(line: string): { type?: string } {\n return parseJsonValue(\n line,\n (value): value is { type?: string } => isRecord(value),\n (detail) => (detail === \"unexpected JSON shape\" ? \"expected a JSON object\" : detail),\n );\n}\n\nfunction getCurrentSessionPath(sessionDir: string): string | null {\n const pointerFile = join(sessionDir, \"current\");\n const filename = readTextFileIfExists(pointerFile)?.trim();\n if (!filename) return null;\n try {\n return resolveChildPath(sessionDir, filename);\n } catch {\n return null;\n }\n}\n\n/**\n * Try to resolve an existing current session file.\n * Returns null if no current pointer exists or the pointed file has no valid session header.\n */\nexport function tryResolveCurrentSession(sessionDir: string): string | null {\n const fullPath = getCurrentSessionPath(sessionDir);\n if (fullPath && isRegularSessionFile(fullPath) && hasSessionHeader(fullPath)) return fullPath;\n return null;\n}\n\n/**\n * Try to resolve an existing thread session file.\n * Returns the file path if found, or null if no valid thread session exists yet.\n */\nexport function tryResolveThreadSession(sessionFile: string): string | null {\n return isRegularSessionFile(sessionFile) && hasSessionHeader(sessionFile) ? sessionFile : null;\n}\n\n/**\n * Resolve the channel's current session file path.\n * Returns null if no channel session exists.\n */\nexport function resolveChannelSessionFile(channelDir: string): string | null {\n return tryResolveCurrentSession(officeSessionsDir(channelDir));\n}\n\n// Matches timestamped main session filenames; thread sessions use bare threadTs.\nconst MAIN_SESSION_FILENAME = /^\\d{4}-\\d{2}-\\d{2}T.+_[0-9a-f]{8}\\.jsonl$/i;\n\n/**\n * Resolve the main session file that was active when a thread was created.\n * Uses the thread's Slack timestamp to find the main session whose creation\n * time is the latest one at or before that moment — stable across rotations.\n * Falls back to resolveChannelSessionFile when threadTs is absent or unparseable.\n * Returns both path and session UUID so callers can store a UUID-stable reference.\n */\nexport function resolveParentSessionForThread(\n channelDir: string,\n threadTs: string | undefined,\n): ParentSessionRef | null {\n if (threadTs !== undefined) {\n const threadTimeMs = Number(threadTs) * 1000;\n if (Number.isFinite(threadTimeMs)) {\n const best = findMainSessionActiveAtTime(channelDir, threadTimeMs);\n if (best) return best;\n }\n }\n const path = resolveChannelSessionFile(channelDir);\n if (!path) return null;\n const id = readSessionHeaderSummary(path)?.id;\n return id ? { path, id } : null;\n}\n\nfunction findMainSessionActiveAtTime(\n channelDir: string,\n targetMs: number,\n): ParentSessionRef | null {\n const sessionDir = officeSessionsDir(channelDir);\n if (!existsSync(sessionDir)) return null;\n\n let best: ParentSessionRef | null = null;\n let bestCreatedMs = -Infinity;\n\n for (const name of readdirSync(sessionDir)) {\n if (!MAIN_SESSION_FILENAME.test(name)) continue;\n const filePath = join(sessionDir, name);\n const summary = readSessionHeaderSummary(filePath);\n if (!summary) continue;\n if (summary.timestampMs <= targetMs && summary.timestampMs > bestCreatedMs) {\n bestCreatedMs = summary.timestampMs;\n best = { path: filePath, id: summary.id };\n }\n }\n return best;\n}\n\nfunction readSessionHeaderSummary(filePath: string): { id: string; timestampMs: number } | null {\n try {\n const raw = readTextFileIfExists(filePath);\n if (!raw) return null;\n const firstLine = raw.slice(0, raw.indexOf(\"\\n\")).trim();\n if (!firstLine) return null;\n const entry = parseSessionEntry(firstLine);\n const { id, timestamp } = entry as { id?: unknown; timestamp?: unknown };\n if (typeof id !== \"string\" || typeof timestamp !== \"string\") return null;\n const timestampMs = new Date(timestamp).getTime();\n return Number.isFinite(timestampMs) ? { id, timestampMs } : null;\n } catch {\n return null;\n }\n}\n"]}
|
package/dist/sessions/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ConversationKind } from "../adapter.js";
|
|
2
|
+
import type { SessionStore } from "../harness/index.js";
|
|
3
|
+
import type { ConversationLogMessage } from "../types.js";
|
|
2
4
|
export interface MikanSessionHeader {
|
|
3
5
|
type?: string;
|
|
4
6
|
version?: number;
|
|
@@ -32,7 +34,19 @@ export interface ResolvedSessionScope {
|
|
|
32
34
|
contextFile: string;
|
|
33
35
|
threadRootMessage: ThreadRootMessage | null;
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
/** One parsed log.jsonl entry with its original line index. */
|
|
38
|
+
export interface LogRecord {
|
|
39
|
+
message: ConversationLogMessage;
|
|
40
|
+
index: number;
|
|
41
|
+
}
|
|
42
|
+
/** What one sync pass actually did — the inspectable result of a sync. */
|
|
43
|
+
export interface ChatSyncReport {
|
|
44
|
+
/** Log messages appended to the session in this pass. */
|
|
45
|
+
appended: number;
|
|
46
|
+
/** The log message id recorded as the new sync watermark. */
|
|
47
|
+
lastMessageId?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ChatHistorySyncOptions {
|
|
36
50
|
recentDays?: number;
|
|
37
51
|
maxTopLevelMessages?: number;
|
|
38
52
|
now?: () => Date;
|
|
@@ -41,16 +55,16 @@ export interface ResolveChatSessionScopeOptions {
|
|
|
41
55
|
conversationDir: string;
|
|
42
56
|
sessionKey: string;
|
|
43
57
|
cwd?: string;
|
|
44
|
-
/** The triggering platform message ID.
|
|
58
|
+
/** The triggering platform message ID. History is capped before this turn to avoid future queued turns. */
|
|
45
59
|
currentMessageId?: string;
|
|
46
60
|
/** Rotate top-level shared sessions on biweekly Sunday boundaries. */
|
|
47
61
|
rotateTopLevelSession?: boolean;
|
|
48
62
|
}
|
|
49
|
-
export interface
|
|
63
|
+
export interface SyncChatSessionOptions {
|
|
50
64
|
conversationDir: string;
|
|
51
65
|
sessionKey: string;
|
|
52
|
-
sessionManager:
|
|
53
|
-
/** The triggering platform message ID.
|
|
66
|
+
sessionManager: SessionStore;
|
|
67
|
+
/** The triggering platform message ID. Sync is capped before this turn to avoid future queued turns. */
|
|
54
68
|
currentMessageId?: string;
|
|
55
69
|
}
|
|
56
70
|
export interface ResetChatSessionOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sessions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sessions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAID,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAA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ACxG,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,4BAA4B;IAC3C,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sessions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ConversationKind } from \"../adapter.js\";\n\n// ── session metadata ─────────────────────────────────────────────────────────\n\nexport interface MikanSessionHeader {\n type?: string;\n version?: number;\n id?: string;\n timestamp?: string;\n cwd?: string;\n parentSession?: string;\n source?: {\n kind?: string;\n file?: string;\n recentDays?: number;\n };\n}\n\n// ── session policy ───────────────────────────────────────────────────────────\n\nexport interface ResolveSessionKeyOptions {\n conversationId: string;\n conversationKind: ConversationKind;\n messageId: string;\n threadTs?: string;\n persistentTopLevel?: boolean;\n scopeDirectThreads?: boolean;\n}\n\n// ── session store ────────────────────────────────────────────────────────────\n\nexport interface ThreadRootMessage {\n text?: string;\n userName?: string;\n user?: string;\n loggedAt?: number;\n isMessagingBot?: boolean;\n}\n\nexport interface ResolvedSessionScope {\n sessionDir: string;\n contextFile: string;\n threadRootMessage: ThreadRootMessage | null;\n}\n\n// ── chat session
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sessions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ConversationKind } from \"../adapter.js\";\nimport type { SessionStore } from \"../harness/index.js\";\nimport type { ConversationLogMessage } from \"../types.js\";\n\n// ── session metadata ─────────────────────────────────────────────────────────\n\nexport interface MikanSessionHeader {\n type?: string;\n version?: number;\n id?: string;\n timestamp?: string;\n cwd?: string;\n parentSession?: string;\n source?: {\n kind?: string;\n file?: string;\n recentDays?: number;\n };\n}\n\n// ── session policy ───────────────────────────────────────────────────────────\n\nexport interface ResolveSessionKeyOptions {\n conversationId: string;\n conversationKind: ConversationKind;\n messageId: string;\n threadTs?: string;\n persistentTopLevel?: boolean;\n scopeDirectThreads?: boolean;\n}\n\n// ── session store ────────────────────────────────────────────────────────────\n\nexport interface ThreadRootMessage {\n text?: string;\n userName?: string;\n user?: string;\n loggedAt?: number;\n isMessagingBot?: boolean;\n}\n\nexport interface ResolvedSessionScope {\n sessionDir: string;\n contextFile: string;\n threadRootMessage: ThreadRootMessage | null;\n}\n\n/** One parsed log.jsonl entry with its original line index. */\nexport interface LogRecord {\n message: ConversationLogMessage;\n index: number;\n}\n\n// ── chat history sync ────────────────────────────────────────────────────────\n\n/** What one sync pass actually did — the inspectable result of a sync. */\nexport interface ChatSyncReport {\n /** Log messages appended to the session in this pass. */\n appended: number;\n /** The log message id recorded as the new sync watermark. */\n lastMessageId?: string;\n}\n\nexport interface ChatHistorySyncOptions {\n recentDays?: number;\n maxTopLevelMessages?: number;\n now?: () => Date;\n}\n\nexport interface ResolveChatSessionScopeOptions {\n conversationDir: string;\n sessionKey: string;\n cwd?: string;\n /** The triggering platform message ID. History is capped before this turn to avoid future queued turns. */\n currentMessageId?: string;\n /** Rotate top-level shared sessions on biweekly Sunday boundaries. */\n rotateTopLevelSession?: boolean;\n}\n\nexport interface SyncChatSessionOptions {\n conversationDir: string;\n sessionKey: string;\n sessionManager: SessionStore;\n /** The triggering platform message ID. Sync is capped before this turn to avoid future queued turns. */\n currentMessageId?: string;\n}\n\nexport interface ResetChatSessionOptions {\n conversationDir: string;\n sessionKey: string;\n cwd?: string;\n}\n\nexport interface RegisterThreadSessionOptions {\n conversationDir: string;\n sessionKey: string;\n cwd?: string;\n}\n\nexport interface HasMaterializedSessionOptions {\n conversationDir: string;\n sessionKey: string;\n}\n\nexport interface ThreadBootstrapWaitOptions {\n parentSessionKey: string;\n sessionKey: string;\n hasThreadSession: () => boolean;\n isParentRunning: () => boolean;\n sleep?: (ms: number) => Promise<void>;\n pollMs?: number;\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one writer seam for settings mutations that affect live conversations.
|
|
3
|
+
* Chat commands (/model, /sandbox) and the Admin portal are adapters here;
|
|
4
|
+
* none of them call updateConversationSettings/updateGlobalSettings directly
|
|
5
|
+
* for these keys anymore.
|
|
6
|
+
*
|
|
7
|
+
* Policy, uniform across all adapters:
|
|
8
|
+
* - llm.* changes bake into cached session runners, so a conversation-scoped
|
|
9
|
+
* change clears the conversation's cached runners BEFORE writing — and
|
|
10
|
+
* refuses (no write, no clear) while the conversation has a running job.
|
|
11
|
+
* Disk and cache never disagree.
|
|
12
|
+
* - Other keys (sandbox mount, slack replyMode, limits) are re-read at use
|
|
13
|
+
* time and write without touching runners.
|
|
14
|
+
* - Global changes always write (the Admin default surface), then clear every
|
|
15
|
+
* idle conversation's cached runners; conversations that were busy keep
|
|
16
|
+
* their old runner until it settles, are reported as stale, and are cleared
|
|
17
|
+
* automatically before their next turn.
|
|
18
|
+
*/
|
|
19
|
+
import { type WorkspacePolicyChoice } from "./config.js";
|
|
20
|
+
import type { Office } from "./office/index.js";
|
|
21
|
+
import type { AgentConfig, GlobalRunnerCacheControl, OfficeAddress, RunnerCacheControl, SettingsApplyResult } from "./types.js";
|
|
22
|
+
export type { GlobalRunnerCacheControl, RunnerCacheControl, SettingsApplyResult } from "./types.js";
|
|
23
|
+
export declare function applyConversationSettings(runtime: RunnerCacheControl | undefined, office: Office, patch: Partial<AgentConfig>): SettingsApplyResult;
|
|
24
|
+
export declare function applyGlobalSettings(runtime: GlobalRunnerCacheControl | undefined, patch: Partial<AgentConfig>): {
|
|
25
|
+
ok: true;
|
|
26
|
+
staleConversations: OfficeAddress[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Door-policy changes follow the same clear-or-refuse contract as model
|
|
30
|
+
* changes: the system prompt bakes the workspace projection (layout line,
|
|
31
|
+
* memory and skill guidance), so the cached runner must clear before the
|
|
32
|
+
* write, and the container is re-provisioned on the next message when its
|
|
33
|
+
* mount signature no longer matches.
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyConversationWorkspacePolicy(runtime: RunnerCacheControl | undefined, office: Office, choice: WorkspacePolicyChoice | null): SettingsApplyResult;
|
|
36
|
+
export declare function applyGlobalWorkspacePolicy(runtime: GlobalRunnerCacheControl | undefined, choice: WorkspacePolicyChoice | null): {
|
|
37
|
+
ok: true;
|
|
38
|
+
staleConversations: OfficeAddress[];
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=settings-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-mutation.d.ts","sourceRoot":"","sources":["../src/settings-mutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACxB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AASpG,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAC1B,mBAAmB,CAYrB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,wBAAwB,GAAG,SAAS,EAC7C,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,kBAAkB,EAAE,aAAa,EAAE,CAAA;CAAE,CAKnD;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,qBAAqB,GAAG,IAAI,GACnC,mBAAmB,CAMrB;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,wBAAwB,GAAG,SAAS,EAC7C,MAAM,EAAE,qBAAqB,GAAG,IAAI,GACnC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,kBAAkB,EAAE,aAAa,EAAE,CAAA;CAAE,CAInD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one writer seam for settings mutations that affect live conversations.
|
|
3
|
+
* Chat commands (/model, /sandbox) and the Admin portal are adapters here;
|
|
4
|
+
* none of them call updateConversationSettings/updateGlobalSettings directly
|
|
5
|
+
* for these keys anymore.
|
|
6
|
+
*
|
|
7
|
+
* Policy, uniform across all adapters:
|
|
8
|
+
* - llm.* changes bake into cached session runners, so a conversation-scoped
|
|
9
|
+
* change clears the conversation's cached runners BEFORE writing — and
|
|
10
|
+
* refuses (no write, no clear) while the conversation has a running job.
|
|
11
|
+
* Disk and cache never disagree.
|
|
12
|
+
* - Other keys (sandbox mount, slack replyMode, limits) are re-read at use
|
|
13
|
+
* time and write without touching runners.
|
|
14
|
+
* - Global changes always write (the Admin default surface), then clear every
|
|
15
|
+
* idle conversation's cached runners; conversations that were busy keep
|
|
16
|
+
* their old runner until it settles, are reported as stale, and are cleared
|
|
17
|
+
* automatically before their next turn.
|
|
18
|
+
*/
|
|
19
|
+
import { setConversationWorkspacePolicy, setGlobalWorkspacePolicy, updateConversationSettings, updateGlobalSettings, } from "./config.js";
|
|
20
|
+
/** True when a patch touches keys a cached session runner bakes in. */
|
|
21
|
+
function affectsCachedRunner(patch) {
|
|
22
|
+
return (patch.provider !== undefined || patch.model !== undefined || patch.thinkingLevel !== undefined);
|
|
23
|
+
}
|
|
24
|
+
export function applyConversationSettings(runtime, office, patch) {
|
|
25
|
+
let runtimeSwitched = null;
|
|
26
|
+
if (affectsCachedRunner(patch) && runtime) {
|
|
27
|
+
// Clear-or-refuse before writing. The clear and the write happen in the
|
|
28
|
+
// same synchronous tick, so no runner can be created in between.
|
|
29
|
+
if (!runtime.switchConversationModel(office.address, patch.provider ?? "", patch.model ?? "")) {
|
|
30
|
+
return { ok: false, reason: "busy" };
|
|
31
|
+
}
|
|
32
|
+
runtimeSwitched = true;
|
|
33
|
+
}
|
|
34
|
+
updateConversationSettings(office, patch);
|
|
35
|
+
return { ok: true, runtimeSwitched };
|
|
36
|
+
}
|
|
37
|
+
export function applyGlobalSettings(runtime, patch) {
|
|
38
|
+
updateGlobalSettings(patch);
|
|
39
|
+
const staleConversations = affectsCachedRunner(patch) && runtime ? runtime.refreshAllConversations().busy : [];
|
|
40
|
+
return { ok: true, staleConversations };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Door-policy changes follow the same clear-or-refuse contract as model
|
|
44
|
+
* changes: the system prompt bakes the workspace projection (layout line,
|
|
45
|
+
* memory and skill guidance), so the cached runner must clear before the
|
|
46
|
+
* write, and the container is re-provisioned on the next message when its
|
|
47
|
+
* mount signature no longer matches.
|
|
48
|
+
*/
|
|
49
|
+
export function applyConversationWorkspacePolicy(runtime, office, choice) {
|
|
50
|
+
if (runtime && !runtime.refreshConversationEnvironment(office.address)) {
|
|
51
|
+
return { ok: false, reason: "busy" };
|
|
52
|
+
}
|
|
53
|
+
setConversationWorkspacePolicy(office, choice);
|
|
54
|
+
return { ok: true, runtimeSwitched: runtime ? true : null };
|
|
55
|
+
}
|
|
56
|
+
export function applyGlobalWorkspacePolicy(runtime, choice) {
|
|
57
|
+
setGlobalWorkspacePolicy(choice);
|
|
58
|
+
const staleConversations = runtime ? runtime.refreshAllConversations().busy : [];
|
|
59
|
+
return { ok: true, staleConversations };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=settings-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-mutation.js","sourceRoot":"","sources":["../src/settings-mutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,EAC1B,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAYrB,uEAAuE;AACvE,SAAS,mBAAmB,CAAC,KAA2B;IACtD,OAAO,CACL,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,aAAa,KAAK,SAAS,CAC/F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,OAAuC,EACvC,MAAc,EACd,KAA2B;IAE3B,IAAI,eAAe,GAAmB,IAAI,CAAC;IAC3C,IAAI,mBAAmB,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;QAC1C,wEAAwE;QACxE,iEAAiE;QACjE,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;YAC9F,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACvC,CAAC;QACD,eAAe,GAAG,IAAI,CA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* Chat commands (/model, /sandbox) and the Admin portal are adapters here;\n * none of them call updateConversationSettings/updateGlobalSettings directly\n * for these keys anymore.\n *\n * Policy, uniform across all adapters:\n * - llm.* changes bake into cached session runners, so a conversation-scoped\n * change clears the conversation's cached runners BEFORE writing — and\n * refuses (no write, no clear) while the conversation has a running job.\n * Disk and cache never disagree.\n * - Other keys (sandbox mount, slack replyMode, limits) are re-read at use\n * time and write without touching runners.\n * - Global changes always write (the Admin default surface), then clear every\n * idle conversation's cached runners; conversations that were busy keep\n * their old runner until it settles, are reported as stale, and are cleared\n * automatically before their next turn.\n */\nimport {\n setConversationWorkspacePolicy,\n setGlobalWorkspacePolicy,\n updateConversationSettings,\n updateGlobalSettings,\n type WorkspacePolicyChoice,\n} from \"./config.js\";\nimport type { Office } from \"./office/index.js\";\nimport type {\n AgentConfig,\n GlobalRunnerCacheControl,\n OfficeAddress,\n RunnerCacheControl,\n SettingsApplyResult,\n} from \"./types.js\";\n\nexport type { GlobalRunnerCacheControl, RunnerCacheControl, SettingsApplyResult } from \"./types.js\";\n\n/** True when a patch touches keys a cached session runner bakes in. */\nfunction affectsCachedRunner(patch: Partial<AgentConfig>): boolean {\n return (\n patch.provider !== undefined || patch.model !== undefined || patch.thinkingLevel !== undefined\n );\n}\n\nexport function applyConversationSettings(\n runtime: RunnerCacheControl | undefined,\n office: Office,\n patch: Partial<AgentConfig>,\n): SettingsApplyResult {\n let runtimeSwitched: boolean | null = null;\n if (affectsCachedRunner(patch) && runtime) {\n // Clear-or-refuse before writing. The clear and the write happen in the\n // same synchronous tick, so no runner can be created in between.\n if (!runtime.switchConversationModel(office.address, patch.provider ?? \"\", patch.model ?? \"\")) {\n return { ok: false, reason: \"busy\" };\n }\n runtimeSwitched = true;\n }\n updateConversationSettings(office, patch);\n return { ok: true, runtimeSwitched };\n}\n\nexport function applyGlobalSettings(\n runtime: GlobalRunnerCacheControl | undefined,\n patch: Partial<AgentConfig>,\n): { ok: true; staleConversations: OfficeAddress[] } {\n updateGlobalSettings(patch);\n const staleConversations =\n affectsCachedRunner(patch) && runtime ? runtime.refreshAllConversations().busy : [];\n return { ok: true, staleConversations };\n}\n\n/**\n * Door-policy changes follow the same clear-or-refuse contract as model\n * changes: the system prompt bakes the workspace projection (layout line,\n * memory and skill guidance), so the cached runner must clear before the\n * write, and the container is re-provisioned on the next message when its\n * mount signature no longer matches.\n */\nexport function applyConversationWorkspacePolicy(\n runtime: RunnerCacheControl | undefined,\n office: Office,\n choice: WorkspacePolicyChoice | null,\n): SettingsApplyResult {\n if (runtime && !runtime.refreshConversationEnvironment(office.address)) {\n return { ok: false, reason: \"busy\" };\n }\n setConversationWorkspacePolicy(office, choice);\n return { ok: true, runtimeSwitched: runtime ? true : null };\n}\n\nexport function applyGlobalWorkspacePolicy(\n runtime: GlobalRunnerCacheControl | undefined,\n choice: WorkspacePolicyChoice | null,\n): { ok: true; staleConversations: OfficeAddress[] } {\n setGlobalWorkspacePolicy(choice);\n const staleConversations = runtime ? runtime.refreshAllConversations().busy : [];\n return { ok: true, staleConversations };\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SubagentProgressNode, SubagentProgressSnapshot } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The subagent progress snapshot module. The snapshot crosses an untyped
|
|
4
|
+
* transport (tool update `details`) between the subagent tool and the harness,
|
|
5
|
+
* so producer construction, consumer parsing, display bounds, the
|
|
6
|
+
* status→presentation tables, settling, merging, and the response-source
|
|
7
|
+
* rendering all live here — one module owns the shape end to end. Every
|
|
8
|
+
* adapter now takes the same Markdown dashboard, so nothing is exported for
|
|
9
|
+
* a caller to re-render from parts.
|
|
10
|
+
*/
|
|
11
|
+
/** Longest label the dashboard renders; longer ones are clamped, never rejected. */
|
|
12
|
+
export declare const MAX_SUBAGENT_LABEL_CHARS = 100;
|
|
13
|
+
/** Clamp a label to the display bound, ending a truncation visibly with `…`. */
|
|
14
|
+
export declare function clampSubagentLabel(label: string): string;
|
|
15
|
+
/** The display bounds, applied once at construction and again on parse. */
|
|
16
|
+
export declare function boundSubagentProgressNode(node: SubagentProgressNode): SubagentProgressNode;
|
|
17
|
+
/**
|
|
18
|
+
* Parse a snapshot back off the untyped transport. All-or-nothing: one
|
|
19
|
+
* malformed node means the payload is not ours (any tool can put anything in
|
|
20
|
+
* `details`), so the whole candidate is rejected rather than partially shown.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseSubagentProgressSnapshot(value: unknown): SubagentProgressSnapshot | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Project a live snapshot to its end-of-tool state: nodes still pending or
|
|
25
|
+
* running settle to the tool call's outcome. Metrics spread through
|
|
26
|
+
* unchanged — an unsettled node never reported any.
|
|
27
|
+
*/
|
|
28
|
+
export declare function settleSubagentProgress(snapshot: SubagentProgressSnapshot, isError: boolean): SubagentProgressSnapshot;
|
|
29
|
+
/**
|
|
30
|
+
* Fold concurrent or successive subagent fan-outs into the single snapshot the
|
|
31
|
+
* dashboard renders. A run can call the subagent tool more than once; picking
|
|
32
|
+
* one snapshot would drop the others' cost and status, and alternating between
|
|
33
|
+
* them makes the live view flicker. Node ids are namespaced by source because
|
|
34
|
+
* each fan-out numbers its own nodes from zero.
|
|
35
|
+
*/
|
|
36
|
+
export declare function mergeSubagentProgress(snapshots: readonly SubagentProgressSnapshot[]): SubagentProgressSnapshot | undefined;
|
|
37
|
+
/** The dashboard as response source Markdown; adapters own any conversion. */
|
|
38
|
+
export declare function renderSubagentDashboard(snapshot: SubagentProgressSnapshot): string;
|
|
39
|
+
//# sourceMappingURL=subagent-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent-progress.d.ts","sourceRoot":"","sources":["../src/subagent-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EAEzB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;GAQG;AAEH,oFAAoF;AACpF,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAoC5C,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED,2EAA2E;AAC3E,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,oBAAoB,GAAG,oBAAoB,CAU1F;AAsCD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,GACb,wBAAwB,GAAG,SAAS,CAgBtC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,wBAAwB,EAClC,OAAO,EAAE,OAAO,GACf,wBAAwB,CAS1B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,wBAAwB,EAAE,GAC7C,wBAAwB,GAAG,SAAS,CAYtC;AAoFD,8EAA8E;AAC9E,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,CAOlF"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The subagent progress snapshot module. The snapshot crosses an untyped
|
|
3
|
+
* transport (tool update `details`) between the subagent tool and the harness,
|
|
4
|
+
* so producer construction, consumer parsing, display bounds, the
|
|
5
|
+
* status→presentation tables, settling, merging, and the response-source
|
|
6
|
+
* rendering all live here — one module owns the shape end to end. Every
|
|
7
|
+
* adapter now takes the same Markdown dashboard, so nothing is exported for
|
|
8
|
+
* a caller to re-render from parts.
|
|
9
|
+
*/
|
|
10
|
+
/** Longest label the dashboard renders; longer ones are clamped, never rejected. */
|
|
11
|
+
export const MAX_SUBAGENT_LABEL_CHARS = 100;
|
|
12
|
+
const MAX_PROFILE_CHARS = 64;
|
|
13
|
+
const MAX_REASON_CHARS = 240;
|
|
14
|
+
const MAX_ACTIVITY_CHARS = 80;
|
|
15
|
+
const SUBAGENT_STATUS_MARKER = {
|
|
16
|
+
pending: "○",
|
|
17
|
+
running: "●",
|
|
18
|
+
completed: "✓",
|
|
19
|
+
failed: "✗",
|
|
20
|
+
cancelled: "■",
|
|
21
|
+
timeout: "◷",
|
|
22
|
+
budget_exceeded: "!",
|
|
23
|
+
invalid_output: "✗",
|
|
24
|
+
skipped: "⊘",
|
|
25
|
+
};
|
|
26
|
+
const SUBAGENT_STATUS_LABEL = {
|
|
27
|
+
pending: "Waiting",
|
|
28
|
+
running: "Running",
|
|
29
|
+
completed: "Completed",
|
|
30
|
+
failed: "Failed",
|
|
31
|
+
cancelled: "Cancelled",
|
|
32
|
+
timeout: "Timed out",
|
|
33
|
+
budget_exceeded: "Budget exceeded",
|
|
34
|
+
invalid_output: "Invalid output",
|
|
35
|
+
skipped: "Skipped",
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Derived from the marker table, which `satisfies` keeps exhaustive: a new
|
|
39
|
+
* terminal status is a compile error there, and this runtime set follows —
|
|
40
|
+
* the validator can never silently drop a status the tables know about.
|
|
41
|
+
*/
|
|
42
|
+
const VALID_STATUSES = new Set(Object.keys(SUBAGENT_STATUS_MARKER));
|
|
43
|
+
/** Clamp a label to the display bound, ending a truncation visibly with `…`. */
|
|
44
|
+
export function clampSubagentLabel(label) {
|
|
45
|
+
if (label.length <= MAX_SUBAGENT_LABEL_CHARS)
|
|
46
|
+
return label;
|
|
47
|
+
return `${label.slice(0, MAX_SUBAGENT_LABEL_CHARS - 1)}…`;
|
|
48
|
+
}
|
|
49
|
+
/** The display bounds, applied once at construction and again on parse. */
|
|
50
|
+
export function boundSubagentProgressNode(node) {
|
|
51
|
+
return {
|
|
52
|
+
...node,
|
|
53
|
+
label: clampSubagentLabel(node.label),
|
|
54
|
+
...(node.profile !== undefined ? { profile: node.profile.slice(0, MAX_PROFILE_CHARS) } : {}),
|
|
55
|
+
...(node.activity !== undefined
|
|
56
|
+
? { activity: node.activity.slice(0, MAX_ACTIVITY_CHARS) }
|
|
57
|
+
: {}),
|
|
58
|
+
...(node.reason !== undefined ? { reason: node.reason.slice(0, MAX_REASON_CHARS) } : {}),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function parseNode(value) {
|
|
62
|
+
if (!value || typeof value !== "object")
|
|
63
|
+
return undefined;
|
|
64
|
+
const item = value;
|
|
65
|
+
if (typeof item.id !== "string" ||
|
|
66
|
+
typeof item.label !== "string" ||
|
|
67
|
+
typeof item.status !== "string" ||
|
|
68
|
+
!VALID_STATUSES.has(item.status)) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return boundSubagentProgressNode({
|
|
72
|
+
id: item.id,
|
|
73
|
+
label: item.label,
|
|
74
|
+
status: item.status,
|
|
75
|
+
...(typeof item.profile === "string" ? { profile: item.profile } : {}),
|
|
76
|
+
...(typeof item.turns === "number" ? { turns: item.turns } : {}),
|
|
77
|
+
...(typeof item.toolCalls === "number" ? { toolCalls: item.toolCalls } : {}),
|
|
78
|
+
...(item.toolCallCounts && typeof item.toolCallCounts === "object"
|
|
79
|
+
? {
|
|
80
|
+
toolCallCounts: Object.fromEntries(Object.entries(item.toolCallCounts).filter((entry) => typeof entry[1] === "number")),
|
|
81
|
+
}
|
|
82
|
+
: {}),
|
|
83
|
+
...(typeof item.tokens === "number" ? { tokens: item.tokens } : {}),
|
|
84
|
+
...(typeof item.costUsd === "number" ? { costUsd: item.costUsd } : {}),
|
|
85
|
+
...(typeof item.durationMs === "number" ? { durationMs: item.durationMs } : {}),
|
|
86
|
+
...(typeof item.activity === "string" ? { activity: item.activity } : {}),
|
|
87
|
+
...(typeof item.reason === "string" ? { reason: item.reason } : {}),
|
|
88
|
+
...(item.cleanupPending === true ? { cleanupPending: true } : {}),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Parse a snapshot back off the untyped transport. All-or-nothing: one
|
|
93
|
+
* malformed node means the payload is not ours (any tool can put anything in
|
|
94
|
+
* `details`), so the whole candidate is rejected rather than partially shown.
|
|
95
|
+
*/
|
|
96
|
+
export function parseSubagentProgressSnapshot(value) {
|
|
97
|
+
if (!value || typeof value !== "object")
|
|
98
|
+
return undefined;
|
|
99
|
+
const candidate = value;
|
|
100
|
+
if ((candidate.mode !== "single" && candidate.mode !== "parallel" && candidate.mode !== "dag") ||
|
|
101
|
+
!Array.isArray(candidate.nodes)) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
const nodes = [];
|
|
105
|
+
for (const node of candidate.nodes) {
|
|
106
|
+
const parsed = parseNode(node);
|
|
107
|
+
if (!parsed)
|
|
108
|
+
return undefined;
|
|
109
|
+
nodes.push(parsed);
|
|
110
|
+
}
|
|
111
|
+
return { mode: candidate.mode, nodes };
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Project a live snapshot to its end-of-tool state: nodes still pending or
|
|
115
|
+
* running settle to the tool call's outcome. Metrics spread through
|
|
116
|
+
* unchanged — an unsettled node never reported any.
|
|
117
|
+
*/
|
|
118
|
+
export function settleSubagentProgress(snapshot, isError) {
|
|
119
|
+
return {
|
|
120
|
+
...snapshot,
|
|
121
|
+
nodes: snapshot.nodes.map((node) => node.status !== "running" && node.status !== "pending"
|
|
122
|
+
? node
|
|
123
|
+
: { ...node, status: isError ? "failed" : "completed" }),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Fold concurrent or successive subagent fan-outs into the single snapshot the
|
|
128
|
+
* dashboard renders. A run can call the subagent tool more than once; picking
|
|
129
|
+
* one snapshot would drop the others' cost and status, and alternating between
|
|
130
|
+
* them makes the live view flicker. Node ids are namespaced by source because
|
|
131
|
+
* each fan-out numbers its own nodes from zero.
|
|
132
|
+
*/
|
|
133
|
+
export function mergeSubagentProgress(snapshots) {
|
|
134
|
+
if (snapshots.length === 0)
|
|
135
|
+
return undefined;
|
|
136
|
+
if (snapshots.length === 1)
|
|
137
|
+
return snapshots[0];
|
|
138
|
+
const nodes = snapshots.flatMap((snapshot, index) => snapshot.nodes.map((node) => ({ ...node, id: `${index}:${node.id}` })));
|
|
139
|
+
const mode = snapshots.some((snapshot) => snapshot.mode === "dag")
|
|
140
|
+
? "dag"
|
|
141
|
+
: nodes.length > 1
|
|
142
|
+
? "parallel"
|
|
143
|
+
: "single";
|
|
144
|
+
return { mode, nodes };
|
|
145
|
+
}
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
// Dashboard text
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
function settledCount(snapshot) {
|
|
150
|
+
return snapshot.nodes.filter((node) => node.status !== "pending" && node.status !== "running")
|
|
151
|
+
.length;
|
|
152
|
+
}
|
|
153
|
+
function modeLabel(snapshot) {
|
|
154
|
+
if (snapshot.mode === "dag")
|
|
155
|
+
return "DAG";
|
|
156
|
+
if (snapshot.mode === "parallel")
|
|
157
|
+
return "Parallel";
|
|
158
|
+
return "Run";
|
|
159
|
+
}
|
|
160
|
+
function escapeMarkdown(text) {
|
|
161
|
+
return text.replace(/([\\`*_{}[\]()<>#+\-.!|~])/g, "\\$1");
|
|
162
|
+
}
|
|
163
|
+
function compactNumber(value) {
|
|
164
|
+
return new Intl.NumberFormat("en", { notation: "compact", maximumFractionDigits: 1 }).format(value);
|
|
165
|
+
}
|
|
166
|
+
function summaryText(snapshot) {
|
|
167
|
+
const totals = snapshot.nodes.reduce((sum, node) => ({
|
|
168
|
+
turns: sum.turns + (node.turns ?? 0),
|
|
169
|
+
toolCalls: sum.toolCalls + (node.toolCalls ?? 0),
|
|
170
|
+
tokens: sum.tokens + (node.tokens ?? 0),
|
|
171
|
+
costUsd: sum.costUsd + (node.costUsd ?? 0),
|
|
172
|
+
}), { turns: 0, toolCalls: 0, tokens: 0, costUsd: 0 });
|
|
173
|
+
return [
|
|
174
|
+
totals.turns > 0 ? `${totals.turns} LLM turns` : undefined,
|
|
175
|
+
totals.toolCalls > 0 ? `${totals.toolCalls} tool calls` : undefined,
|
|
176
|
+
totals.tokens > 0 ? `${compactNumber(totals.tokens)} tokens` : undefined,
|
|
177
|
+
totals.costUsd > 0 ? `$${totals.costUsd.toFixed(4)}` : undefined,
|
|
178
|
+
]
|
|
179
|
+
.filter(Boolean)
|
|
180
|
+
.join(" · ");
|
|
181
|
+
}
|
|
182
|
+
/** The dashboard's one-line summary header, unformatted. */
|
|
183
|
+
function dashboardHeader(snapshot) {
|
|
184
|
+
const base = `Subagents · ${settledCount(snapshot)}/${snapshot.nodes.length} · ${modeLabel(snapshot)}`;
|
|
185
|
+
const summary = summaryText(snapshot);
|
|
186
|
+
return summary ? `${base} · ${summary}` : base;
|
|
187
|
+
}
|
|
188
|
+
function countLabel(count, singular) {
|
|
189
|
+
return `${count} ${singular}${count === 1 ? "" : "s"}`;
|
|
190
|
+
}
|
|
191
|
+
function detailText(node) {
|
|
192
|
+
const toolBreakdown = node.toolCallCounts
|
|
193
|
+
? Object.entries(node.toolCallCounts)
|
|
194
|
+
.map(([name, count]) => `${name} ×${count}`)
|
|
195
|
+
.join(" · ")
|
|
196
|
+
: undefined;
|
|
197
|
+
const metrics = [
|
|
198
|
+
node.turns !== undefined ? countLabel(node.turns, "LLM turn") : undefined,
|
|
199
|
+
node.toolCalls !== undefined ? countLabel(node.toolCalls, "tool call") : undefined,
|
|
200
|
+
toolBreakdown,
|
|
201
|
+
node.tokens !== undefined ? `${compactNumber(node.tokens)} tokens` : undefined,
|
|
202
|
+
node.costUsd !== undefined ? `$${node.costUsd.toFixed(4)}` : undefined,
|
|
203
|
+
node.durationMs !== undefined ? `${(node.durationMs / 1000).toFixed(1)}s` : undefined,
|
|
204
|
+
].filter(Boolean);
|
|
205
|
+
const reason = node.cleanupPending ? "Cleanup pending; usage is provisional" : node.reason;
|
|
206
|
+
// Activity is shown only while running, and that is exactly when there is
|
|
207
|
+
// nothing else: a node reports its metrics on the way out, so without this
|
|
208
|
+
// the whole of a long step reads "Running · profile" and never changes.
|
|
209
|
+
const activity = node.status === "running" ? node.activity : undefined;
|
|
210
|
+
// Profile leads the line: when a node reports no tool calls, the profile is
|
|
211
|
+
// what says whether that was the plan or a bad pick.
|
|
212
|
+
return [SUBAGENT_STATUS_LABEL[node.status], node.profile, activity, ...metrics, reason]
|
|
213
|
+
.filter(Boolean)
|
|
214
|
+
.join(" · ");
|
|
215
|
+
}
|
|
216
|
+
/** The dashboard as response source Markdown; adapters own any conversion. */
|
|
217
|
+
export function renderSubagentDashboard(snapshot) {
|
|
218
|
+
const header = `**${dashboardHeader(snapshot)}**`;
|
|
219
|
+
const rows = snapshot.nodes.flatMap((node) => [
|
|
220
|
+
`${SUBAGENT_STATUS_MARKER[node.status]} ${escapeMarkdown(node.label)}`,
|
|
221
|
+
`└ ${detailText(node)}`,
|
|
222
|
+
]);
|
|
223
|
+
return [header, ...rows].join("\n");
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=subagent-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent-progress.js","sourceRoot":"","sources":["../src/subagent-progress.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAAM,sBAAsB,GAAG;IAC7B,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;IACZ,SAAS,EAAE,GAAG;IACd,MAAM,EAAE,GAAG;IACX,SAAS,EAAE,GAAG;IACd,OAAO,EAAE,GAAG;IACZ,eAAe,EAAE,GAAG;IACpB,cAAc,EAAE,GAAG;IACnB,OAAO,EAAE,GAAG;CACoC,CAAC;AAEnD,MAAM,qBAAqB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,WAAW;IACpB,eAAe,EAAE,iBAAiB;IAClC,c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apshot module. The snapshot crosses an untyped\n * transport (tool update `details`) between the subagent tool and the harness,\n * so producer construction, consumer parsing, display bounds, the\n * status→presentation tables, settling, merging, and the response-source\n * rendering all live here — one module owns the shape end to end. Every\n * adapter now takes the same Markdown dashboard, so nothing is exported for\n * a caller to re-render from parts.\n */\n\n/** Longest label the dashboard renders; longer ones are clamped, never rejected. */\nexport const MAX_SUBAGENT_LABEL_CHARS = 100;\nconst MAX_PROFILE_CHARS = 64;\nconst MAX_REASON_CHARS = 240;\nconst MAX_ACTIVITY_CHARS = 80;\n\nconst SUBAGENT_STATUS_MARKER = {\n pending: \"○\",\n running: \"●\",\n completed: \"✓\",\n failed: \"✗\",\n cancelled: \"■\",\n timeout: \"◷\",\n budget_exceeded: \"!\",\n invalid_output: \"✗\",\n skipped: \"⊘\",\n} satisfies Record<SubagentProgressStatus, string>;\n\nconst SUBAGENT_STATUS_LABEL = {\n pending: \"Waiting\",\n running: \"Running\",\n completed: \"Completed\",\n failed: \"Failed\",\n cancelled: \"Cancelled\",\n timeout: \"Timed out\",\n budget_exceeded: \"Budget exceeded\",\n invalid_output: \"Invalid output\",\n skipped: \"Skipped\",\n} satisfies Record<SubagentProgressStatus, string>;\n\n/**\n * Derived from the marker table, which `satisfies` keeps exhaustive: a new\n * terminal status is a compile error there, and this runtime set follows —\n * the validator can never silently drop a status the tables know about.\n */\nconst VALID_STATUSES: ReadonlySet<string> = new Set(Object.keys(SUBAGENT_STATUS_MARKER));\n\n/** Clamp a label to the display bound, ending a truncation visibly with `…`. */\nexport function clampSubagentLabel(label: string): string {\n if (label.length <= MAX_SUBAGENT_LABEL_CHARS) return label;\n return `${label.slice(0, MAX_SUBAGENT_LABEL_CHARS - 1)}…`;\n}\n\n/** The display bounds, applied once at construction and again on parse. */\nexport function boundSubagentProgressNode(node: SubagentProgressNode): SubagentProgressNode {\n return {\n ...node,\n label: clampSubagentLabel(node.label),\n ...(node.profile !== undefined ? { profile: node.profile.slice(0, MAX_PROFILE_CHARS) } : {}),\n ...(node.activity !== undefined\n ? { activity: node.activity.slice(0, MAX_ACTIVITY_CHARS) }\n : {}),\n ...(node.reason !== undefined ? { reason: node.reason.slice(0, MAX_REASON_CHARS) } : {}),\n };\n}\n\nfunction parseNode(value: unknown): SubagentProgressNode | undefined {\n if (!value || typeof value !== \"object\") return undefined;\n const item = value as Record<keyof SubagentProgressNode, unknown>;\n if (\n typeof item.id !== \"string\" ||\n typeof item.label !== \"string\" ||\n typeof item.status !== \"string\" ||\n !VALID_STATUSES.has(item.status)\n ) {\n return undefined;\n }\n return boundSubagentProgressNode({\n id: item.id,\n label: item.label,\n status: item.status as SubagentProgressStatus,\n ...(typeof item.profile === \"string\" ? { profile: item.profile } : {}),\n ...(typeof item.turns === \"number\" ? { turns: item.turns } : {}),\n ...(typeof item.toolCalls === \"number\" ? { toolCalls: item.toolCalls } : {}),\n ...(item.toolCallCounts && typeof item.toolCallCounts === \"object\"\n ? {\n toolCallCounts: Object.fromEntries(\n Object.entries(item.toolCallCounts).filter(\n (entry): entry is [string, number] => typeof entry[1] === \"number\",\n ),\n ),\n }\n : {}),\n ...(typeof item.tokens === \"number\" ? { tokens: item.tokens } : {}),\n ...(typeof item.costUsd === \"number\" ? { costUsd: item.costUsd } : {}),\n ...(typeof item.durationMs === \"number\" ? { durationMs: item.durationMs } : {}),\n ...(typeof item.activity === \"string\" ? { activity: item.activity } : {}),\n ...(typeof item.reason === \"string\" ? { reason: item.reason } : {}),\n ...(item.cleanupPending === true ? { cleanupPending: true } : {}),\n });\n}\n\n/**\n * Parse a snapshot back off the untyped transport. All-or-nothing: one\n * malformed node means the payload is not ours (any tool can put anything in\n * `details`), so the whole candidate is rejected rather than partially shown.\n */\nexport function parseSubagentProgressSnapshot(\n value: unknown,\n): SubagentProgressSnapshot | undefined {\n if (!value || typeof value !== \"object\") return undefined;\n const candidate = value as { mode?: unknown; nodes?: unknown };\n if (\n (candidate.mode !== \"single\" && candidate.mode !== \"parallel\" && candidate.mode !== \"dag\") ||\n !Array.isArray(candidate.nodes)\n ) {\n return undefined;\n }\n const nodes: SubagentProgressNode[] = [];\n for (const node of candidate.nodes) {\n const parsed = parseNode(node);\n if (!parsed) return undefined;\n nodes.push(parsed);\n }\n return { mode: candidate.mode, nodes };\n}\n\n/**\n * Project a live snapshot to its end-of-tool state: nodes still pending or\n * running settle to the tool call's outcome. Metrics spread through\n * unchanged — an unsettled node never reported any.\n */\nexport function settleSubagentProgress(\n snapshot: SubagentProgressSnapshot,\n isError: boolean,\n): SubagentProgressSnapshot {\n return {\n ...snapshot,\n nodes: snapshot.nodes.map((node) =>\n node.status !== \"running\" && node.status !== \"pending\"\n ? node\n : { ...node, status: isError ? \"failed\" : \"completed\" },\n ),\n };\n}\n\n/**\n * Fold concurrent or successive subagent fan-outs into the single snapshot the\n * dashboard renders. A run can call the subagent tool more than once; picking\n * one snapshot would drop the others' cost and status, and alternating between\n * them makes the live view flicker. Node ids are namespaced by source because\n * each fan-out numbers its own nodes from zero.\n */\nexport function mergeSubagentProgress(\n snapshots: readonly SubagentProgressSnapshot[],\n): SubagentProgressSnapshot | undefined {\n if (snapshots.length === 0) return undefined;\n if (snapshots.length === 1) return snapshots[0];\n const nodes = snapshots.flatMap((snapshot, index) =>\n snapshot.nodes.map((node) => ({ ...node, id: `${index}:${node.id}` })),\n );\n const mode = snapshots.some((snapshot) => snapshot.mode === \"dag\")\n ? \"dag\"\n : nodes.length > 1\n ? \"parallel\"\n : \"single\";\n return { mode, nodes };\n}\n\n// ---------------------------------------------------------------------------\n// Dashboard text\n// ---------------------------------------------------------------------------\n\nfunction settledCount(snapshot: SubagentProgressSnapshot): number {\n return snapshot.nodes.filter((node) => node.status !== \"pending\" && node.status !== \"running\")\n .length;\n}\n\nfunction modeLabel(snapshot: SubagentProgressSnapshot): string {\n if (snapshot.mode === \"dag\") return \"DAG\";\n if (snapshot.mode === \"parallel\") return \"Parallel\";\n return \"Run\";\n}\n\nfunction escapeMarkdown(text: string): string {\n return text.replace(/([\\\\`*_{}[\\]()<>#+\\-.!|~])/g, \"\\\\$1\");\n}\n\nfunction compactNumber(value: number): string {\n return new Intl.NumberFormat(\"en\", { notation: \"compact\", maximumFractionDigits: 1 }).format(\n value,\n );\n}\n\nfunction summaryText(snapshot: SubagentProgressSnapshot): string {\n const totals = snapshot.nodes.reduce(\n (sum, node) => ({\n turns: sum.turns + (node.turns ?? 0),\n toolCalls: sum.toolCalls + (node.toolCalls ?? 0),\n tokens: sum.tokens + (node.tokens ?? 0),\n costUsd: sum.costUsd + (node.costUsd ?? 0),\n }),\n { turns: 0, toolCalls: 0, tokens: 0, costUsd: 0 },\n );\n return [\n totals.turns > 0 ? `${totals.turns} LLM turns` : undefined,\n totals.toolCalls > 0 ? `${totals.toolCalls} tool calls` : undefined,\n totals.tokens > 0 ? `${compactNumber(totals.tokens)} tokens` : undefined,\n totals.costUsd > 0 ? `$${totals.costUsd.toFixed(4)}` : undefined,\n ]\n .filter(Boolean)\n .join(\" · \");\n}\n\n/** The dashboard's one-line summary header, unformatted. */\nfunction dashboardHeader(snapshot: SubagentProgressSnapshot): string {\n const base = `Subagents · ${settledCount(snapshot)}/${snapshot.nodes.length} · ${modeLabel(snapshot)}`;\n const summary = summaryText(snapshot);\n return summary ? `${base} · ${summary}` : base;\n}\n\nfunction countLabel(count: number, singular: string): string {\n return `${count} ${singular}${count === 1 ? \"\" : \"s\"}`;\n}\n\nfunction detailText(node: SubagentProgressNode): string {\n const toolBreakdown = node.toolCallCounts\n ? Object.entries(node.toolCallCounts)\n .map(([name, count]) => `${name} ×${count}`)\n .join(\" · \")\n : undefined;\n const metrics = [\n node.turns !== undefined ? countLabel(node.turns, \"LLM turn\") : undefined,\n node.toolCalls !== undefined ? countLabel(node.toolCalls, \"tool call\") : undefined,\n toolBreakdown,\n node.tokens !== undefined ? `${compactNumber(node.tokens)} tokens` : undefined,\n node.costUsd !== undefined ? `$${node.costUsd.toFixed(4)}` : undefined,\n node.durationMs !== undefined ? `${(node.durationMs / 1000).toFixed(1)}s` : undefined,\n ].filter(Boolean);\n const reason = node.cleanupPending ? \"Cleanup pending; usage is provisional\" : node.reason;\n // Activity is shown only while running, and that is exactly when there is\n // nothing else: a node reports its metrics on the way out, so without this\n // the whole of a long step reads \"Running · profile\" and never changes.\n const activity = node.status === \"running\" ? node.activity : undefined;\n // Profile leads the line: when a node reports no tool calls, the profile is\n // what says whether that was the plan or a bad pick.\n return [SUBAGENT_STATUS_LABEL[node.status], node.profile, activity, ...metrics, reason]\n .filter(Boolean)\n .join(\" · \");\n}\n\n/** The dashboard as response source Markdown; adapters own any conversion. */\nexport function renderSubagentDashboard(snapshot: SubagentProgressSnapshot): string {\n const header = `**${dashboardHeader(snapshot)}**`;\n const rows = snapshot.nodes.flatMap((node) => [\n `${SUBAGENT_STATUS_MARKER[node.status]} ${escapeMarkdown(node.label)}`,\n `└ ${detailText(node)}`,\n ]);\n return [header, ...rows].join(\"\\n\");\n}\n"]}
|
package/dist/tools/bash.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ declare const bashSchema: import("@sinclair/typebox").TObject<{
|
|
|
5
5
|
command: import("@sinclair/typebox").TString;
|
|
6
6
|
timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
7
7
|
}>;
|
|
8
|
-
export declare function createBashTool(executor: Executor
|
|
8
|
+
export declare function createBashTool(executor: Executor, options?: {
|
|
9
|
+
hostWorkspaceRoot?: string;
|
|
10
|
+
}): AgentTool<typeof bashSchema>;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=bash.d.ts.map
|
package/dist/tools/bash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAmBpD,QAAA,MAAM,UAAU;;;;EAQd,CAAC;AAOH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,SAAS,CAAC,OAAO,UAAU,CAAC,CAgF9B"}
|