botmux 3.11.0 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.runtime-build-id +1 -1
- package/dist/adapters/backend/riff-backend.d.ts +18 -0
- package/dist/adapters/backend/riff-backend.d.ts.map +1 -1
- package/dist/adapters/backend/riff-backend.js +154 -2
- package/dist/adapters/backend/riff-backend.js.map +1 -1
- package/dist/adapters/cli/coco.js +3 -3
- package/dist/adapters/cli/coco.js.map +1 -1
- package/dist/adapters/cli/codex.js +2 -2
- package/dist/adapters/cli/codex.js.map +1 -1
- package/dist/adapters/cli/kimi.d.ts.map +1 -1
- package/dist/adapters/cli/kimi.js +22 -8
- package/dist/adapters/cli/kimi.js.map +1 -1
- package/dist/adapters/cli/pi.d.ts.map +1 -1
- package/dist/adapters/cli/pi.js +3 -1
- package/dist/adapters/cli/pi.js.map +1 -1
- package/dist/bot-registry.d.ts.map +1 -1
- package/dist/bot-registry.js +4 -1
- package/dist/bot-registry.js.map +1 -1
- package/dist/cli/dashboard-command.d.ts +23 -0
- package/dist/cli/dashboard-command.d.ts.map +1 -0
- package/dist/cli/dashboard-command.js +61 -0
- package/dist/cli/dashboard-command.js.map +1 -0
- package/dist/cli/dashboard-endpoint.d.ts +3 -3
- package/dist/cli/dashboard-endpoint.d.ts.map +1 -1
- package/dist/cli/dashboard-endpoint.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +101 -49
- package/dist/cli.js.map +1 -1
- package/dist/codex-rpc-engine.d.ts +33 -3
- package/dist/codex-rpc-engine.d.ts.map +1 -1
- package/dist/codex-rpc-engine.js +182 -20
- package/dist/codex-rpc-engine.js.map +1 -1
- package/dist/codex-rpc-lifecycle.d.ts +42 -7
- package/dist/codex-rpc-lifecycle.d.ts.map +1 -1
- package/dist/codex-rpc-lifecycle.js +73 -7
- package/dist/codex-rpc-lifecycle.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/core/command-handler.d.ts +3 -2
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +19 -4
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
- package/dist/core/dashboard-ipc-server.js +16 -11
- package/dist/core/dashboard-ipc-server.js.map +1 -1
- package/dist/core/dashboard-rows.d.ts +17 -1
- package/dist/core/dashboard-rows.d.ts.map +1 -1
- package/dist/core/dashboard-rows.js +13 -1
- package/dist/core/dashboard-rows.js.map +1 -1
- package/dist/core/dispatch.d.ts +9 -10
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +17 -10
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/maintenance.d.ts.map +1 -1
- package/dist/core/maintenance.js +5 -0
- package/dist/core/maintenance.js.map +1 -1
- package/dist/core/role-resolver.d.ts +5 -2
- package/dist/core/role-resolver.d.ts.map +1 -1
- package/dist/core/role-resolver.js +55 -23
- package/dist/core/role-resolver.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +20 -18
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/skills/cli-admin-command.d.ts.map +1 -1
- package/dist/core/skills/cli-admin-command.js +142 -3
- package/dist/core/skills/cli-admin-command.js.map +1 -1
- package/dist/core/skills/frontmatter.d.ts.map +1 -1
- package/dist/core/skills/frontmatter.js +44 -7
- package/dist/core/skills/frontmatter.js.map +1 -1
- package/dist/core/skills/im-command.d.ts +6 -0
- package/dist/core/skills/im-command.d.ts.map +1 -1
- package/dist/core/skills/im-command.js +34 -7
- package/dist/core/skills/im-command.js.map +1 -1
- package/dist/core/skills/install-command.d.ts +4 -0
- package/dist/core/skills/install-command.d.ts.map +1 -0
- package/dist/core/skills/install-command.js +89 -0
- package/dist/core/skills/install-command.js.map +1 -0
- package/dist/core/skills/package.d.ts.map +1 -1
- package/dist/core/skills/package.js +10 -3
- package/dist/core/skills/package.js.map +1 -1
- package/dist/core/skills/policy.d.ts +5 -1
- package/dist/core/skills/policy.d.ts.map +1 -1
- package/dist/core/skills/policy.js +66 -3
- package/dist/core/skills/policy.js.map +1 -1
- package/dist/core/skills/references.d.ts +9 -1
- package/dist/core/skills/references.d.ts.map +1 -1
- package/dist/core/skills/references.js +35 -2
- package/dist/core/skills/references.js.map +1 -1
- package/dist/core/skills/registry-paths.d.ts +1 -0
- package/dist/core/skills/registry-paths.d.ts.map +1 -1
- package/dist/core/skills/registry-paths.js +3 -0
- package/dist/core/skills/registry-paths.js.map +1 -1
- package/dist/core/skills/session-resolver.d.ts +2 -1
- package/dist/core/skills/session-resolver.d.ts.map +1 -1
- package/dist/core/skills/session-resolver.js +1 -0
- package/dist/core/skills/session-resolver.js.map +1 -1
- package/dist/core/skills/session-runtime.d.ts.map +1 -1
- package/dist/core/skills/session-runtime.js +2 -0
- package/dist/core/skills/session-runtime.js.map +1 -1
- package/dist/core/skills/sources.d.ts +23 -0
- package/dist/core/skills/sources.d.ts.map +1 -1
- package/dist/core/skills/sources.js +128 -12
- package/dist/core/skills/sources.js.map +1 -1
- package/dist/core/skills/types.d.ts +22 -1
- package/dist/core/skills/types.d.ts.map +1 -1
- package/dist/core/terminal-write-auth.d.ts +4 -4
- package/dist/core/terminal-write-auth.d.ts.map +1 -1
- package/dist/core/terminal-write-auth.js +18 -6
- package/dist/core/terminal-write-auth.js.map +1 -1
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +52 -1
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/daemon.d.ts +1 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +101 -12
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/auth.d.ts +21 -11
- package/dist/dashboard/auth.d.ts.map +1 -1
- package/dist/dashboard/auth.js +39 -25
- package/dist/dashboard/auth.js.map +1 -1
- package/dist/dashboard/bot-onboarding.d.ts.map +1 -1
- package/dist/dashboard/bot-onboarding.js +2 -114
- package/dist/dashboard/bot-onboarding.js.map +1 -1
- package/dist/dashboard/bot-payload.d.ts +0 -1
- package/dist/dashboard/bot-payload.d.ts.map +1 -1
- package/dist/dashboard/bot-payload.js +0 -1
- package/dist/dashboard/bot-payload.js.map +1 -1
- package/dist/dashboard/connector-api.d.ts.map +1 -1
- package/dist/dashboard/connector-api.js +66 -6
- package/dist/dashboard/connector-api.js.map +1 -1
- package/dist/dashboard/dashboard-summary-endpoint.d.ts +39 -0
- package/dist/dashboard/dashboard-summary-endpoint.d.ts.map +1 -0
- package/dist/dashboard/dashboard-summary-endpoint.js +50 -0
- package/dist/dashboard/dashboard-summary-endpoint.js.map +1 -0
- package/dist/dashboard/dashboard-summary.d.ts +62 -0
- package/dist/dashboard/dashboard-summary.d.ts.map +1 -0
- package/dist/dashboard/dashboard-summary.js +106 -0
- package/dist/dashboard/dashboard-summary.js.map +1 -0
- package/dist/dashboard/public-redact.d.ts.map +1 -1
- package/dist/dashboard/public-redact.js +3 -0
- package/dist/dashboard/public-redact.js.map +1 -1
- package/dist/dashboard/skill-install-request.js +10 -11
- package/dist/dashboard/skill-install-request.js.map +1 -1
- package/dist/dashboard/skill-pack-response.d.ts +15 -0
- package/dist/dashboard/skill-pack-response.d.ts.map +1 -0
- package/dist/dashboard/skill-pack-response.js +32 -0
- package/dist/dashboard/skill-pack-response.js.map +1 -0
- package/dist/dashboard/web/connectors-page.d.ts +69 -0
- package/dist/dashboard/web/connectors-page.d.ts.map +1 -1
- package/dist/dashboard/web/connectors-page.js +47 -7
- package/dist/dashboard/web/connectors-page.js.map +1 -1
- package/dist/dashboard/web/feed-group-picker.d.ts +13 -0
- package/dist/dashboard/web/feed-group-picker.d.ts.map +1 -0
- package/dist/dashboard/web/feed-group-picker.js +45 -0
- package/dist/dashboard/web/feed-group-picker.js.map +1 -0
- package/dist/dashboard/web/groups-page.d.ts.map +1 -1
- package/dist/dashboard/web/groups-page.js +2 -5
- package/dist/dashboard/web/groups-page.js.map +1 -1
- package/dist/dashboard/web/i18n.d.ts.map +1 -1
- package/dist/dashboard/web/i18n.js +309 -40
- package/dist/dashboard/web/i18n.js.map +1 -1
- package/dist/dashboard/web/preferences.d.ts +4 -2
- package/dist/dashboard/web/preferences.d.ts.map +1 -1
- package/dist/dashboard/web/preferences.js +14 -6
- package/dist/dashboard/web/preferences.js.map +1 -1
- package/dist/dashboard/web/roles-page.d.ts.map +1 -1
- package/dist/dashboard/web/roles-page.js +36 -4
- package/dist/dashboard/web/roles-page.js.map +1 -1
- package/dist/dashboard/web/roles.d.ts +3 -1
- package/dist/dashboard/web/roles.d.ts.map +1 -1
- package/dist/dashboard/web/roles.js +10 -2
- package/dist/dashboard/web/roles.js.map +1 -1
- package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
- package/dist/dashboard/web/schedules-page.js +8 -2
- package/dist/dashboard/web/schedules-page.js.map +1 -1
- package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
- package/dist/dashboard/web/sessions-page.js +101 -5
- package/dist/dashboard/web/sessions-page.js.map +1 -1
- package/dist/dashboard/web/sessions.d.ts +3 -1
- package/dist/dashboard/web/sessions.d.ts.map +1 -1
- package/dist/dashboard/web/sessions.js +13 -6
- package/dist/dashboard/web/sessions.js.map +1 -1
- package/dist/dashboard/web/skills/bot-assignments-tab.d.ts +27 -0
- package/dist/dashboard/web/skills/bot-assignments-tab.d.ts.map +1 -0
- package/dist/dashboard/web/skills/bot-assignments-tab.js +257 -0
- package/dist/dashboard/web/skills/bot-assignments-tab.js.map +1 -0
- package/dist/dashboard/web/skills/delivery-settings-tab.d.ts +25 -0
- package/dist/dashboard/web/skills/delivery-settings-tab.d.ts.map +1 -0
- package/dist/dashboard/web/skills/delivery-settings-tab.js +20 -0
- package/dist/dashboard/web/skills/delivery-settings-tab.js.map +1 -0
- package/dist/dashboard/web/skills/shared.d.ts +86 -0
- package/dist/dashboard/web/skills/shared.d.ts.map +1 -0
- package/dist/dashboard/web/skills/shared.js +178 -0
- package/dist/dashboard/web/skills/shared.js.map +1 -0
- package/dist/dashboard/web/skills/skill-library-tab.d.ts +75 -0
- package/dist/dashboard/web/skills/skill-library-tab.d.ts.map +1 -0
- package/dist/dashboard/web/skills/skill-library-tab.js +108 -0
- package/dist/dashboard/web/skills/skill-library-tab.js.map +1 -0
- package/dist/dashboard/web/skills/skill-packs-tab.d.ts +21 -0
- package/dist/dashboard/web/skills/skill-packs-tab.d.ts.map +1 -0
- package/dist/dashboard/web/skills/skill-packs-tab.js +185 -0
- package/dist/dashboard/web/skills/skill-packs-tab.js.map +1 -0
- package/dist/dashboard/web/skills/types.d.ts +95 -0
- package/dist/dashboard/web/skills/types.d.ts.map +1 -0
- package/dist/dashboard/web/skills/types.js +2 -0
- package/dist/dashboard/web/skills/types.js.map +1 -0
- package/dist/dashboard/web/skills/use-skills-data.d.ts +31 -0
- package/dist/dashboard/web/skills/use-skills-data.d.ts.map +1 -0
- package/dist/dashboard/web/skills/use-skills-data.js +86 -0
- package/dist/dashboard/web/skills/use-skills-data.js.map +1 -0
- package/dist/dashboard/web/skills-page.d.ts +34 -31
- package/dist/dashboard/web/skills-page.d.ts.map +1 -1
- package/dist/dashboard/web/skills-page.js +321 -176
- package/dist/dashboard/web/skills-page.js.map +1 -1
- package/dist/dashboard/webhook-routes.d.ts +18 -0
- package/dist/dashboard/webhook-routes.d.ts.map +1 -1
- package/dist/dashboard/webhook-routes.js +35 -1
- package/dist/dashboard/webhook-routes.js.map +1 -1
- package/dist/dashboard-web/app.js +1 -1
- package/dist/dashboard-web/chunks/{bot-defaults-page-GED4FEMS.js → bot-defaults-page-HL655CNR.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-HK7NIBJG.js → chunk-5PAYQ3KT.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-KRHWZEXU.js → chunk-5ZL7NLR5.js} +1 -1
- package/dist/dashboard-web/chunks/chunk-6ALR252E.js +1 -0
- package/dist/dashboard-web/chunks/{chunk-VBXJOJFH.js → chunk-BFUTTYVK.js} +1 -1
- package/dist/dashboard-web/chunks/chunk-ELL53D62.js +55 -0
- package/dist/dashboard-web/chunks/connectors-page-3QQACF23.js +1 -0
- package/dist/dashboard-web/chunks/groups-page-SDZMJ7UV.js +8 -0
- package/dist/dashboard-web/chunks/{insights-page-54UBPPOC.js → insights-page-ZZ3JEJ6L.js} +1 -1
- package/dist/dashboard-web/chunks/{monitor-room-PORHVKRH.js → monitor-room-ROJ5GZ4N.js} +1 -1
- package/dist/dashboard-web/chunks/{monitoring-page-XGA7AXNL.js → monitoring-page-IATV7KJF.js} +1 -1
- package/dist/dashboard-web/chunks/{office-page-AO3AFG45.js → office-page-TYO5OIIT.js} +1 -1
- package/dist/dashboard-web/chunks/{overview-page-F5BUTYR6.js → overview-page-VJUULZF2.js} +1 -1
- package/dist/dashboard-web/chunks/roles-page-7RJJKZGK.js +1 -0
- package/dist/dashboard-web/chunks/schedules-page-JTEJ5IXW.js +1 -0
- package/dist/dashboard-web/chunks/sessions-page-KD7HDT3U.js +8 -0
- package/dist/dashboard-web/chunks/{settings-page-OJAZLZQT.js → settings-page-7CTTFBRS.js} +1 -1
- package/dist/dashboard-web/chunks/skills-page-57NZECJ3.js +4 -0
- package/dist/dashboard-web/chunks/{team-federation-page-ZJVAP7HW.js → team-federation-page-6YYIMJG3.js} +1 -1
- package/dist/dashboard-web/chunks/{v3-page-GYWTRGO2.js → v3-page-ZGKBSBK3.js} +1 -1
- package/dist/dashboard-web/chunks/{whiteboards-page-MSDAG6P7.js → whiteboards-page-AACJF6DB.js} +1 -1
- package/dist/dashboard-web/style.css +1952 -377
- package/dist/dashboard.js +316 -47
- package/dist/dashboard.js.map +1 -1
- package/dist/desktop/main/ipc.js +1 -1
- package/dist/desktop/main/runtime-service.js +2 -2
- package/dist/desktop/main/runtime-service.js.map +1 -1
- package/dist/desktop/shared/types.d.ts +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +5 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +5 -1
- package/dist/i18n/zh.js.map +1 -1
- package/dist/index-daemon.js +6 -1
- package/dist/index-daemon.js.map +1 -1
- package/dist/services/adopt-input-sequence.d.ts +52 -0
- package/dist/services/adopt-input-sequence.d.ts.map +1 -0
- package/dist/services/adopt-input-sequence.js +50 -0
- package/dist/services/adopt-input-sequence.js.map +1 -0
- package/dist/services/bridge-fallback-gate.d.ts.map +1 -1
- package/dist/services/bridge-fallback-gate.js +34 -11
- package/dist/services/bridge-fallback-gate.js.map +1 -1
- package/dist/services/codex-bridge-queue.d.ts +103 -7
- package/dist/services/codex-bridge-queue.d.ts.map +1 -1
- package/dist/services/codex-bridge-queue.js +291 -17
- package/dist/services/codex-bridge-queue.js.map +1 -1
- package/dist/services/codex-transcript.d.ts +4 -3
- package/dist/services/codex-transcript.d.ts.map +1 -1
- package/dist/services/codex-transcript.js.map +1 -1
- package/dist/services/connector-store.d.ts +14 -1
- package/dist/services/connector-store.d.ts.map +1 -1
- package/dist/services/connector-store.js.map +1 -1
- package/dist/services/connector-topic-template.d.ts +7 -0
- package/dist/services/connector-topic-template.d.ts.map +1 -0
- package/dist/services/connector-topic-template.js +210 -0
- package/dist/services/connector-topic-template.js.map +1 -0
- package/dist/services/project-scanner.d.ts +33 -0
- package/dist/services/project-scanner.d.ts.map +1 -1
- package/dist/services/project-scanner.js +40 -1
- package/dist/services/project-scanner.js.map +1 -1
- package/dist/services/skill-pack-store.d.ts +50 -0
- package/dist/services/skill-pack-store.d.ts.map +1 -0
- package/dist/services/skill-pack-store.js +270 -0
- package/dist/services/skill-pack-store.js.map +1 -0
- package/dist/services/skill-registry-store.d.ts +8 -0
- package/dist/services/skill-registry-store.d.ts.map +1 -1
- package/dist/services/skill-registry-store.js +100 -68
- package/dist/services/skill-registry-store.js.map +1 -1
- package/dist/services/structured-bridge-clis.d.ts +8 -1
- package/dist/services/structured-bridge-clis.d.ts.map +1 -1
- package/dist/services/structured-bridge-clis.js +13 -0
- package/dist/services/structured-bridge-clis.js.map +1 -1
- package/dist/services/submit-confirmation.d.ts +50 -0
- package/dist/services/submit-confirmation.d.ts.map +1 -1
- package/dist/services/submit-confirmation.js +82 -0
- package/dist/services/submit-confirmation.js.map +1 -1
- package/dist/services/todo-state.d.ts +74 -0
- package/dist/services/todo-state.d.ts.map +1 -0
- package/dist/services/todo-state.js +351 -0
- package/dist/services/todo-state.js.map +1 -0
- package/dist/setup/agent-preset.d.ts.map +1 -1
- package/dist/setup/agent-preset.js +2 -0
- package/dist/setup/agent-preset.js.map +1 -1
- package/dist/setup/owner-identity.d.ts +47 -0
- package/dist/setup/owner-identity.d.ts.map +1 -0
- package/dist/setup/owner-identity.js +196 -0
- package/dist/setup/owner-identity.js.map +1 -0
- package/dist/setup/register-app.d.ts +4 -3
- package/dist/setup/register-app.d.ts.map +1 -1
- package/dist/setup/register-app.js.map +1 -1
- package/dist/setup/setup-args.d.ts +1 -1
- package/dist/setup/setup-args.d.ts.map +1 -1
- package/dist/setup/setup-args.js +7 -3
- package/dist/setup/setup-args.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/async-serial-queue.d.ts +9 -0
- package/dist/utils/async-serial-queue.d.ts.map +1 -0
- package/dist/utils/async-serial-queue.js +13 -0
- package/dist/utils/async-serial-queue.js.map +1 -0
- package/dist/utils/child-env.d.ts +25 -0
- package/dist/utils/child-env.d.ts.map +1 -1
- package/dist/utils/child-env.js +47 -0
- package/dist/utils/child-env.js.map +1 -1
- package/dist/utils/runtime-screen-status.d.ts +52 -0
- package/dist/utils/runtime-screen-status.d.ts.map +1 -0
- package/dist/utils/runtime-screen-status.js +60 -0
- package/dist/utils/runtime-screen-status.js.map +1 -0
- package/dist/worker.js +1697 -468
- package/dist/worker.js.map +1 -1
- package/dist/workflows/definition.d.ts +44 -44
- package/package.json +1 -1
- package/dist/dashboard-web/chunks/chunk-6J5LS5AU.js +0 -51
- package/dist/dashboard-web/chunks/connectors-page-EELM66G3.js +0 -1
- package/dist/dashboard-web/chunks/groups-page-WKUV6E42.js +0 -8
- package/dist/dashboard-web/chunks/roles-page-M5GIASJU.js +0 -1
- package/dist/dashboard-web/chunks/schedules-page-O232WQRR.js +0 -1
- package/dist/dashboard-web/chunks/sessions-page-YFRPSTIL.js +0 -6
- package/dist/dashboard-web/chunks/skills-page-EFZQPWV4.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../../src/core/skills/package.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAGjG;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,YAAY,
|
|
1
|
+
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../../src/core/skills/package.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAGjG;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,YAAY,CAyBd"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
2
|
-
import { basename, join } from 'node:path';
|
|
1
|
+
import { existsSync, readFileSync, realpathSync, statSync } from 'node:fs';
|
|
2
|
+
import { basename, isAbsolute, join, relative, sep } from 'node:path';
|
|
3
3
|
import { readSkillFrontmatter } from './frontmatter.js';
|
|
4
4
|
const NAME_RE = /^[a-zA-Z0-9][a-zA-Z0-9:_-]{0,127}$/;
|
|
5
5
|
export function isValidSkillName(name) {
|
|
@@ -15,7 +15,14 @@ export function loadSkillPackage(dir, opts) {
|
|
|
15
15
|
if (!valid.ok)
|
|
16
16
|
throw new Error(valid.reason);
|
|
17
17
|
const rootDir = realpathSync(dir);
|
|
18
|
-
const
|
|
18
|
+
const entrypoint = realpathSync(join(rootDir, 'SKILL.md'));
|
|
19
|
+
const entrypointRelative = relative(rootDir, entrypoint);
|
|
20
|
+
if (entrypointRelative === '..' || entrypointRelative.startsWith(`..${sep}`) || isAbsolute(entrypointRelative)) {
|
|
21
|
+
throw new Error('skill_entrypoint_outside_root');
|
|
22
|
+
}
|
|
23
|
+
if (!statSync(entrypoint).isFile())
|
|
24
|
+
throw new Error('skill_entrypoint_not_file');
|
|
25
|
+
const text = readFileSync(entrypoint, 'utf-8');
|
|
19
26
|
const fm = readSkillFrontmatter(text);
|
|
20
27
|
const name = fm.name?.trim() || basename(rootDir);
|
|
21
28
|
if (!isValidSkillName(name))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../../src/core/skills/package.ts"],"names":[],"mappings":"AAAA,OAAO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CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC/G,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACjF,MAAM,IAAI,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/C,MAAM,EAAE,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;IAC3E,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI;QACnB,IAAI;QACJ,WAAW,EAAE,EAAE,CAAC,WAAW;QAC3B,WAAW,EAAE,EAAE,CAAC,WAAW;QAC3B,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE;QACnB,OAAO;QACP,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BotSkillPolicy, ResolvedSkill, SkillDiagnostic, SkillPackage } from './types.js';
|
|
1
|
+
import type { BotSkillPolicy, ResolvedSkill, SkillDiagnostic, SkillPackage, SkillPack } from './types.js';
|
|
2
2
|
export interface SkillPolicyInput {
|
|
3
3
|
registrySkills: SkillPackage[];
|
|
4
4
|
projectSkills: SkillPackage[];
|
|
@@ -7,6 +7,10 @@ export interface SkillPolicyInput {
|
|
|
7
7
|
globalDelivery?: 'auto' | 'prompt' | 'native';
|
|
8
8
|
botPolicy: BotSkillPolicy | undefined;
|
|
9
9
|
workingDir: string;
|
|
10
|
+
/** Skill pack registry used to expand `pack:<id>` selectors. When absent,
|
|
11
|
+
* `pack:*` selectors resolve to nothing and emit a `pack_not_found`
|
|
12
|
+
* diagnostic, so callers that don't know about packs still behave safely. */
|
|
13
|
+
packs?: Record<string, SkillPack>;
|
|
10
14
|
}
|
|
11
15
|
export interface SkillPolicyResult {
|
|
12
16
|
enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../src/core/skills/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../src/core/skills/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,SAAS,EAEV,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,mBAAmB,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC9C,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB;;kFAE8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvC,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAmBD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CA4H7E"}
|
|
@@ -11,6 +11,9 @@ function appendMatches(out, skills, selector, reason) {
|
|
|
11
11
|
out.push({ ...skill, priorityReason: reason });
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
function skillNameFromSelector(selector) {
|
|
15
|
+
return selector.slice('skill:'.length);
|
|
16
|
+
}
|
|
14
17
|
export function resolveSkillPolicy(input) {
|
|
15
18
|
const policy = input.botPolicy;
|
|
16
19
|
const pluginSkills = input.pluginSkills ?? [];
|
|
@@ -31,10 +34,70 @@ export function resolveSkillPolicy(input) {
|
|
|
31
34
|
else if (projectMode === 'all') {
|
|
32
35
|
candidates.push(...input.projectSkills);
|
|
33
36
|
}
|
|
37
|
+
// Keep the same source precedence as direct selectors: registry candidates
|
|
38
|
+
// are appended before project candidates, so the first package with a name
|
|
39
|
+
// must win for both `skill:*` and pack-expanded references.
|
|
40
|
+
const candidateByName = new Map();
|
|
41
|
+
for (const skill of candidates) {
|
|
42
|
+
if (!candidateByName.has(skill.name))
|
|
43
|
+
candidateByName.set(skill.name, skill);
|
|
44
|
+
}
|
|
34
45
|
const raw = [];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
// Partition the include array so direct `skill:*` references are ALWAYS
|
|
47
|
+
// expanded before `pack:*` references, regardless of the order the user wrote
|
|
48
|
+
// them in. This guarantees "direct always wins": a skill explicitly attached
|
|
49
|
+
// to a bot shadows the same skill pulled in via a pack, even if the pack
|
|
50
|
+
// selector appears first in the array. Within each partition the original
|
|
51
|
+
// policy order is preserved for stable, predictable resolution.
|
|
52
|
+
const include = policy?.include ?? [];
|
|
53
|
+
const directSelectors = include.filter((s) => s.startsWith('skill:'));
|
|
54
|
+
const packSelectors = include.filter((s) => s.startsWith('pack:'));
|
|
55
|
+
for (const selector of directSelectors) {
|
|
56
|
+
appendMatches(raw, candidates, selector, 'bot:include');
|
|
57
|
+
}
|
|
58
|
+
for (const selector of packSelectors) {
|
|
59
|
+
const packId = selector.slice('pack:'.length);
|
|
60
|
+
const pack = input.packs && Object.hasOwn(input.packs, packId)
|
|
61
|
+
? input.packs[packId]
|
|
62
|
+
: undefined;
|
|
63
|
+
if (!pack) {
|
|
64
|
+
diagnostics.push({
|
|
65
|
+
level: 'warn',
|
|
66
|
+
code: 'pack_not_found',
|
|
67
|
+
message: `Skill pack not found: ${packId}`,
|
|
68
|
+
});
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (!Array.isArray(pack.include)) {
|
|
72
|
+
diagnostics.push({
|
|
73
|
+
level: 'warn',
|
|
74
|
+
code: 'pack_invalid',
|
|
75
|
+
message: `Skill pack "${packId}" has no valid include list`,
|
|
76
|
+
});
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
for (const member of pack.include) {
|
|
80
|
+
if (typeof member !== 'string' || !/^skill:.+$/.test(member)) {
|
|
81
|
+
diagnostics.push({
|
|
82
|
+
level: 'warn',
|
|
83
|
+
code: 'pack_invalid',
|
|
84
|
+
message: `Skill pack "${packId}" contains a non-skill selector: ${String(member)}`,
|
|
85
|
+
});
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const skillName = skillNameFromSelector(member);
|
|
89
|
+
const skill = candidateByName.get(skillName);
|
|
90
|
+
if (!skill) {
|
|
91
|
+
diagnostics.push({
|
|
92
|
+
level: 'warn',
|
|
93
|
+
code: 'pack_skill_missing',
|
|
94
|
+
message: `Skill pack "${packId}" references missing skill: ${skillName}`,
|
|
95
|
+
skillName,
|
|
96
|
+
});
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
raw.push({ ...skill, priorityReason: `bot:pack:${packId}` });
|
|
100
|
+
}
|
|
38
101
|
}
|
|
39
102
|
for (const skill of pluginSkills) {
|
|
40
103
|
const reason = skill.source.type === 'plugin' ? `plugin:${skill.source.pluginId}` : 'plugin';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../src/core/skills/policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../src/core/skills/policy.ts"],"names":[],"mappings":"AA+BA,SAAS,eAAe,CAAC,KAAmB,EAAE,QAAuB;IACnE,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC;IAClD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAC,GAAoB,EAAE,MAAsB,EAAE,QAAuB,EAAE,MAAc;IAC1G,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;IACvF,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAuB;IACpD,OAAO,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC/B,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC;IAC9C,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,OAAO,EAAE,KAAK,EA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B;gBAChC,OAAO,EAAE,6BAA6B,KAAK,CAAC,IAAI,EAAE;gBAClD,SAAS,EAAE,KAAK,CAAC,IAAI;aACtB,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,WAAW,CAAC,IAAI,CAAC;YACf,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,oCAAoC;SAC9C,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,KAAK,CAAC,cAAc,IAAI,MAAM;QACxC,cAAc;QACd,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BotSkillPolicy } from './types.js';
|
|
1
|
+
import type { BotSkillPolicy, SkillPack } from './types.js';
|
|
2
2
|
export interface SkillReferenceBotInput {
|
|
3
3
|
larkAppId: string;
|
|
4
4
|
name?: string;
|
|
@@ -12,10 +12,18 @@ export interface SkillReferenceBot {
|
|
|
12
12
|
}
|
|
13
13
|
export interface SkillReferenceSummary {
|
|
14
14
|
bots: SkillReferenceBot[];
|
|
15
|
+
/** Packs that contain the skill (directly). Empty when no pack registry is
|
|
16
|
+
* supplied to the analyzer. */
|
|
17
|
+
packs: string[];
|
|
15
18
|
}
|
|
16
19
|
export declare function directSkillNames(policy: BotSkillPolicy | null | undefined): string[];
|
|
20
|
+
/** Returns the `pack:<id>` ids referenced by a bot policy, in policy order. */
|
|
21
|
+
export declare function packIdsInPolicy(policy: BotSkillPolicy | null | undefined): string[];
|
|
17
22
|
export declare function policyIncludesDirectSkill(policy: BotSkillPolicy | null | undefined, skillName: string): boolean;
|
|
23
|
+
/** Returns the ids of packs that directly contain the given skill. */
|
|
24
|
+
export declare function packsContainingSkill(skillName: string, packs: Record<string, SkillPack> | undefined): string[];
|
|
18
25
|
export declare function analyzeSkillReferences(skillName: string, opts: {
|
|
19
26
|
bots: SkillReferenceBotInput[];
|
|
27
|
+
packs?: Record<string, SkillPack>;
|
|
20
28
|
}): SkillReferenceSummary;
|
|
21
29
|
//# sourceMappingURL=references.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../src/core/skills/references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../src/core/skills/references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AAE3E,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B;oCACgC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAMD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAIpF;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAInF;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACzC,SAAS,EAAE,MAAM,GAChB,OAAO,CAET;AAkBD,sEAAsE;AACtE,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,GAC3C,MAAM,EAAE,CAOV;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IACJ,IAAI,EAAE,sBAAsB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC,GACA,qBAAqB,CAiBvB"}
|
|
@@ -6,14 +6,44 @@ export function directSkillNames(policy) {
|
|
|
6
6
|
.filter((item) => item.startsWith('skill:'))
|
|
7
7
|
.map((item) => item.slice('skill:'.length));
|
|
8
8
|
}
|
|
9
|
+
/** Returns the `pack:<id>` ids referenced by a bot policy, in policy order. */
|
|
10
|
+
export function packIdsInPolicy(policy) {
|
|
11
|
+
return (policy?.include ?? [])
|
|
12
|
+
.filter((item) => item.startsWith('pack:'))
|
|
13
|
+
.map((item) => item.slice('pack:'.length));
|
|
14
|
+
}
|
|
9
15
|
export function policyIncludesDirectSkill(policy, skillName) {
|
|
10
16
|
return Array.isArray(policy?.include) && policy.include.includes(directSkillSelector(skillName));
|
|
11
17
|
}
|
|
18
|
+
/** True when any pack in `packs` that is referenced by `policy` contains the
|
|
19
|
+
* given skill. Used for indirect (via-pack) impact analysis. */
|
|
20
|
+
function policyReferencesSkillViaPack(policy, skillName, packs) {
|
|
21
|
+
if (!packs)
|
|
22
|
+
return false;
|
|
23
|
+
const selector = directSkillSelector(skillName);
|
|
24
|
+
for (const packId of packIdsInPolicy(policy)) {
|
|
25
|
+
const pack = Object.hasOwn(packs, packId) ? packs[packId] : undefined;
|
|
26
|
+
if (pack && Array.isArray(pack.include) && pack.include.includes(selector))
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
/** Returns the ids of packs that directly contain the given skill. */
|
|
32
|
+
export function packsContainingSkill(skillName, packs) {
|
|
33
|
+
if (!packs)
|
|
34
|
+
return [];
|
|
35
|
+
const selector = directSkillSelector(skillName);
|
|
36
|
+
return Object.values(packs)
|
|
37
|
+
.filter((pack) => Array.isArray(pack.include) && pack.include.includes(selector))
|
|
38
|
+
.map((pack) => pack.id)
|
|
39
|
+
.sort();
|
|
40
|
+
}
|
|
12
41
|
export function analyzeSkillReferences(skillName, opts) {
|
|
13
42
|
const bots = [];
|
|
14
43
|
for (const bot of opts.bots) {
|
|
15
44
|
const direct = policyIncludesDirectSkill(bot.skills, skillName);
|
|
16
|
-
|
|
45
|
+
const viaPack = !direct && policyReferencesSkillViaPack(bot.skills, skillName, opts.packs);
|
|
46
|
+
if (!direct && !viaPack)
|
|
17
47
|
continue;
|
|
18
48
|
bots.push({
|
|
19
49
|
larkAppId: bot.larkAppId,
|
|
@@ -22,6 +52,9 @@ export function analyzeSkillReferences(skillName, opts) {
|
|
|
22
52
|
});
|
|
23
53
|
}
|
|
24
54
|
bots.sort((a, b) => a.botName.localeCompare(b.botName));
|
|
25
|
-
return {
|
|
55
|
+
return {
|
|
56
|
+
bots,
|
|
57
|
+
packs: packsContainingSkill(skillName, opts.packs),
|
|
58
|
+
};
|
|
26
59
|
}
|
|
27
60
|
//# sourceMappingURL=references.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../../src/core/skills/references.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../../src/core/skills/references.ts"],"names":[],"mappings":"AAsBA,SAAS,mBAAmB,CAAC,SAAiB;IAC5C,OAAO,SAAS,SAAS,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAyC;IACxE,OAAO,CAAC,MAAM,EAA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I,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,OAAO;QACL,IAAI;QACJ,KAAK,EAAE,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function botmuxSkillsHome(): string;
|
|
2
2
|
export declare function skillRegistryPath(): string;
|
|
3
|
+
export declare function skillPackRegistryPath(): string;
|
|
3
4
|
export declare function skillStoreDir(): string;
|
|
4
5
|
export declare function skillSourcesDir(): string;
|
|
5
6
|
//# sourceMappingURL=registry-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-paths.d.ts","sourceRoot":"","sources":["../../../src/core/skills/registry-paths.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
|
1
|
+
{"version":3,"file":"registry-paths.d.ts","sourceRoot":"","sources":["../../../src/core/skills/registry-paths.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
|
@@ -6,6 +6,9 @@ export function botmuxSkillsHome() {
|
|
|
6
6
|
export function skillRegistryPath() {
|
|
7
7
|
return join(botmuxSkillsHome(), 'registry.json');
|
|
8
8
|
}
|
|
9
|
+
export function skillPackRegistryPath() {
|
|
10
|
+
return join(botmuxSkillsHome(), 'packs.json');
|
|
11
|
+
}
|
|
9
12
|
export function skillStoreDir() {
|
|
10
13
|
return join(botmuxSkillsHome(), 'store');
|
|
11
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-paths.js","sourceRoot":"","sources":["../../../src/core/skills/registry-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,eAAe,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,CAAC,CAAC;AAC7C,CAAC"}
|
|
1
|
+
{"version":3,"file":"registry-paths.js","sourceRoot":"","sources":["../../../src/core/skills/registry-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,eAAe,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,YAAY,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CliId } from '../../adapters/cli/types.js';
|
|
2
|
-
import type { BotSkillPolicy, SessionSkillManifest, SkillPackage } from './types.js';
|
|
2
|
+
import type { BotSkillPolicy, SessionSkillManifest, SkillPackage, SkillPack } from './types.js';
|
|
3
3
|
export declare function resolveSessionSkillManifest(opts: {
|
|
4
4
|
sessionId: string;
|
|
5
5
|
cliId: CliId;
|
|
@@ -10,6 +10,7 @@ export declare function resolveSessionSkillManifest(opts: {
|
|
|
10
10
|
globalDelivery?: 'auto' | 'prompt' | 'native';
|
|
11
11
|
registrySkills: SkillPackage[];
|
|
12
12
|
projectSkills: SkillPackage[];
|
|
13
|
+
packs?: Record<string, SkillPack>;
|
|
13
14
|
now?: () => string;
|
|
14
15
|
}): SessionSkillManifest | null;
|
|
15
16
|
//# sourceMappingURL=session-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-resolver.d.ts","sourceRoot":"","sources":["../../../src/core/skills/session-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"session-resolver.d.ts","sourceRoot":"","sources":["../../../src/core/skills/session-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGhG,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,mBAAmB,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC9C,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,GAAG,oBAAoB,GAAG,IAAI,CAsB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-resolver.js","sourceRoot":"","sources":["../../../src/core/skills/session-resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,2BAA2B,CAAC,
|
|
1
|
+
{"version":3,"file":"session-resolver.js","sourceRoot":"","sources":["../../../src/core/skills/session-resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,2BAA2B,CAAC,IAY3C;IACC,MAAM,QAAQ,GAAG,kBAAkB,CAAC;QAClC,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;QAC7C,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,UAAU,EAAE,QAAQ,CAAC,IAAI;QACzB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-runtime.d.ts","sourceRoot":"","sources":["../../../src/core/skills/session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"session-runtime.d.ts","sourceRoot":"","sources":["../../../src/core/skills/session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAIzD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAMrF,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACvC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B,GAAG,0BAA0B,CA8B7B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readGlobalConfig } from '../../global-config.js';
|
|
2
2
|
import { readSkillRegistry } from '../../services/skill-registry-store.js';
|
|
3
|
+
import { readSkillPackRegistry } from '../../services/skill-pack-store.js';
|
|
3
4
|
import { discoverProjectSkills } from './discovery.js';
|
|
4
5
|
import { removeSessionSkillManifest, writeSessionSkillManifest } from './manifest-store.js';
|
|
5
6
|
import { renderSkillCatalogBlock } from './prompt.js';
|
|
@@ -20,6 +21,7 @@ export function prepareSessionSkillPrompt(opts) {
|
|
|
20
21
|
globalDelivery: globalSkills?.delivery,
|
|
21
22
|
registrySkills: Object.values(readSkillRegistry().skills),
|
|
22
23
|
projectSkills: discoverProjectSkills(opts.workingDir),
|
|
24
|
+
packs: readSkillPackRegistry().packs,
|
|
23
25
|
});
|
|
24
26
|
if (!manifest || manifest.prioritySkills.length === 0) {
|
|
25
27
|
removeSessionSkillManifest(opts.sessionId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-runtime.js","sourceRoot":"","sources":["../../../src/core/skills/session-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAOpE,MAAM,UAAU,yBAAyB,CAAC,IAOzC;IACC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC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AC;IACD,OAAO;QACL,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,OAAO,uBAAuB,CAAC,QAAQ,CAAC,EAAE;QAChE,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -21,6 +21,10 @@ export interface AgentbuddySource {
|
|
|
21
21
|
skill?: string;
|
|
22
22
|
version?: string;
|
|
23
23
|
}
|
|
24
|
+
/** Stable identifier persisted in the skill registry and rendered back to
|
|
25
|
+
* users. Keep this formatter beside the parser so every emitted identifier is
|
|
26
|
+
* guaranteed to have a matching parse form. */
|
|
27
|
+
export declare function formatAgentbuddyIdentifier(opts: AgentbuddySource): string;
|
|
24
28
|
export declare function redactGitUrlCredentials(raw: string): string;
|
|
25
29
|
export declare function assertNoGitUrlCredentials(raw: string): void;
|
|
26
30
|
export declare function assertAllowedGitProtocol(raw: string): void;
|
|
@@ -34,12 +38,31 @@ export declare function assertSafeGitSkillPath(path: string): void;
|
|
|
34
38
|
* agentbuddy skill collection add <uid>
|
|
35
39
|
* agentbuddy plugin collection add <uid>
|
|
36
40
|
* agentbuddy skill add <group> --skill <name> [--version <v>]
|
|
41
|
+
* agentbuddy skill add <group>/<name> [--version <v>]
|
|
37
42
|
* and tolerates a leading `KEY=VALUE … npx [-y] agentbuddy@latest …` prefix
|
|
38
43
|
* (the env + runner the site prepends). Only install subcommands (`add`,
|
|
39
44
|
* `collection add`) of `skill`/`plugin` are accepted — other agentbuddy
|
|
40
45
|
* subcommands (publish/remove/login/…) return null so a stray command can't
|
|
41
46
|
* drive the CLI. Returns null for anything that isn't such a command. */
|
|
42
47
|
export declare function parseAgentbuddyCommand(raw: string): AgentbuddySource | null;
|
|
48
|
+
/** Parse the canonical `agentbuddy:` identifiers documented in
|
|
49
|
+
* docs/setup/skills.md, which the dashboard install box accepts directly:
|
|
50
|
+
* agentbuddy:collection/<uid>
|
|
51
|
+
* agentbuddy:<group>/<skill>[@<version>]
|
|
52
|
+
* A leading `skill`/`plugin` segment is always treated as the protocol, for
|
|
53
|
+
* both `collection/<uid>` and `<group>/<skill>` — that is the exact shape
|
|
54
|
+
* formatAgentbuddyIdentifier() writes into the registry, so a saved source
|
|
55
|
+
* re-parses back to the same target (see the round-trip test in
|
|
56
|
+
* test/skill-sources.test.ts).
|
|
57
|
+
* Consequence, deliberate: a group whose FIRST segment is literally `skill` or
|
|
58
|
+
* `plugin` cannot be expressed here — `agentbuddy:skill/health` reads as
|
|
59
|
+
* protocol `skill` + an incomplete target and throws. Real groups are
|
|
60
|
+
* registry-host prefixed (`skills.example.com/team`), so this does not collide
|
|
61
|
+
* in practice; the round-trip guarantee is worth more than that name.
|
|
62
|
+
* Throws `invalid_agentbuddy_*` for malformed identifiers (an `agentbuddy:`
|
|
63
|
+
* prefix is an explicit intent — it must never fall through to another kind).
|
|
64
|
+
* Returns null when `raw` carries no `agentbuddy:` prefix at all. */
|
|
65
|
+
export declare function parseAgentbuddyIdentifier(raw: string): AgentbuddySource | null;
|
|
43
66
|
/** Recognize the open-source `skills` CLI (vercel-labs/skills) add command and
|
|
44
67
|
* route its GitHub source into botmux's native GitHub/Git install — no extra
|
|
45
68
|
* dependency, and public repos need no auth. Accepts:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/core/skills/sources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/core/skills/sources.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,YAAY,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE,UAAU,CAAC,EAAE,gBAAgB,C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import { existsSync } from 'node:fs';
|
|
1
2
|
import { isAbsolute } from 'node:path';
|
|
3
|
+
import { extractSkillsInstallCommandSource } from './install-command.js';
|
|
4
|
+
/** Stable identifier persisted in the skill registry and rendered back to
|
|
5
|
+
* users. Keep this formatter beside the parser so every emitted identifier is
|
|
6
|
+
* guaranteed to have a matching parse form. */
|
|
7
|
+
export function formatAgentbuddyIdentifier(opts) {
|
|
8
|
+
const protocol = opts.protocol ?? 'skill';
|
|
9
|
+
return opts.collection
|
|
10
|
+
? `${protocol}/collection/${opts.collection}`
|
|
11
|
+
: `${protocol}/${opts.group}/${opts.skill}${opts.version ? `@${opts.version}` : ''}`;
|
|
12
|
+
}
|
|
2
13
|
function parseMaybeUrl(raw) {
|
|
3
14
|
try {
|
|
4
15
|
return new URL(raw.replace(/^git\+/, ''));
|
|
@@ -22,7 +33,11 @@ export function assertNoGitUrlCredentials(raw) {
|
|
|
22
33
|
const url = parseMaybeUrl(raw);
|
|
23
34
|
if (!url)
|
|
24
35
|
return;
|
|
25
|
-
|
|
36
|
+
const httpUserInfo = (url.protocol === 'http:' || url.protocol === 'https:') && !!url.username;
|
|
37
|
+
// Preserve standard ssh://git@host URLs: the SSH username selects an account
|
|
38
|
+
// and is not a secret. Passwords embedded in any supported URL protocol are
|
|
39
|
+
// credentials and must never reach the registry.
|
|
40
|
+
if (httpUserInfo || url.password) {
|
|
26
41
|
throw new Error('git_url_credentials_not_allowed');
|
|
27
42
|
}
|
|
28
43
|
}
|
|
@@ -145,6 +160,7 @@ function assertSafeAgentbuddyGroup(group) {
|
|
|
145
160
|
* agentbuddy skill collection add <uid>
|
|
146
161
|
* agentbuddy plugin collection add <uid>
|
|
147
162
|
* agentbuddy skill add <group> --skill <name> [--version <v>]
|
|
163
|
+
* agentbuddy skill add <group>/<name> [--version <v>]
|
|
148
164
|
* and tolerates a leading `KEY=VALUE … npx [-y] agentbuddy@latest …` prefix
|
|
149
165
|
* (the env + runner the site prepends). Only install subcommands (`add`,
|
|
150
166
|
* `collection add`) of `skill`/`plugin` are accepted — other agentbuddy
|
|
@@ -167,10 +183,23 @@ export function parseAgentbuddyCommand(raw) {
|
|
|
167
183
|
return { protocol, collection: rest[3] };
|
|
168
184
|
}
|
|
169
185
|
// <protocol> add <group> --skill <name> [--version <v>]
|
|
186
|
+
// <protocol> add <group>/<skill> [--version <v>]
|
|
187
|
+
//
|
|
188
|
+
// The second form is the copy-command emitted by the internal marketplace,
|
|
189
|
+
// commonly with a leading npm_config_registry=... npx -y prefix. Parse the
|
|
190
|
+
// final path segment as the skill while retaining the existing explicit
|
|
191
|
+
// --skill form for backwards compatibility.
|
|
170
192
|
if (rest[1] === 'add' && rest[2] && !rest[2].startsWith('-')) {
|
|
171
|
-
|
|
193
|
+
let group = rest[2];
|
|
172
194
|
const skillIdx = Math.max(rest.indexOf('--skill'), rest.indexOf('-s'));
|
|
173
|
-
|
|
195
|
+
let skill = skillIdx >= 0 ? rest[skillIdx + 1] : undefined;
|
|
196
|
+
if (!skill) {
|
|
197
|
+
const segments = group.split('/');
|
|
198
|
+
if (segments.length < 2)
|
|
199
|
+
return null;
|
|
200
|
+
skill = segments.pop();
|
|
201
|
+
group = segments.join('/');
|
|
202
|
+
}
|
|
174
203
|
if (!skill)
|
|
175
204
|
return null;
|
|
176
205
|
const verIdx = Math.max(rest.indexOf('--version'), rest.indexOf('-v'));
|
|
@@ -183,6 +212,67 @@ export function parseAgentbuddyCommand(raw) {
|
|
|
183
212
|
}
|
|
184
213
|
return null;
|
|
185
214
|
}
|
|
215
|
+
/** Parse the canonical `agentbuddy:` identifiers documented in
|
|
216
|
+
* docs/setup/skills.md, which the dashboard install box accepts directly:
|
|
217
|
+
* agentbuddy:collection/<uid>
|
|
218
|
+
* agentbuddy:<group>/<skill>[@<version>]
|
|
219
|
+
* A leading `skill`/`plugin` segment is always treated as the protocol, for
|
|
220
|
+
* both `collection/<uid>` and `<group>/<skill>` — that is the exact shape
|
|
221
|
+
* formatAgentbuddyIdentifier() writes into the registry, so a saved source
|
|
222
|
+
* re-parses back to the same target (see the round-trip test in
|
|
223
|
+
* test/skill-sources.test.ts).
|
|
224
|
+
* Consequence, deliberate: a group whose FIRST segment is literally `skill` or
|
|
225
|
+
* `plugin` cannot be expressed here — `agentbuddy:skill/health` reads as
|
|
226
|
+
* protocol `skill` + an incomplete target and throws. Real groups are
|
|
227
|
+
* registry-host prefixed (`skills.example.com/team`), so this does not collide
|
|
228
|
+
* in practice; the round-trip guarantee is worth more than that name.
|
|
229
|
+
* Throws `invalid_agentbuddy_*` for malformed identifiers (an `agentbuddy:`
|
|
230
|
+
* prefix is an explicit intent — it must never fall through to another kind).
|
|
231
|
+
* Returns null when `raw` carries no `agentbuddy:` prefix at all. */
|
|
232
|
+
export function parseAgentbuddyIdentifier(raw) {
|
|
233
|
+
const trimmed = raw.trim();
|
|
234
|
+
if (!/^agentbuddy:/i.test(trimmed))
|
|
235
|
+
return null;
|
|
236
|
+
const rest = trimmed.slice('agentbuddy:'.length).replace(/^\/+/, '');
|
|
237
|
+
if (!rest)
|
|
238
|
+
throw new Error('invalid_agentbuddy_identifier');
|
|
239
|
+
let segments = rest.split('/').filter((segment) => segment.length > 0);
|
|
240
|
+
if (segments.length !== rest.split('/').length)
|
|
241
|
+
throw new Error('invalid_agentbuddy_identifier');
|
|
242
|
+
let protocol;
|
|
243
|
+
// Registry identifiers always carry the protocol for both collections and
|
|
244
|
+
// individual skills. Strip it before parsing the remaining collection or
|
|
245
|
+
// group/skill shape so a rendered source round-trips into the same target.
|
|
246
|
+
if (segments[0] === 'skill' || segments[0] === 'plugin') {
|
|
247
|
+
protocol = segments[0];
|
|
248
|
+
segments = segments.slice(1);
|
|
249
|
+
}
|
|
250
|
+
// collection/<uid>
|
|
251
|
+
if (segments[0] === 'collection') {
|
|
252
|
+
if (segments.length !== 2)
|
|
253
|
+
throw new Error('invalid_agentbuddy_collection');
|
|
254
|
+
assertSafeAgentbuddyToken(segments[1], 'collection');
|
|
255
|
+
return { protocol: protocol ?? 'skill', collection: segments[1] };
|
|
256
|
+
}
|
|
257
|
+
// <group>/<skill>[@<version>] — last segment is the skill, the rest the group
|
|
258
|
+
if (segments.length < 2)
|
|
259
|
+
throw new Error('invalid_agentbuddy_identifier');
|
|
260
|
+
const last = segments[segments.length - 1];
|
|
261
|
+
const at = last.lastIndexOf('@');
|
|
262
|
+
const skill = at > 0 ? last.slice(0, at) : last;
|
|
263
|
+
const version = at > 0 ? last.slice(at + 1) : undefined;
|
|
264
|
+
const group = segments.slice(0, -1).join('/');
|
|
265
|
+
assertSafeAgentbuddyGroup(group);
|
|
266
|
+
assertSafeAgentbuddyToken(skill, 'skill');
|
|
267
|
+
if (version !== undefined)
|
|
268
|
+
assertSafeAgentbuddyToken(version, 'version', AGENTBUDDY_VERSION_RE);
|
|
269
|
+
return { protocol: protocol ?? 'skill', group, skill, ...(version ? { version } : {}) };
|
|
270
|
+
}
|
|
271
|
+
/** Bare GitHub shorthand: `owner/repo` or `owner/repo/path`. GitHub owners are
|
|
272
|
+
* alphanumeric + hyphen, which keeps this from matching most relative paths;
|
|
273
|
+
* an existing local directory still wins (checked by the caller) so a real
|
|
274
|
+
* relative path is never hijacked. */
|
|
275
|
+
const GITHUB_SHORTHAND_RE = /^[A-Za-z0-9][A-Za-z0-9-]*\/[A-Za-z0-9._-]+(?:\/[\w./-]+)?$/;
|
|
186
276
|
/** Recognize the open-source `skills` CLI (vercel-labs/skills) add command and
|
|
187
277
|
* route its GitHub source into botmux's native GitHub/Git install — no extra
|
|
188
278
|
* dependency, and public repos need no auth. Accepts:
|
|
@@ -191,15 +281,7 @@ export function parseAgentbuddyCommand(raw) {
|
|
|
191
281
|
* where <owner/repo> is a GitHub shorthand or a GitHub/Git URL. Returns null
|
|
192
282
|
* for anything that isn't such a command. */
|
|
193
283
|
export function parseSkillsInstallCommand(raw) {
|
|
194
|
-
const
|
|
195
|
-
const binIdx = tokens.findIndex((t) => t === 'skills' || t === 'add-skill' || t.startsWith('skills@'));
|
|
196
|
-
if (binIdx < 0)
|
|
197
|
-
return null;
|
|
198
|
-
const bin = tokens[binIdx];
|
|
199
|
-
const rest = tokens.slice(binIdx + 1).filter((t) => t !== '-y' && t !== '--yes');
|
|
200
|
-
const source = rest[0] === 'add'
|
|
201
|
-
? rest[1]
|
|
202
|
-
: (bin === 'add-skill' && rest[0] && !rest[0].startsWith('-') ? rest[0] : undefined);
|
|
284
|
+
const source = extractSkillsInstallCommandSource(raw);
|
|
203
285
|
if (!source)
|
|
204
286
|
return null;
|
|
205
287
|
// Bare owner/repo[/path] → GitHub shorthand; explicit URLs pass through.
|
|
@@ -218,6 +300,13 @@ export function parseSkillInstallSource(raw) {
|
|
|
218
300
|
if (command) {
|
|
219
301
|
return { kind: 'agentbuddy', value: raw, agentbuddy: command };
|
|
220
302
|
}
|
|
303
|
+
// Canonical `agentbuddy:` identifiers (documented in docs/setup/skills.md).
|
|
304
|
+
// Throws on malformed input rather than falling through — an explicit scheme
|
|
305
|
+
// must never be reinterpreted as a local path.
|
|
306
|
+
const identifier = parseAgentbuddyIdentifier(raw);
|
|
307
|
+
if (identifier) {
|
|
308
|
+
return { kind: 'agentbuddy', value: raw, agentbuddy: identifier };
|
|
309
|
+
}
|
|
221
310
|
const skillsCommand = parseSkillsInstallCommand(raw);
|
|
222
311
|
if (skillsCommand)
|
|
223
312
|
return skillsCommand;
|
|
@@ -249,6 +338,33 @@ export function parseSkillInstallSource(raw) {
|
|
|
249
338
|
assertAllowedGitProtocol(value);
|
|
250
339
|
return { kind: 'git', value };
|
|
251
340
|
}
|
|
341
|
+
// Bare GitHub shorthand (`owner/repo`, `owner/repo/path`). Authoritative here
|
|
342
|
+
// rather than in the dashboard so the CLI/IM entry points behave identically.
|
|
343
|
+
// An existing local directory of the same name always wins.
|
|
344
|
+
if (!isAbsolute(raw) && !/^[.~]/.test(raw) && GITHUB_SHORTHAND_RE.test(raw) && !existsSync(raw)) {
|
|
345
|
+
const parts = raw.split('/').filter(Boolean);
|
|
346
|
+
const path = parts.slice(2).join('/') || undefined;
|
|
347
|
+
if (path)
|
|
348
|
+
assertSafeGitSkillPath(path);
|
|
349
|
+
return {
|
|
350
|
+
kind: 'github',
|
|
351
|
+
value: `github:${raw}`,
|
|
352
|
+
github: { owner: parts[0], repo: parts[1], ...(path ? { path } : {}) },
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
// Any remaining http(s) URL is a git remote (e.g. a self-hosted GitLab), not
|
|
356
|
+
// a filesystem path. Previously these fell through to `local` and failed with
|
|
357
|
+
// a confusing "path not found"; the dashboard papered over it by prefixing
|
|
358
|
+
// `git+` client-side, which the CLI/IM paths never did.
|
|
359
|
+
if (/^https?:\/\//i.test(raw)) {
|
|
360
|
+
assertAllowedGitProtocol(raw);
|
|
361
|
+
return { kind: 'git', value: raw };
|
|
362
|
+
}
|
|
363
|
+
// A scheme we don't handle must fail loudly instead of being treated as a
|
|
364
|
+
// relative path (`foo://bar` is not a directory).
|
|
365
|
+
if (/^[A-Za-z][A-Za-z0-9+.-]*:\/\//.test(raw)) {
|
|
366
|
+
throw new Error('unsupported_skill_source_scheme');
|
|
367
|
+
}
|
|
252
368
|
return { kind: 'local', value: raw };
|
|
253
369
|
}
|
|
254
370
|
export function githubToGitUrl(owner, repo) {
|