@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
|
@@ -17,99 +17,270 @@
|
|
|
17
17
|
* }
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
|
-
* Hooks run in registration order.
|
|
21
|
-
* non-undefined
|
|
22
|
-
*
|
|
20
|
+
* Hooks run in registration order. Result semantics are per hook:
|
|
21
|
+
* `tool_call` keeps v1's first-non-undefined-wins; `before_agent_start`,
|
|
22
|
+
* `context`, `message_end`, and `tool_result` chain — each handler sees the
|
|
23
|
+
* event as rewritten by earlier handlers, and for `before_agent_start` a
|
|
24
|
+
* `block` from any handler wins. Hook errors are logged and never crash a run.
|
|
23
25
|
*/
|
|
24
26
|
import type { AgentMessage, AgentTool, ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
25
|
-
import type { Api, ImageContent, Model, TextContent } from "@earendil-works/pi-ai";
|
|
26
|
-
import type {
|
|
27
|
-
import type {
|
|
27
|
+
import type { Api, ImageContent, Model, TextContent, Usage } from "@earendil-works/pi-ai";
|
|
28
|
+
import type { TSchema } from "@sinclair/typebox";
|
|
29
|
+
import type { EventFilePayload, MikanSkill } from "../types.js";
|
|
30
|
+
import type { ExtensionRegistry } from "./registry.js";
|
|
31
|
+
import type { SubagentRunOutput, SubagentRunRequest, SubagentRunResult, CompactionEntry } from "../types.js";
|
|
32
|
+
import type { OfficeAddress, PlatformHistoryMessage, PlatformHistoryOptions, PlatformUserInfo } from "../../types.js";
|
|
33
|
+
/**
|
|
34
|
+
* Platform provenance of the run a hook event belongs to. Interactive runs
|
|
35
|
+
* carry the triggering message's identity (usable with `api.react` and for
|
|
36
|
+
* per-user policy); autonomous runs (schedules/events) have no triggering
|
|
37
|
+
* platform message, so only `kind` and `platform` are set.
|
|
38
|
+
*/
|
|
39
|
+
export interface RunOrigin {
|
|
40
|
+
kind: "interactive" | "event";
|
|
41
|
+
/** Platform adapter name serving this run (e.g. "slack"). */
|
|
42
|
+
platform?: string;
|
|
43
|
+
/** Platform message id of the triggering message; pass to `api.react`. */
|
|
44
|
+
messageTs?: string;
|
|
45
|
+
userId?: string;
|
|
46
|
+
userName?: string;
|
|
47
|
+
threadTs?: string;
|
|
48
|
+
/** Attachments already downloaded to host paths (extensions run on host). */
|
|
49
|
+
attachments?: {
|
|
50
|
+
name: string;
|
|
51
|
+
localPath: string;
|
|
52
|
+
}[];
|
|
53
|
+
}
|
|
28
54
|
export interface BeforeAgentStartHookEvent {
|
|
29
55
|
prompt: string;
|
|
30
56
|
images?: ImageContent[];
|
|
31
57
|
systemPrompt: string;
|
|
58
|
+
origin?: RunOrigin;
|
|
32
59
|
}
|
|
33
60
|
export interface BeforeAgentStartHookResult {
|
|
34
61
|
/** Replace the system prompt for this turn. */
|
|
35
62
|
systemPrompt?: string;
|
|
63
|
+
/** Rewrite the user prompt for this turn. */
|
|
64
|
+
prompt?: string;
|
|
65
|
+
/** Block the turn entirely; the model is never called and nothing persists. */
|
|
66
|
+
block?: boolean;
|
|
67
|
+
/** Shown to the user when the turn is blocked. */
|
|
68
|
+
reason?: string;
|
|
36
69
|
}
|
|
37
70
|
export interface ToolCallHookEvent {
|
|
38
71
|
toolCallId: string;
|
|
39
72
|
toolName: string;
|
|
40
73
|
args: unknown;
|
|
74
|
+
origin?: RunOrigin;
|
|
41
75
|
}
|
|
42
76
|
export interface ToolCallHookResult {
|
|
43
77
|
/** Block the tool call; the model receives an error tool result instead. */
|
|
44
78
|
block?: boolean;
|
|
45
79
|
reason?: string;
|
|
46
80
|
}
|
|
81
|
+
export interface ContextHookEvent {
|
|
82
|
+
/** A call-local clone of the transcript about to be sent to the LLM. */
|
|
83
|
+
messages: AgentMessage[];
|
|
84
|
+
origin?: RunOrigin;
|
|
85
|
+
}
|
|
86
|
+
export interface ContextHookResult {
|
|
87
|
+
/** Replace the messages sent for this LLM call only. */
|
|
88
|
+
messages?: AgentMessage[];
|
|
89
|
+
}
|
|
47
90
|
export interface ToolResultHookEvent {
|
|
48
91
|
toolCallId: string;
|
|
49
92
|
toolName: string;
|
|
50
93
|
args: unknown;
|
|
51
94
|
content: (TextContent | ImageContent)[];
|
|
95
|
+
details: unknown;
|
|
52
96
|
isError: boolean;
|
|
97
|
+
/** Usage from the tool execution itself, if available. */
|
|
98
|
+
usage?: Usage;
|
|
99
|
+
origin?: RunOrigin;
|
|
100
|
+
}
|
|
101
|
+
export interface ToolResultHookResult {
|
|
102
|
+
/** Replace the tool result content sent back to the model (e.g. redaction). */
|
|
103
|
+
content?: (TextContent | ImageContent)[];
|
|
104
|
+
/** Replace the structured tool result details. */
|
|
105
|
+
details?: unknown;
|
|
106
|
+
/** Override the tool result error flag. */
|
|
107
|
+
isError?: boolean;
|
|
108
|
+
/** Replace usage reported by the tool execution. */
|
|
109
|
+
usage?: Usage;
|
|
53
110
|
}
|
|
54
111
|
export interface MessageEndHookEvent {
|
|
55
112
|
message: AgentMessage;
|
|
113
|
+
origin?: RunOrigin;
|
|
114
|
+
}
|
|
115
|
+
export interface MessageEndHookResult {
|
|
116
|
+
/** Replace the finalized message. The replacement must keep the original role. */
|
|
117
|
+
message?: AgentMessage;
|
|
56
118
|
}
|
|
57
119
|
export interface TurnEndHookEvent {
|
|
58
120
|
messages: AgentMessage[];
|
|
121
|
+
origin?: RunOrigin;
|
|
59
122
|
}
|
|
60
123
|
export interface SessionCompactHookEvent {
|
|
61
124
|
entry: CompactionEntry;
|
|
62
125
|
reason: "threshold" | "overflow" | "manual";
|
|
63
126
|
}
|
|
127
|
+
/** A turn settled with an error after retries were exhausted (or none applied). */
|
|
128
|
+
export interface AgentErrorHookEvent {
|
|
129
|
+
errorMessage: string;
|
|
130
|
+
origin?: RunOrigin;
|
|
131
|
+
}
|
|
132
|
+
/** The run budget circuit breaker tripped and the run was aborted. */
|
|
133
|
+
export interface BudgetExceededHookEvent {
|
|
134
|
+
/** Which cap was hit, e.g. "cost 2.01 USD >= 2 USD limit". */
|
|
135
|
+
reason: string;
|
|
136
|
+
tokens: number;
|
|
137
|
+
costUsd: number;
|
|
138
|
+
llmCalls: number;
|
|
139
|
+
durationMs: number;
|
|
140
|
+
origin?: RunOrigin;
|
|
141
|
+
}
|
|
64
142
|
/** Map of hook names to handler signatures. */
|
|
65
143
|
export interface MikanHookMap {
|
|
66
144
|
before_agent_start: (event: BeforeAgentStartHookEvent) => BeforeAgentStartHookResult | undefined | void | Promise<BeforeAgentStartHookResult | undefined | void>;
|
|
67
145
|
tool_call: (event: ToolCallHookEvent) => ToolCallHookResult | undefined | void | Promise<ToolCallHookResult | undefined | void>;
|
|
68
|
-
|
|
69
|
-
|
|
146
|
+
context: (event: ContextHookEvent) => ContextHookResult | undefined | void | Promise<ContextHookResult | undefined | void>;
|
|
147
|
+
tool_result: (event: ToolResultHookEvent) => ToolResultHookResult | undefined | void | Promise<ToolResultHookResult | undefined | void>;
|
|
148
|
+
message_end: (event: MessageEndHookEvent) => MessageEndHookResult | undefined | void | Promise<MessageEndHookResult | undefined | void>;
|
|
70
149
|
turn_end: (event: TurnEndHookEvent) => void | Promise<void>;
|
|
71
150
|
session_compact: (event: SessionCompactHookEvent) => void | Promise<void>;
|
|
151
|
+
agent_error: (event: AgentErrorHookEvent) => void | Promise<void>;
|
|
152
|
+
budget_exceeded: (event: BudgetExceededHookEvent) => void | Promise<void>;
|
|
72
153
|
}
|
|
73
154
|
export type MikanHookName = keyof MikanHookMap;
|
|
74
155
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
156
|
+
* What a schedule does when it fires — exactly one of:
|
|
157
|
+
*
|
|
158
|
+
* - `text`: an autonomous agent run in this conversation with `text` as the
|
|
159
|
+
* task prompt (the run does not inherit conversation history — write it
|
|
160
|
+
* self-contained).
|
|
161
|
+
* - `callback`: a deterministic host-side handler registered with
|
|
162
|
+
* `api.schedules.onCallback` — no agent run, no model call. `args` is
|
|
163
|
+
* stored with the schedule and passed to the handler on every fire.
|
|
78
164
|
*/
|
|
79
|
-
export type
|
|
165
|
+
export type ExtensionScheduleAction = {
|
|
166
|
+
text: string;
|
|
167
|
+
/** Target platform; defaults to this conversation's own. */
|
|
168
|
+
platform?: string;
|
|
169
|
+
callback?: never;
|
|
170
|
+
args?: never;
|
|
171
|
+
} | {
|
|
172
|
+
/** Name of a callback registered with `api.schedules.onCallback`. */
|
|
173
|
+
callback: string;
|
|
174
|
+
/** JSON-serializable payload passed to the callback on each fire. */
|
|
175
|
+
args?: unknown;
|
|
176
|
+
text?: never;
|
|
177
|
+
platform?: never;
|
|
178
|
+
};
|
|
179
|
+
/** A schedule contributed by an extension. */
|
|
180
|
+
export type ExtensionScheduleSpec = ({
|
|
80
181
|
type: "periodic";
|
|
81
182
|
/** Cron expression (croner syntax). */
|
|
82
183
|
schedule: string;
|
|
83
184
|
/** IANA timezone, e.g. "Asia/Taipei". */
|
|
84
185
|
timezone: string;
|
|
85
|
-
|
|
86
|
-
/** Target platform; optional when only one platform is running. */
|
|
87
|
-
platform?: string;
|
|
88
|
-
} | {
|
|
186
|
+
} & ExtensionScheduleAction) | ({
|
|
89
187
|
type: "one-shot";
|
|
90
188
|
/** ISO 8601 timestamp with offset. */
|
|
91
189
|
at: string;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
190
|
+
} & ExtensionScheduleAction);
|
|
191
|
+
/** The callback-actioned subset of {@link ExtensionScheduleSpec}. */
|
|
192
|
+
export type ExtensionCallbackScheduleSpec = Extract<ExtensionScheduleSpec, {
|
|
193
|
+
callback: string;
|
|
194
|
+
}>;
|
|
195
|
+
/** The agent-run (text) subset of {@link ExtensionScheduleSpec}. */
|
|
196
|
+
export type ExtensionTextScheduleSpec = Exclude<ExtensionScheduleSpec, {
|
|
197
|
+
callback: string;
|
|
198
|
+
}>;
|
|
95
199
|
export interface ExtensionScheduleInfo {
|
|
96
200
|
/** Extension-chosen schedule name. */
|
|
97
201
|
name: string;
|
|
98
202
|
spec: ExtensionScheduleSpec;
|
|
99
203
|
}
|
|
204
|
+
/** One fire of a callback-actioned schedule, as seen by the handler. */
|
|
205
|
+
export interface ExtensionScheduleCallbackEvent {
|
|
206
|
+
/** Name of the schedule that fired. */
|
|
207
|
+
scheduleName: string;
|
|
208
|
+
/** The `args` stored on the schedule spec, if any. */
|
|
209
|
+
args?: unknown;
|
|
210
|
+
}
|
|
211
|
+
export type ExtensionScheduleCallbackHandler = (event: ExtensionScheduleCallbackEvent) => void | Promise<void>;
|
|
100
212
|
/**
|
|
101
|
-
* Event-file payload the harness hands to the embedder's schedule store
|
|
102
|
-
*
|
|
103
|
-
* embedder runs a single platform.
|
|
213
|
+
* Event-file payload the harness hands to the embedder's schedule store —
|
|
214
|
+
* the canonical event-file shape owned by the event-format module.
|
|
215
|
+
* `platform` may be omitted when the embedder runs a single platform.
|
|
216
|
+
* `immediate` backs `api.triggerRun` — the event fires as soon as the
|
|
217
|
+
* embedder's watcher picks it up.
|
|
104
218
|
*/
|
|
105
|
-
export
|
|
106
|
-
|
|
219
|
+
export type ExtensionSchedulePayload = EventFilePayload;
|
|
220
|
+
/** Cleanup callback run when the harness instance owning the extension is discarded. */
|
|
221
|
+
export type ExtensionDisposer = () => void | Promise<void>;
|
|
222
|
+
/** Context handed to an extension command handler for one invocation. */
|
|
223
|
+
export interface ExtensionCommandContext {
|
|
224
|
+
/** Text after the command name, trimmed ("" when none). */
|
|
225
|
+
args: string;
|
|
107
226
|
conversationId: string;
|
|
227
|
+
userId?: string;
|
|
228
|
+
userName?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Platform thread the command was sent from, when threaded. Pass to
|
|
231
|
+
* `blockkit.post` so interactive messages land in the same thread.
|
|
232
|
+
*/
|
|
233
|
+
threadTs?: string;
|
|
234
|
+
/** Reply in the conversation the command was sent from. */
|
|
235
|
+
respond(text: string): Promise<void>;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* A chat command contributed by an extension (`/name args…`). Dispatched
|
|
239
|
+
* deterministically by the embedder — no model call, no agent-session entry
|
|
240
|
+
* (the triggering message still syncs to chat history).
|
|
241
|
+
* Built-in commands always win over extension commands of the same name.
|
|
242
|
+
*/
|
|
243
|
+
export interface ExtensionCommand {
|
|
244
|
+
/** Command name without the leading slash; `[a-z0-9_-]+`, case-insensitive match. */
|
|
245
|
+
name: string;
|
|
246
|
+
/** One-line description for inventory surfaces. */
|
|
247
|
+
description?: string;
|
|
248
|
+
handler: (context: ExtensionCommandContext) => void | Promise<void>;
|
|
249
|
+
}
|
|
250
|
+
/** One user interaction with an interactive element posted by this extension. */
|
|
251
|
+
export interface ExtensionBlockAction {
|
|
252
|
+
/** The extension's own action id (the routing namespace is stripped). */
|
|
253
|
+
actionId: string;
|
|
254
|
+
/** Button value or single-select selected value. */
|
|
255
|
+
value?: string;
|
|
256
|
+
/** Selected option values for multi-selects and checkboxes. */
|
|
257
|
+
selectedValues?: string[];
|
|
258
|
+
userId?: string;
|
|
259
|
+
userName?: string;
|
|
260
|
+
conversationId: string;
|
|
261
|
+
/** Platform message id of the interactive message; pass to `blockkit.update`. */
|
|
262
|
+
messageTs?: string;
|
|
263
|
+
threadTs?: string;
|
|
264
|
+
}
|
|
265
|
+
export type ExtensionBlockActionHandler = (action: ExtensionBlockAction) => void | Promise<void>;
|
|
266
|
+
/** Platform-native interactive message content (Slack Block Kit blocks). */
|
|
267
|
+
export interface ExtensionBlockKitMessage {
|
|
268
|
+
/** Plain-text fallback for notifications and screen readers. */
|
|
108
269
|
text: string;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
270
|
+
/** Block Kit blocks. `post` namespaces every action_id with the extension slug. */
|
|
271
|
+
blocks: object[];
|
|
272
|
+
/** Post into this platform thread; omit for a top-level message. */
|
|
273
|
+
threadTs?: string;
|
|
274
|
+
}
|
|
275
|
+
export interface SubagentApi {
|
|
276
|
+
/**
|
|
277
|
+
* Run one fresh subagent and return its result to the extension. The
|
|
278
|
+
* subagent has no conversation history, receives no tools by default, and
|
|
279
|
+
* cannot recursively start another subagent run. Never rejects: every
|
|
280
|
+
* failure, including request validation, resolves to a result with a
|
|
281
|
+
* terminal status.
|
|
282
|
+
*/
|
|
283
|
+
run<TOutputSchema extends TSchema | undefined = undefined>(request: SubagentRunRequest<TOutputSchema>): Promise<SubagentRunResult<SubagentRunOutput<TOutputSchema>>>;
|
|
113
284
|
}
|
|
114
285
|
/**
|
|
115
286
|
* Persistence backend for extension schedules, injected by the embedder
|
|
@@ -125,6 +296,38 @@ export interface ExtensionScheduleStore {
|
|
|
125
296
|
payload: ExtensionSchedulePayload;
|
|
126
297
|
}>>;
|
|
127
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Persistence + arming backend for callback-actioned schedules, injected by
|
|
301
|
+
* the embedder scoped to one conversation. Unlike {@link ExtensionScheduleStore}
|
|
302
|
+
* (the agent-writable workspace event bus), this store must be
|
|
303
|
+
* host-authoritative: a fired callback crosses into trusted host code, so
|
|
304
|
+
* sandboxed agents must never be able to create or edit its entries. mikan
|
|
305
|
+
* backs it with files under the host-only state dir.
|
|
306
|
+
*/
|
|
307
|
+
export interface ExtensionCallbackScheduleStore {
|
|
308
|
+
upsert(slug: string, name: string, spec: ExtensionCallbackScheduleSpec): Promise<void>;
|
|
309
|
+
delete(slug: string, name: string): Promise<boolean>;
|
|
310
|
+
list(slug: string): Promise<ExtensionScheduleInfo[]>;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Process-wide engine behind {@link ExtensionCallbackScheduleStore}: persists
|
|
314
|
+
* callback schedules per conversation, arms them across restarts, and
|
|
315
|
+
* dispatches fires into the owning conversation's extension registry.
|
|
316
|
+
*/
|
|
317
|
+
export interface ExtensionScheduleEngine {
|
|
318
|
+
upsert(address: OfficeAddress, slug: string, name: string, spec: ExtensionCallbackScheduleSpec): Promise<void>;
|
|
319
|
+
delete(address: OfficeAddress, slug: string, name: string): Promise<boolean>;
|
|
320
|
+
list(address: OfficeAddress, slug: string): Promise<ExtensionScheduleInfo[]>;
|
|
321
|
+
}
|
|
322
|
+
/** One fire dispatched by the engine to the conversation runtime. */
|
|
323
|
+
export interface ExtensionScheduleCallbackFire {
|
|
324
|
+
platform: string;
|
|
325
|
+
conversationId: string;
|
|
326
|
+
slug: string;
|
|
327
|
+
scheduleName: string;
|
|
328
|
+
callback: string;
|
|
329
|
+
args?: unknown;
|
|
330
|
+
}
|
|
128
331
|
/**
|
|
129
332
|
* Host services injected into extensions by the embedder. All fields are
|
|
130
333
|
* optional: the corresponding api surface throws an informative error when
|
|
@@ -135,21 +338,73 @@ export interface ExtensionHostServices {
|
|
|
135
338
|
stateDir?: string;
|
|
136
339
|
/** Schedule persistence; enables `api.schedules`. */
|
|
137
340
|
scheduleStore?: ExtensionScheduleStore;
|
|
138
|
-
/**
|
|
139
|
-
|
|
341
|
+
/**
|
|
342
|
+
* Post a message to a conversation without an agent run, resolving to the
|
|
343
|
+
* posted message's platform id; enables `api.notify`.
|
|
344
|
+
*/
|
|
345
|
+
postMessage?: (conversationId: string, text: string, options?: {
|
|
346
|
+
platform?: string;
|
|
347
|
+
threadTs?: string;
|
|
348
|
+
}) => Promise<string>;
|
|
349
|
+
/** Resolve a user's DM conversation id; enables `api.openDm`. */
|
|
350
|
+
openDirectConversation?: (userId: string, platform?: string) => Promise<string>;
|
|
351
|
+
/** Read recent conversation messages; enables `api.fetchHistory`. */
|
|
352
|
+
fetchHistory?: (conversationId: string, options?: PlatformHistoryOptions & {
|
|
353
|
+
platform?: string;
|
|
354
|
+
}) => Promise<PlatformHistoryMessage[]>;
|
|
355
|
+
/** List the platform workspace's active users; enables `api.listUsers`. */
|
|
356
|
+
listUsers?: (platform?: string) => Promise<PlatformUserInfo[]>;
|
|
357
|
+
/** Post an interactive Block Kit message; enables `api.blockkit.post`. */
|
|
358
|
+
postBlocks?: (conversationId: string, message: {
|
|
359
|
+
text: string;
|
|
360
|
+
blocks: object[];
|
|
361
|
+
threadTs?: string;
|
|
362
|
+
}, platform?: string) => Promise<{
|
|
363
|
+
ts: string;
|
|
364
|
+
}>;
|
|
365
|
+
/** Update an interactive Block Kit message; enables `api.blockkit.update`. */
|
|
366
|
+
updateBlocks?: (conversationId: string, messageTs: string, message: {
|
|
367
|
+
text: string;
|
|
368
|
+
blocks: object[];
|
|
369
|
+
}, platform?: string) => Promise<void>;
|
|
370
|
+
/** Add an emoji reaction to a message; enables `api.react`. */
|
|
371
|
+
addReaction?: (conversationId: string, messageTs: string, emoji: string, platform?: string) => Promise<void>;
|
|
372
|
+
/** Upload a host file into a conversation; enables `api.uploadFile`. */
|
|
373
|
+
uploadFile?: (conversationId: string, filePath: string, title?: string, platform?: string) => Promise<void>;
|
|
374
|
+
/** Callback-schedule persistence; enables `api.schedules` callback specs. */
|
|
375
|
+
callbackScheduleStore?: ExtensionCallbackScheduleStore;
|
|
140
376
|
/** Resolve read-only secrets for an extension slug; enables `api.secrets`. */
|
|
141
377
|
resolveSecrets?: (slug: string) => Record<string, string>;
|
|
378
|
+
/** Run a fresh isolated subagent; enables `api.subagent`. */
|
|
379
|
+
runSubagent?: <TOutputSchema extends TSchema | undefined = undefined>(request: SubagentRunRequest<TOutputSchema>, contributedTools: AgentTool[]) => Promise<SubagentRunResult<SubagentRunOutput<TOutputSchema>>>;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* One secret an extension declares in its `package.json` (`mikan.secrets`).
|
|
383
|
+
* Declarations drive provisioning surfaces (the admin portal, `mikan ext`)
|
|
384
|
+
* and activation-time validation: a missing `required` secret fails that
|
|
385
|
+
* extension's activation with a provisioning hint instead of a confusing
|
|
386
|
+
* runtime error.
|
|
387
|
+
*/
|
|
388
|
+
export interface ExtensionSecretDeclaration {
|
|
389
|
+
/** Env-style key, e.g. "SLACK_BOT_TOKEN". */
|
|
390
|
+
key: string;
|
|
391
|
+
/** One-line hint shown on provisioning surfaces. */
|
|
392
|
+
description?: string;
|
|
393
|
+
/** When true, activation fails while the secret is unprovisioned. */
|
|
394
|
+
required?: boolean;
|
|
142
395
|
}
|
|
143
396
|
/**
|
|
144
397
|
* Optional `manifest.json` next to a directory-form extension's entrypoint.
|
|
145
398
|
* `name` is the display name only; the slug (data dir, secrets, schedule
|
|
146
399
|
* ownership) always derives from the install path so identity is
|
|
147
|
-
* admin-controlled and stable across manifest edits.
|
|
400
|
+
* admin-controlled and stable across manifest edits. `secrets` comes from
|
|
401
|
+
* `package.json`'s `mikan.secrets` only.
|
|
148
402
|
*/
|
|
149
403
|
export interface ExtensionManifest {
|
|
150
404
|
name?: string;
|
|
151
405
|
version?: string;
|
|
152
406
|
description?: string;
|
|
407
|
+
secrets?: ExtensionSecretDeclaration[];
|
|
153
408
|
}
|
|
154
409
|
/** API handed to an extension's `activate` function. */
|
|
155
410
|
export interface MikanExtensionApi {
|
|
@@ -157,6 +412,17 @@ export interface MikanExtensionApi {
|
|
|
157
412
|
on<T extends MikanHookName>(hook: T, handler: MikanHookMap[T]): void;
|
|
158
413
|
/** Contribute an additional agent tool. */
|
|
159
414
|
registerTool(tool: AgentTool): void;
|
|
415
|
+
/**
|
|
416
|
+
* Contribute a chat command (`/name`). Dispatched without a model call;
|
|
417
|
+
* built-in commands and earlier registrations of the same name win.
|
|
418
|
+
*/
|
|
419
|
+
registerCommand(command: ExtensionCommand): void;
|
|
420
|
+
/**
|
|
421
|
+
* Register cleanup to run when this harness instance is discarded
|
|
422
|
+
* (`/pi-new`, session eviction, shutdown). Alternative to returning a
|
|
423
|
+
* disposer from `activate`. Disposers run in reverse registration order.
|
|
424
|
+
*/
|
|
425
|
+
onDispose(disposer: ExtensionDisposer): void;
|
|
160
426
|
/** Extension-scoped logging that lands in mikan's structured log. */
|
|
161
427
|
log(message: string): void;
|
|
162
428
|
/** Context about the conversation this harness instance serves. */
|
|
@@ -166,14 +432,28 @@ export interface MikanExtensionApi {
|
|
|
166
432
|
readonly model: Model<Api>;
|
|
167
433
|
readonly thinkingLevel: ThinkingLevel;
|
|
168
434
|
};
|
|
169
|
-
/**
|
|
435
|
+
/**
|
|
436
|
+
* Host-only filesystem locations owned by this extension (never mounted
|
|
437
|
+
* into sandbox containers). Which one you use is a declaration: `dataDir`
|
|
438
|
+
* for conversation-scoped state (the safe default — isolation for free),
|
|
439
|
+
* `sharedDataDir` for deliberately cross-conversation state (you own tenant
|
|
440
|
+
* partitioning and concurrency). See `LAYOUT.md`.
|
|
441
|
+
*/
|
|
170
442
|
readonly paths: {
|
|
171
443
|
/**
|
|
172
|
-
*
|
|
173
|
-
* (
|
|
174
|
-
*
|
|
444
|
+
* This conversation's private data directory
|
|
445
|
+
* (`conversations/<conversationId>/extension-data/<slug>`), created on
|
|
446
|
+
* first access. Default choice: co-located with the conversation, so it
|
|
447
|
+
* disappears when the conversation is deleted.
|
|
175
448
|
*/
|
|
176
449
|
readonly dataDir: string;
|
|
450
|
+
/**
|
|
451
|
+
* Data shared across all conversations this extension serves
|
|
452
|
+
* (`global/extension-data/<slug>`), created on first access. Explicit
|
|
453
|
+
* opt-in for multi-conversation applications (e.g. a PM tool with
|
|
454
|
+
* cross-channel views); key rows by conversation id yourself.
|
|
455
|
+
*/
|
|
456
|
+
readonly sharedDataDir: string;
|
|
177
457
|
};
|
|
178
458
|
/**
|
|
179
459
|
* Read-only secrets from the embedder's vault
|
|
@@ -185,9 +465,11 @@ export interface MikanExtensionApi {
|
|
|
185
465
|
list(): string[];
|
|
186
466
|
};
|
|
187
467
|
/**
|
|
188
|
-
* Named schedules owned by this extension + conversation
|
|
189
|
-
*
|
|
190
|
-
*
|
|
468
|
+
* Named schedules owned by this extension + conversation, persisted across
|
|
469
|
+
* restarts. `text` specs become event files that fire autonomous agent
|
|
470
|
+
* runs; `callback` specs fire a handler registered with `onCallback` —
|
|
471
|
+
* deterministic, no model call. One namespace: upserting a name switches
|
|
472
|
+
* its kind atomically.
|
|
191
473
|
*/
|
|
192
474
|
readonly schedules: {
|
|
193
475
|
/** Create or replace a named schedule. */
|
|
@@ -196,14 +478,100 @@ export interface MikanExtensionApi {
|
|
|
196
478
|
delete(name: string): Promise<boolean>;
|
|
197
479
|
/** Schedules owned by this extension in this conversation. */
|
|
198
480
|
list(): Promise<ExtensionScheduleInfo[]>;
|
|
481
|
+
/**
|
|
482
|
+
* Register the handler for callback-actioned schedules naming
|
|
483
|
+
* `callbackName`. Register during `activate` so the handler exists
|
|
484
|
+
* whenever a schedule fires (including right after a restart). Invalid
|
|
485
|
+
* names throw; a duplicate registration keeps the first.
|
|
486
|
+
*/
|
|
487
|
+
onCallback(callbackName: string, handler: ExtensionScheduleCallbackHandler): void;
|
|
488
|
+
};
|
|
489
|
+
/** Fresh isolated subagent runs. */
|
|
490
|
+
readonly subagent: SubagentApi;
|
|
491
|
+
/**
|
|
492
|
+
* Post text into a conversation without triggering an agent run. Defaults
|
|
493
|
+
* to this conversation; pass `conversationId` to post elsewhere (pairs
|
|
494
|
+
* with `sharedDataDir` for cross-conversation applications). The platform
|
|
495
|
+
* defaults to this conversation's own; pass `platform` only when targeting
|
|
496
|
+
* a conversation on a different one. `threadTs` posts into a platform
|
|
497
|
+
* thread where the adapter supports it. Available when the embedder
|
|
498
|
+
* provides platform messaging.
|
|
499
|
+
*
|
|
500
|
+
* Resolves to the posted message's platform id — pass it back as
|
|
501
|
+
* `fetchHistory({ threadTs })` to read replies to what you just posted, or
|
|
502
|
+
* to `react` to annotate it.
|
|
503
|
+
*/
|
|
504
|
+
notify(text: string, options?: {
|
|
505
|
+
conversationId?: string;
|
|
506
|
+
platform?: string;
|
|
507
|
+
threadTs?: string;
|
|
508
|
+
}): Promise<string>;
|
|
509
|
+
/**
|
|
510
|
+
* Resolve the direct-message conversation with a platform user, returning
|
|
511
|
+
* a conversation id usable with `notify`/`uploadFile`. Available when the
|
|
512
|
+
* embedder provides DM resolution and the platform supports it.
|
|
513
|
+
*/
|
|
514
|
+
openDm(userId: string): Promise<string>;
|
|
515
|
+
/**
|
|
516
|
+
* Read recent messages from a conversation, oldest first, without an agent
|
|
517
|
+
* run. Defaults to this conversation; adapters may cap `limit` and return
|
|
518
|
+
* a single page — page forward by passing the last returned `ts` as
|
|
519
|
+
* `oldest`. Pass `threadTs` to read the replies inside one thread instead
|
|
520
|
+
* of the conversation's top-level messages (the parent is not returned).
|
|
521
|
+
* Available when the embedder provides history reads.
|
|
522
|
+
*/
|
|
523
|
+
fetchHistory(options?: {
|
|
524
|
+
conversationId?: string;
|
|
525
|
+
oldest?: string;
|
|
526
|
+
limit?: number;
|
|
527
|
+
threadTs?: string;
|
|
528
|
+
}): Promise<PlatformHistoryMessage[]>;
|
|
529
|
+
/**
|
|
530
|
+
* List the platform workspace's active users without an agent run.
|
|
531
|
+
* Available when the embedder provides user listings.
|
|
532
|
+
*/
|
|
533
|
+
listUsers(): Promise<PlatformUserInfo[]>;
|
|
534
|
+
/**
|
|
535
|
+
* Interactive platform surfaces (Slack Block Kit). `post` namespaces every
|
|
536
|
+
* `action_id` in the blocks with this extension's slug; interactions on
|
|
537
|
+
* those elements are dispatched exclusively to `onAction` handlers — no
|
|
538
|
+
* agent run, no model call. The extension decides whether to involve the
|
|
539
|
+
* model afterwards (`triggerRun`). Available when the embedder provides
|
|
540
|
+
* Block Kit messaging.
|
|
541
|
+
*/
|
|
542
|
+
readonly blockkit: {
|
|
543
|
+
/** Post an interactive message into this conversation. Returns its message id. */
|
|
544
|
+
post(message: ExtensionBlockKitMessage): Promise<{
|
|
545
|
+
ts: string;
|
|
546
|
+
}>;
|
|
547
|
+
/** Replace an interactive message previously posted with `post`. */
|
|
548
|
+
update(messageTs: string, message: {
|
|
549
|
+
text: string;
|
|
550
|
+
blocks: object[];
|
|
551
|
+
}): Promise<void>;
|
|
552
|
+
/** Register a handler for interactions on this extension's elements. */
|
|
553
|
+
onAction(actionId: string, handler: ExtensionBlockActionHandler): void;
|
|
199
554
|
};
|
|
200
555
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
556
|
+
* Add an emoji reaction to a message in this conversation. `messageTs` is
|
|
557
|
+
* the platform message id the extension read from an event (see
|
|
558
|
+
* `RunOrigin.messageTs`); `emoji` is a short name without colons.
|
|
559
|
+
* Available when the embedder provides reaction support.
|
|
203
560
|
*/
|
|
204
|
-
|
|
561
|
+
react(messageTs: string, emoji: string): Promise<void>;
|
|
562
|
+
/**
|
|
563
|
+
* Upload a host-side file into this conversation without an agent run.
|
|
564
|
+
* Available when the embedder provides file uploads for the platform.
|
|
565
|
+
*/
|
|
566
|
+
uploadFile(filePath: string, title?: string): Promise<void>;
|
|
567
|
+
/**
|
|
568
|
+
* Fire an autonomous agent run in this conversation as soon as possible.
|
|
569
|
+
* Like a schedule, the run does not inherit conversation history — write
|
|
570
|
+
* `text` self-contained. Backed by the embedder's schedule store.
|
|
571
|
+
*/
|
|
572
|
+
triggerRun(text: string): Promise<void>;
|
|
205
573
|
}
|
|
206
|
-
export type MikanExtensionActivate = (api: MikanExtensionApi) => void | Promise<void>;
|
|
574
|
+
export type MikanExtensionActivate = (api: MikanExtensionApi) => void | ExtensionDisposer | Promise<void | ExtensionDisposer>;
|
|
207
575
|
export interface MikanExtensionModule {
|
|
208
576
|
name?: string;
|
|
209
577
|
activate: MikanExtensionActivate;
|
|
@@ -222,4 +590,76 @@ export interface ExtensionLoadError {
|
|
|
222
590
|
path: string;
|
|
223
591
|
error: string;
|
|
224
592
|
}
|
|
593
|
+
/** Discovery-only view of an installed extension (module is not imported). */
|
|
594
|
+
export interface InstalledExtensionInfo {
|
|
595
|
+
/** Display name: manifest name, falling back to the slug. */
|
|
596
|
+
name: string;
|
|
597
|
+
slug: string;
|
|
598
|
+
path: string;
|
|
599
|
+
/** Scan directory the extension was found in. */
|
|
600
|
+
dir: string;
|
|
601
|
+
version?: string;
|
|
602
|
+
description?: string;
|
|
603
|
+
/** Names of skills shipped in the extension's skills/ directory. */
|
|
604
|
+
skillNames: string[];
|
|
605
|
+
/** Secrets declared in package.json `mikan.secrets`. */
|
|
606
|
+
secrets: ExtensionSecretDeclaration[];
|
|
607
|
+
}
|
|
608
|
+
export interface LoadExtensionsOptions {
|
|
609
|
+
/**
|
|
610
|
+
* Directories to scan for extensions, in ascending precedence. Missing
|
|
611
|
+
* directories are skipped. When two directories contribute the same slug,
|
|
612
|
+
* the later one wins — that is how a conversation-scoped copy of a package
|
|
613
|
+
* shadows the global one instead of activating alongside it.
|
|
614
|
+
*/
|
|
615
|
+
dirs: string[];
|
|
616
|
+
/**
|
|
617
|
+
* Extension roots to load directly, without scanning for children. Each
|
|
618
|
+
* path is one extension (a directory with an entrypoint, or a bare file).
|
|
619
|
+
* Highest precedence, after every scanned directory. This is what
|
|
620
|
+
* `mikan ext dev` points at a working copy.
|
|
621
|
+
*/
|
|
622
|
+
roots?: string[];
|
|
623
|
+
context: {
|
|
624
|
+
/** Office identity; host-only state keys derive from it. */
|
|
625
|
+
address: OfficeAddress;
|
|
626
|
+
/** Raw platform id — what extension code sees and platform APIs accept. */
|
|
627
|
+
conversationId: string;
|
|
628
|
+
workspaceDir: string;
|
|
629
|
+
model: Model<Api>;
|
|
630
|
+
thinkingLevel: ThinkingLevel;
|
|
631
|
+
};
|
|
632
|
+
/** Embedder-provided services backing the v2 api surface. */
|
|
633
|
+
services?: ExtensionHostServices;
|
|
634
|
+
}
|
|
635
|
+
export interface LoadExtensionsResult {
|
|
636
|
+
registry: ExtensionRegistry;
|
|
637
|
+
extensions: LoadedExtension[];
|
|
638
|
+
errors: ExtensionLoadError[];
|
|
639
|
+
/** Skills contributed by extensions (inline: bodies ride in the prompt). */
|
|
640
|
+
skills: MikanSkill[];
|
|
641
|
+
/**
|
|
642
|
+
* Run extension disposers (from `api.onDispose` and `activate` return
|
|
643
|
+
* values). Call when the harness instance owning these extensions is
|
|
644
|
+
* discarded. Idempotent; disposer errors are logged, never thrown.
|
|
645
|
+
*/
|
|
646
|
+
dispose(): Promise<void>;
|
|
647
|
+
}
|
|
648
|
+
export interface ExtensionValidation {
|
|
649
|
+
ok: boolean;
|
|
650
|
+
/** Slug the extension would install as (from the source dir/file name). */
|
|
651
|
+
slug: string;
|
|
652
|
+
/** Display name (manifest name, else slug). */
|
|
653
|
+
name: string;
|
|
654
|
+
version?: string;
|
|
655
|
+
description?: string;
|
|
656
|
+
/** Resolved entrypoint that would be imported. */
|
|
657
|
+
entrypoint?: string;
|
|
658
|
+
/** Skill names shipped alongside the extension. */
|
|
659
|
+
skillNames: string[];
|
|
660
|
+
/** Secrets declared in package.json `mikan.secrets`. */
|
|
661
|
+
secrets: ExtensionSecretDeclaration[];
|
|
662
|
+
errors: string[];
|
|
663
|
+
warnings: string[];
|
|
664
|
+
}
|
|
225
665
|
//# sourceMappingURL=types.d.ts.map
|