@makaio/framework 1.0.0-dev-1779046984397
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/LICENSE +21 -0
- package/README.md +363 -0
- package/dist/account-identity-Ce1Bwrqi.mjs +1 -0
- package/dist/adapter-CbyjCE2d.mjs +1 -0
- package/dist/adapters/acp-client/index.d.mts +209 -0
- package/dist/adapters/acp-client/index.mjs +1 -0
- package/dist/adapters/config/index.d.mts +429 -0
- package/dist/adapters/config/index.mjs +1 -0
- package/dist/adapters/index.d.mts +4175 -0
- package/dist/adapters/index.mjs +11 -0
- package/dist/adapters/node.d.mts +263 -0
- package/dist/adapters/node.mjs +4 -0
- package/dist/adapters/stream-session/index.d.mts +1384 -0
- package/dist/adapters/stream-session/index.mjs +1 -0
- package/dist/adapters/stream-session/testing/index.d.mts +29 -0
- package/dist/adapters/stream-session/testing/index.mjs +1 -0
- package/dist/base-orchestrator-9z8TuA5a.d.mts +772 -0
- package/dist/bus/index.d.mts +3331 -0
- package/dist/bus/index.mjs +1 -0
- package/dist/bus-B1seC4M_.mjs +2 -0
- package/dist/capability-service-tnpR_TaB.mjs +1 -0
- package/dist/chunk-Dc06z0qk.mjs +1 -0
- package/dist/chunk-cpUYaJdV.mjs +1 -0
- package/dist/cleanEnvForAdapter-DvcIGXTG.mjs +1 -0
- package/dist/client-Dh4x4GQN.mjs +1 -0
- package/dist/clients/index.d.mts +2786 -0
- package/dist/clients/index.mjs +1 -0
- package/dist/clients-namespace-B0xAPZ6J.d.mts +332 -0
- package/dist/config-namespace-DLSs83zr.d.mts +638 -0
- package/dist/config-namespace-MJT8P0Ud.mjs +1 -0
- package/dist/contracts/adapter/index.d.mts +3 -0
- package/dist/contracts/adapter/index.mjs +1 -0
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +2 -0
- package/dist/contracts/adapter/schemas/session-lineage.mjs +1 -0
- package/dist/contracts/client/index.d.mts +3 -0
- package/dist/contracts/client/index.mjs +1 -0
- package/dist/contracts/common/index.d.mts +2 -0
- package/dist/contracts/common/index.mjs +1 -0
- package/dist/contracts/config/index.d.mts +455 -0
- package/dist/contracts/config/index.mjs +1 -0
- package/dist/contracts/extension/index.d.mts +3 -0
- package/dist/contracts/extension/index.mjs +1 -0
- package/dist/contracts/harness/index.d.mts +2 -0
- package/dist/contracts/harness/index.mjs +1 -0
- package/dist/contracts/host/index.d.mts +2 -0
- package/dist/contracts/host/index.mjs +1 -0
- package/dist/contracts/index.d.mts +12665 -0
- package/dist/contracts/index.mjs +1 -0
- package/dist/contracts/model-registry/index.d.mts +2 -0
- package/dist/contracts/model-registry/index.mjs +1 -0
- package/dist/contracts/native-session-supervisor/index.d.mts +2 -0
- package/dist/contracts/native-session-supervisor/index.mjs +1 -0
- package/dist/contracts/platform/index.d.mts +2 -0
- package/dist/contracts/platform/index.mjs +1 -0
- package/dist/contracts/provider/index.d.mts +3 -0
- package/dist/contracts/provider/index.mjs +1 -0
- package/dist/contracts/session/index.d.mts +3 -0
- package/dist/contracts/session/index.mjs +1 -0
- package/dist/contracts/shared/index.d.mts +2 -0
- package/dist/contracts/shared/index.mjs +1 -0
- package/dist/contracts/skill/index.d.mts +2 -0
- package/dist/contracts/skill/index.mjs +1 -0
- package/dist/contracts/toast/index.d.mts +198 -0
- package/dist/contracts/toast/index.mjs +1 -0
- package/dist/contracts/variant/index.d.mts +2 -0
- package/dist/contracts/variant/index.mjs +1 -0
- package/dist/core/index.d.mts +1001 -0
- package/dist/core/index.mjs +1 -0
- package/dist/credential-ref-DLCsoKVZ.mjs +1 -0
- package/dist/cursor-storage-DOQdvo9j.mjs +1 -0
- package/dist/definition-DkYy1PZz.mjs +1 -0
- package/dist/definition-DtUNiGom.d.mts +158 -0
- package/dist/definition-DxvZ9e22.d.mts +376 -0
- package/dist/drizzle-CWVVw7Er.mjs +1 -0
- package/dist/execution-target-BW_uiBVe.mjs +1 -0
- package/dist/extension-COqwS-2Q.mjs +1 -0
- package/dist/extension-Cbrl4YGX.mjs +1 -0
- package/dist/extension-namespace-zaGKi6Qj.mjs +1 -0
- package/dist/handlers-iGKUJ380.mjs +41 -0
- package/dist/harness-CEq1Zkf9.mjs +1 -0
- package/dist/hooks/index.d.mts +423 -0
- package/dist/hooks/index.mjs +1 -0
- package/dist/host-CXAUGGN0.mjs +1 -0
- package/dist/identity-B_A0mE63.mjs +1 -0
- package/dist/index-6lyShOoU.d.mts +225 -0
- package/dist/index-7sXlairn2.d.mts +43 -0
- package/dist/index-BAKM2GMH2.d.mts +535 -0
- package/dist/index-BB419vv-.d.mts +3897 -0
- package/dist/index-BJOfdtbw.d.mts +729 -0
- package/dist/index-BXP9GK5q.d.mts +1075 -0
- package/dist/index-BdPwu6c0.d.mts +1730 -0
- package/dist/index-BePI0ckL.d.mts +40 -0
- package/dist/index-Bigx81Kr.d.mts +37 -0
- package/dist/index-BnNqbx2I.d.mts +134 -0
- package/dist/index-Bv15sNLn.d.mts +389 -0
- package/dist/index-C-myW_aK.d.mts +412 -0
- package/dist/index-C9F3Fc1A.d.mts +2938 -0
- package/dist/index-CNxS4Tlu.d.mts +1 -0
- package/dist/index-CVA0m1g9.d.mts +995 -0
- package/dist/index-C_kS2aqV2.d.mts +438 -0
- package/dist/index-Ch3ph52M2.d.mts +40 -0
- package/dist/index-CnZOKNjU.d.mts +89 -0
- package/dist/index-D1T-PPqF.d.mts +67 -0
- package/dist/index-D7T8XCku.d.mts +341 -0
- package/dist/index-DBQtpFLE.d.mts +4843 -0
- package/dist/index-DEw90pa2.d.mts +183 -0
- package/dist/index-DQRsGXb5.d.mts +109 -0
- package/dist/index-Dd5s4MSm.d.mts +72 -0
- package/dist/index-DubqLGH8.d.mts +1002 -0
- package/dist/index-ESSDWIB7.d.mts +11 -0
- package/dist/index-N5K1NOYs.d.mts +184 -0
- package/dist/index-PdUSmPT2.d.mts +180 -0
- package/dist/index-SzSiyG61.d.mts +117 -0
- package/dist/index-T0471kWA.d.mts +6760 -0
- package/dist/index-WKjrpcA_.d.mts +218 -0
- package/dist/index-hapw9_En.d.mts +13592 -0
- package/dist/index-iID2R9G1.d.mts +1490 -0
- package/dist/kernel/cli/index.d.mts +141 -0
- package/dist/kernel/cli/index.mjs +1 -0
- package/dist/kernel/cli/schemas.d.mts +63 -0
- package/dist/kernel/cli/schemas.mjs +1 -0
- package/dist/kernel/extension/index.d.mts +2 -0
- package/dist/kernel/extension/index.mjs +1 -0
- package/dist/kernel/index.d.mts +296 -0
- package/dist/kernel/index.mjs +1 -0
- package/dist/kernel/namespace/index.d.mts +2 -0
- package/dist/kernel/namespace/index.mjs +1 -0
- package/dist/kernel/observability/index.d.mts +2 -0
- package/dist/kernel/observability/index.mjs +1 -0
- package/dist/kernel/providers/index.d.mts +2 -0
- package/dist/kernel/providers/index.mjs +1 -0
- package/dist/kernel/window/index.d.mts +2 -0
- package/dist/kernel/window/index.mjs +1 -0
- package/dist/model-registry-BNzpR6TU.mjs +1 -0
- package/dist/model-registry-CIscwC52.mjs +1 -0
- package/dist/namespace-0yuzAKlr.mjs +1 -0
- package/dist/namespace-8cNguvIp.mjs +1 -0
- package/dist/namespace-BK2erxpV.d.mts +921 -0
- package/dist/namespace-Bmc7AW4J2.mjs +1 -0
- package/dist/namespace-C2ufjgaQ.d.mts +767 -0
- package/dist/namespace-C54Oj025.d.mts +159 -0
- package/dist/namespace-CCDEOwmW.d.mts +1313 -0
- package/dist/namespace-CfEWMXBx.mjs +1 -0
- package/dist/namespace-CkLUtc0g.d.mts +580 -0
- package/dist/namespace-D5Wrt7YU.mjs +1 -0
- package/dist/namespace-DZcuLwEA.d.mts +51 -0
- package/dist/namespace-Db-p67Rg.mjs +1 -0
- package/dist/namespace-FWx6HxaW.d.mts +611 -0
- package/dist/namespace-GLGGcWPH.d.mts +43 -0
- package/dist/namespace-N0dfwSg6.mjs +1 -0
- package/dist/namespace-O5SNY-LV.d.mts +2226 -0
- package/dist/namespace-ZbthBQVt.d.mts +142 -0
- package/dist/namespace-bq4Prtzn.d.mts +2046 -0
- package/dist/namespace-pNcSglBS.mjs +1 -0
- package/dist/namespace-ptv-pw_g.d.mts +3019 -0
- package/dist/namespace-xkvVw3hf2.d.mts +189 -0
- package/dist/native-session-supervisor-L-UIaEfd.mjs +1 -0
- package/dist/node/bus-server/index.d.mts +178 -0
- package/dist/node/bus-server/index.mjs +1 -0
- package/dist/node/bus-server/server-lifecycle.d.mts +2 -0
- package/dist/node/bus-server/server-lifecycle.mjs +1 -0
- package/dist/node/machine-identity/index.d.mts +85 -0
- package/dist/node/machine-identity/index.mjs +3 -0
- package/dist/node/transports/index.d.mts +1752 -0
- package/dist/node/transports/index.mjs +2 -0
- package/dist/orchestrator-shared-DrjtTXYh.d.mts +249 -0
- package/dist/orchestrator-shared-Wv1GI2mW.mjs +1 -0
- package/dist/platform-BbSLVg5b.mjs +1 -0
- package/dist/profile-4StaDQW0.mjs +1 -0
- package/dist/provider-context-CNRQ4d5m.mjs +1 -0
- package/dist/providers/index.d.mts +135 -0
- package/dist/providers/index.mjs +1 -0
- package/dist/providers-Cr4Za8a1.mjs +1 -0
- package/dist/providers-namespace-CDwxY_DV.d.mts +583 -0
- package/dist/schema-BwzXEtT2.d.mts +837 -0
- package/dist/schema-CAw_BqaG.mjs +1 -0
- package/dist/schema-introspection-D61TT_7b.mjs +1 -0
- package/dist/schema-uSGW-6oM.mjs +1 -0
- package/dist/schemas-BXstpWVp.mjs +1 -0
- package/dist/schemas-BdMU-gew.d.mts +160 -0
- package/dist/schemas-C40ZAJ33.mjs +1 -0
- package/dist/schemas-C5xtVqdb.d.mts +46 -0
- package/dist/schemas-CGZy_rU6.d.mts +13 -0
- package/dist/schemas-CLxtoKFy.mjs +1 -0
- package/dist/schemas-Co_sVhzz.mjs +1 -0
- package/dist/schemas-D9108Iv1.d.mts +182 -0
- package/dist/schemas-DENVYyds.d.mts +463 -0
- package/dist/schemas-DbWs_hj8.d.mts +174 -0
- package/dist/schemas-Di0XnnMX.d.mts +73 -0
- package/dist/schemas-KMA1efQg.d.mts +944 -0
- package/dist/schemas-qmn5SWPU.d.mts +312 -0
- package/dist/schemas-sshQEF3l.d.mts +237 -0
- package/dist/server-lifecycle-Cf_SZ27k.d.mts +160 -0
- package/dist/server-lifecycle-DbFwlrTW.mjs +1 -0
- package/dist/service-base/index.d.mts +98 -0
- package/dist/service-base/index.mjs +1 -0
- package/dist/services/adapter-runtime/index.d.mts +4 -0
- package/dist/services/adapter-runtime/index.mjs +1 -0
- package/dist/services/adapter-runtime/namespace.d.mts +2 -0
- package/dist/services/adapter-runtime/namespace.mjs +1 -0
- package/dist/services/adapter-runtime/schemas.d.mts +2 -0
- package/dist/services/adapter-runtime/schemas.mjs +1 -0
- package/dist/services/adapter-subsystem/index.d.mts +3 -0
- package/dist/services/adapter-subsystem/index.mjs +1 -0
- package/dist/services/adapter-subsystem/namespace.d.mts +2 -0
- package/dist/services/adapter-subsystem/namespace.mjs +1 -0
- package/dist/services/agent-runtime/index.d.mts +3 -0
- package/dist/services/agent-runtime/index.mjs +1 -0
- package/dist/services/agent-runtime/namespace.d.mts +2 -0
- package/dist/services/agent-runtime/namespace.mjs +1 -0
- package/dist/services/agent-runtime/schemas.d.mts +2 -0
- package/dist/services/agent-runtime/schemas.mjs +1 -0
- package/dist/services/capability/index.d.mts +2 -0
- package/dist/services/capability/index.mjs +1 -0
- package/dist/services/cli-detection/namespace.d.mts +56 -0
- package/dist/services/cli-detection/namespace.mjs +1 -0
- package/dist/services/codebase/index.d.mts +3 -0
- package/dist/services/codebase/index.mjs +1 -0
- package/dist/services/codebase/namespace.d.mts +2 -0
- package/dist/services/codebase/namespace.mjs +1 -0
- package/dist/services/codebase/schemas.d.mts +2 -0
- package/dist/services/codebase/schemas.mjs +1 -0
- package/dist/services/compression/index.d.mts +3 -0
- package/dist/services/compression/index.mjs +1 -0
- package/dist/services/compression/namespace.d.mts +2 -0
- package/dist/services/compression/namespace.mjs +1 -0
- package/dist/services/compression/schemas.d.mts +2 -0
- package/dist/services/compression/schemas.mjs +1 -0
- package/dist/services/context-rules/index.d.mts +412 -0
- package/dist/services/context-rules/index.mjs +1 -0
- package/dist/services/credential-change/index.d.mts +17 -0
- package/dist/services/credential-change/index.mjs +1 -0
- package/dist/services/definition/index.d.mts +2 -0
- package/dist/services/definition/index.mjs +1 -0
- package/dist/services/definition/namespace.d.mts +71 -0
- package/dist/services/definition/namespace.mjs +1 -0
- package/dist/services/definition/schemas.d.mts +38 -0
- package/dist/services/definition/schemas.mjs +1 -0
- package/dist/services/dialog/namespace.d.mts +105 -0
- package/dist/services/dialog/namespace.mjs +1 -0
- package/dist/services/dialog/schemas.d.mts +109 -0
- package/dist/services/dialog/schemas.mjs +1 -0
- package/dist/services/execution-target/index.d.mts +4 -0
- package/dist/services/execution-target/index.mjs +1 -0
- package/dist/services/execution-target/namespace.d.mts +2 -0
- package/dist/services/execution-target/namespace.mjs +1 -0
- package/dist/services/execution-target/schemas.d.mts +2 -0
- package/dist/services/execution-target/schemas.mjs +1 -0
- package/dist/services/filesystem/namespace.d.mts +432 -0
- package/dist/services/filesystem/namespace.mjs +1 -0
- package/dist/services/filesystem/schemas.d.mts +240 -0
- package/dist/services/filesystem/schemas.mjs +1 -0
- package/dist/services/harness/index.d.mts +861 -0
- package/dist/services/harness/index.mjs +1 -0
- package/dist/services/harness/storage/schema.d.mts +424 -0
- package/dist/services/harness/storage/schema.mjs +1 -0
- package/dist/services/index.d.mts +5703 -0
- package/dist/services/index.mjs +1 -0
- package/dist/services/local-notification/index.d.mts +25 -0
- package/dist/services/local-notification/index.mjs +1 -0
- package/dist/services/local-notification/namespace.d.mts +73 -0
- package/dist/services/local-notification/namespace.mjs +1 -0
- package/dist/services/local-notification/schemas.d.mts +88 -0
- package/dist/services/local-notification/schemas.mjs +1 -0
- package/dist/services/log-import/browser.d.mts +3 -0
- package/dist/services/log-import/browser.mjs +1 -0
- package/dist/services/log-import/index.d.mts +275 -0
- package/dist/services/log-import/index.mjs +2 -0
- package/dist/services/log-import/log-import.d.mts +3 -0
- package/dist/services/log-import/log-import.mjs +1 -0
- package/dist/services/log-import/namespace.d.mts +327 -0
- package/dist/services/log-import/namespace.mjs +1 -0
- package/dist/services/log-import/schemas.d.mts +217 -0
- package/dist/services/log-import/schemas.mjs +1 -0
- package/dist/services/model-registry/index.d.mts +2 -0
- package/dist/services/model-registry/index.mjs +1 -0
- package/dist/services/preferences/index.d.mts +3 -0
- package/dist/services/preferences/index.mjs +1 -0
- package/dist/services/preferences/schemas.d.mts +2 -0
- package/dist/services/preferences/schemas.mjs +1 -0
- package/dist/services/preferences/storage-namespace.d.mts +3 -0
- package/dist/services/preferences/storage-namespace.mjs +1 -0
- package/dist/services/provider-context/index.d.mts +2 -0
- package/dist/services/provider-context/index.mjs +1 -0
- package/dist/services/provider-runtime/index.d.mts +136 -0
- package/dist/services/provider-runtime/index.mjs +1 -0
- package/dist/services/session/handlers/index.d.mts +2 -0
- package/dist/services/session/handlers/index.mjs +1 -0
- package/dist/services/session/index.d.mts +10 -0
- package/dist/services/session/index.mjs +1 -0
- package/dist/services/session/messages/namespace.d.mts +2 -0
- package/dist/services/session/messages/namespace.mjs +1 -0
- package/dist/services/session/orchestrator-testing/index.d.mts +2 -0
- package/dist/services/session/orchestrator-testing/index.mjs +1 -0
- package/dist/services/session/session-events/namespace.d.mts +2 -0
- package/dist/services/session/session-events/namespace.mjs +1 -0
- package/dist/services/session/storage/namespace.d.mts +2 -0
- package/dist/services/session/storage/namespace.mjs +1 -0
- package/dist/services/session/storage/schema.d.mts +2 -0
- package/dist/services/session/storage/schema.mjs +1 -0
- package/dist/services/session/testing/index.d.mts +35 -0
- package/dist/services/session/testing/index.mjs +52 -0
- package/dist/services/session/testing/orchestrator-shared.d.mts +2 -0
- package/dist/services/session/testing/orchestrator-shared.mjs +1 -0
- package/dist/services/session/turns/namespace.d.mts +2 -0
- package/dist/services/session/turns/namespace.mjs +1 -0
- package/dist/services/session-editor/index.d.mts +119 -0
- package/dist/services/session-editor/index.mjs +1 -0
- package/dist/services/settings/index.d.mts +47 -0
- package/dist/services/settings/index.mjs +1 -0
- package/dist/services/settings/namespace.d.mts +662 -0
- package/dist/services/settings/namespace.mjs +1 -0
- package/dist/services/settings/storage/clients-namespace.d.mts +2 -0
- package/dist/services/settings/storage/clients-namespace.mjs +1 -0
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +184 -0
- package/dist/services/settings/storage/extension-configs/namespace.mjs +1 -0
- package/dist/services/settings/storage/index.d.mts +4 -0
- package/dist/services/settings/storage/index.mjs +1 -0
- package/dist/services/settings/storage/providers-namespace.d.mts +2 -0
- package/dist/services/settings/storage/providers-namespace.mjs +1 -0
- package/dist/services/tool-approval/index.d.mts +2 -0
- package/dist/services/tool-approval/index.mjs +1 -0
- package/dist/services/tools/index.d.mts +2 -0
- package/dist/services/tools/index.mjs +1 -0
- package/dist/services/tray-menu/index.d.mts +4 -0
- package/dist/services/tray-menu/index.mjs +1 -0
- package/dist/services/tray-menu/namespace.d.mts +2 -0
- package/dist/services/tray-menu/namespace.mjs +1 -0
- package/dist/services/tray-menu/schemas.d.mts +2 -0
- package/dist/services/tray-menu/schemas.mjs +1 -0
- package/dist/services/turn/index.d.mts +2 -0
- package/dist/services/turn/index.mjs +1 -0
- package/dist/services/turn/namespace.d.mts +2 -0
- package/dist/services/turn/namespace.mjs +1 -0
- package/dist/services/turn/schemas.d.mts +335 -0
- package/dist/services/turn/schemas.mjs +1 -0
- package/dist/services/worker/index.d.mts +3 -0
- package/dist/services/worker/index.mjs +1 -0
- package/dist/services/worker/namespace.d.mts +2 -0
- package/dist/services/worker/namespace.mjs +1 -0
- package/dist/services/worker/schemas.d.mts +2 -0
- package/dist/services/worker/schemas.mjs +1 -0
- package/dist/session-Do6lDZM4.mjs +123 -0
- package/dist/session-lineage-Eev4uo4I.d.mts +65 -0
- package/dist/session-piI1R5rP.mjs +1 -0
- package/dist/shared-DxHLl9UP.mjs +1 -0
- package/dist/shared-schemas-BgQv_tnu.mjs +1 -0
- package/dist/skill-CB5h-ZFQ.mjs +1 -0
- package/dist/storage/drizzle/client.d.mts +78 -0
- package/dist/storage/drizzle/client.mjs +1 -0
- package/dist/storage/drizzle/index.d.mts +98 -0
- package/dist/storage/drizzle/index.mjs +1 -0
- package/dist/storage/handlers/drizzle/index.d.mts +2 -0
- package/dist/storage/handlers/drizzle/index.mjs +1 -0
- package/dist/storage/handlers/index.d.mts +33 -0
- package/dist/storage/handlers/index.mjs +1 -0
- package/dist/storage/index.d.mts +192 -0
- package/dist/storage/index.mjs +1 -0
- package/dist/storage-namespace-ADwyijoe.mjs +1 -0
- package/dist/storage-namespace-DAm8iWEj.d.mts +221 -0
- package/dist/storage-namespace-definition-CHu2k14q.mjs +1 -0
- package/dist/storage-namespace-definition-CJgqyXH1.d.mts +17 -0
- package/dist/style.css +3782 -0
- package/dist/testing/drizzle-harness.d.mts +130 -0
- package/dist/testing/drizzle-harness.mjs +1 -0
- package/dist/testing/index.d.mts +106 -0
- package/dist/testing/index.mjs +1 -0
- package/dist/tool-approval-service-BcBSUZCO.mjs +1 -0
- package/dist/tools/index.d.mts +825 -0
- package/dist/tools/index.mjs +1 -0
- package/dist/tools/testing/index.d.mts +53 -0
- package/dist/tools/testing/index.mjs +1 -0
- package/dist/tools-CDSgj0ee.mjs +1 -0
- package/dist/tray-menu-service-CTXC1Elg.mjs +1 -0
- package/dist/types-6WxLfoM3.d.mts +31 -0
- package/dist/types-BjToUrHp.d.mts +6619 -0
- package/dist/types-CD1LJwPc.d.mts +1009 -0
- package/dist/types-Cvrj2ogm.d.mts +305 -0
- package/dist/types-DYF5LxZY.d.mts +233 -0
- package/dist/types-t295YC6T.d.mts +262 -0
- package/dist/types-vNpkAe4Y.d.mts +128 -0
- package/dist/ui-components/index.d.mts +2342 -0
- package/dist/ui-components/index.mjs +8 -0
- package/dist/ui-config-CXmbsqZV.mjs +1 -0
- package/dist/ui-hooks/index.d.mts +1805 -0
- package/dist/ui-hooks/index.mjs +1 -0
- package/dist/ui-kernel/index.d.mts +2793 -0
- package/dist/ui-kernel/index.mjs +1 -0
- package/dist/ui-kernel/pages/namespace.d.mts +88 -0
- package/dist/ui-kernel/pages/namespace.mjs +1 -0
- package/dist/ui-kernel/pages/schemas.d.mts +2 -0
- package/dist/ui-kernel/pages/schemas.mjs +1 -0
- package/dist/ui-views/index.d.mts +487 -0
- package/dist/ui-views/index.mjs +30 -0
- package/dist/utils/health-probe.d.mts +26 -0
- package/dist/utils/health-probe.mjs +1 -0
- package/dist/utils/index.d.mts +227 -0
- package/dist/utils/index.mjs +2 -0
- package/dist/utils/keychain.d.mts +31 -0
- package/dist/utils/keychain.mjs +1 -0
- package/dist/utils/resolve-package-root.d.mts +12 -0
- package/dist/utils/resolve-package-root.mjs +1 -0
- package/dist/utils/workspace-root.d.mts +27 -0
- package/dist/utils/workspace-root.mjs +2 -0
- package/dist/variant-D5kSrL3m.mjs +1 -0
- package/dist/version-CjS20oXi.mjs +1 -0
- package/dist/visibility-CZu8ooOA.mjs +1 -0
- package/dist/window-registry-CUftmDr3.mjs +1 -0
- package/dist/window-registry-C_IJmY8_.d.mts +130 -0
- package/package.json +346 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { r as LogImportMode, t as LogImporterInfo } from "./index-D1T-PPqF.mjs";
|
|
2
|
+
import * as _$_makaio_bus_core0 from "@makaio/framework/bus";
|
|
3
|
+
import { IMakaioBus } from "@makaio/framework/bus";
|
|
4
|
+
import { LogImportOrchestrator, LogImporter } from "@makaio/framework/adapters";
|
|
5
|
+
import { JsonObject } from "type-fest";
|
|
6
|
+
import { CapabilityService } from "@makaio/framework/services/capability";
|
|
7
|
+
|
|
8
|
+
//#region packages/services/log-import/src/capability-provider.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Minimal registry API required to register providers from capability events.
|
|
11
|
+
*
|
|
12
|
+
* `LogImportRegistry` satisfies this interface structurally, enabling the
|
|
13
|
+
* capability integration module to remain decoupled from the concrete class.
|
|
14
|
+
*/
|
|
15
|
+
interface CapabilityProviderRegistrar {
|
|
16
|
+
/**
|
|
17
|
+
* Returns the registration entry for an importer ID, or `undefined`.
|
|
18
|
+
* @param importerId - Unique importer ID
|
|
19
|
+
*/
|
|
20
|
+
getImporter(importerId: string): LogImporterRegistration | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Registers a new importer.
|
|
23
|
+
* @param registration - Importer registration data
|
|
24
|
+
*/
|
|
25
|
+
register(registration: LogImporterRegistration): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Attaches an orchestrator factory to a registered importer.
|
|
28
|
+
* @param importerId - Unique importer ID
|
|
29
|
+
* @param factory - Factory function for mode-specific orchestrators
|
|
30
|
+
*/
|
|
31
|
+
setOrchestratorFactory(importerId: string, factory: OrchestratorFactory): void;
|
|
32
|
+
/**
|
|
33
|
+
* Switches the import mode for a registered importer.
|
|
34
|
+
* @param importerId - Unique importer ID
|
|
35
|
+
* @param mode - Target import mode
|
|
36
|
+
*/
|
|
37
|
+
switchMode(importerId: string, mode: LogImportMode): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region packages/services/log-import/src/log-import-registry.d.ts
|
|
41
|
+
/**
|
|
42
|
+
* Registry for managing log importers and their orchestrator lifecycle.
|
|
43
|
+
*
|
|
44
|
+
* Follows the ToolRegistry pattern with key differences:
|
|
45
|
+
* - Manages orchestrators instead of toolsets
|
|
46
|
+
* - Lazy orchestrator creation (only when started)
|
|
47
|
+
* - Auto-detection via detectImporter()
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const registry = new LogImportRegistry();
|
|
51
|
+
* await registry.init();
|
|
52
|
+
*
|
|
53
|
+
* // Register an importer
|
|
54
|
+
* await registry.register({
|
|
55
|
+
* id: 'claude-code-1',
|
|
56
|
+
* adapterName: 'claude-code-cli',
|
|
57
|
+
* displayName: 'Claude Code',
|
|
58
|
+
* source: 'adapter',
|
|
59
|
+
* importer: myImporter,
|
|
60
|
+
* logFilePattern: '**\/session.jsonl',
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* // Start watching for new sessions
|
|
64
|
+
* await registry.startImporter('claude-code-1');
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
declare class LogImportRegistry implements CapabilityProviderRegistrar {
|
|
68
|
+
private readonly bus;
|
|
69
|
+
private readonly capabilityService?;
|
|
70
|
+
private readonly registrations;
|
|
71
|
+
private readonly orchestrators;
|
|
72
|
+
private readonly cleanupHandlers;
|
|
73
|
+
private initialized;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new LogImportRegistry instance.
|
|
76
|
+
* @param options - Optional configuration
|
|
77
|
+
*/
|
|
78
|
+
constructor(options?: LogImportRegistryOptions);
|
|
79
|
+
/**
|
|
80
|
+
* Initializes the registry and registers bus handlers.
|
|
81
|
+
*
|
|
82
|
+
* Registers handlers for:
|
|
83
|
+
* - listImporters: List all registered importers
|
|
84
|
+
* - scan: Scan log directory for sessions (generic handler)
|
|
85
|
+
* - uploadFiles: Process uploaded files (generic handler)
|
|
86
|
+
* - importSession: Lazy-load pick-up for discovered sessions
|
|
87
|
+
* - capability register: Auto-register adapters that publish log-import capabilities
|
|
88
|
+
*
|
|
89
|
+
* Must be called before using the registry.
|
|
90
|
+
*/
|
|
91
|
+
init(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Registers a log importer.
|
|
94
|
+
*
|
|
95
|
+
* Does not start the orchestrator automatically. Use startImporter() to begin watching.
|
|
96
|
+
* @param registration - Importer registration data
|
|
97
|
+
* @throws If an importer with the same ID is already registered
|
|
98
|
+
*/
|
|
99
|
+
register(registration: LogImporterRegistration): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Unregisters a log importer.
|
|
102
|
+
*
|
|
103
|
+
* Stops the orchestrator if running, disposes it, and removes all references.
|
|
104
|
+
* @param importerId - Unique importer ID
|
|
105
|
+
* @throws If the importer is not registered
|
|
106
|
+
*/
|
|
107
|
+
unregister(importerId: string): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Starts the orchestrator for a registered importer.
|
|
110
|
+
*
|
|
111
|
+
* Creates the orchestrator if not already created (lazy initialization).
|
|
112
|
+
* Note: Orchestrator creation requires adapter-specific factory logic,
|
|
113
|
+
* which is handled externally. This method manages the lifecycle only.
|
|
114
|
+
* @param importerId - Unique importer ID
|
|
115
|
+
* @throws If the importer is not registered or orchestrator is not provided
|
|
116
|
+
*/
|
|
117
|
+
startImporter(importerId: string): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Stops the orchestrator for a registered importer.
|
|
120
|
+
*
|
|
121
|
+
* Does nothing if the orchestrator is not running.
|
|
122
|
+
* @param importerId - Unique importer ID
|
|
123
|
+
*/
|
|
124
|
+
stopImporter(importerId: string): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Switches the orchestrator mode for a registered importer.
|
|
127
|
+
*
|
|
128
|
+
* Stops the current orchestrator (if running), disposes it, creates a new
|
|
129
|
+
* orchestrator for the requested mode via the registration's factory, and
|
|
130
|
+
* starts it. When `mode` is `'disabled'`, any running orchestrator is stopped
|
|
131
|
+
* and cleared without starting a replacement.
|
|
132
|
+
*
|
|
133
|
+
* No-op when the importer has no `orchestratorFactory` (no orchestrator
|
|
134
|
+
* classes were provided at registration time).
|
|
135
|
+
* @param importerId - Unique importer ID
|
|
136
|
+
* @param mode - Target import mode
|
|
137
|
+
* @throws If the importer is not registered
|
|
138
|
+
*/
|
|
139
|
+
switchMode(importerId: string, mode: LogImportMode): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Convenience method that starts discovery mode for a registered importer.
|
|
142
|
+
*
|
|
143
|
+
* Equivalent to calling `switchMode(id, 'discover')`. Provided as a
|
|
144
|
+
* named shorthand so call sites read as intent rather than mechanism.
|
|
145
|
+
* @param importerId - Unique importer ID
|
|
146
|
+
* @returns Promise that resolves when the discovery orchestrator has started
|
|
147
|
+
* @throws If the importer is not registered
|
|
148
|
+
*/
|
|
149
|
+
startDiscovery(importerId: string): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Attaches an orchestrator factory to a registered importer.
|
|
152
|
+
*
|
|
153
|
+
* Called by the runtime after creating orchestrator class instances so the
|
|
154
|
+
* registry can reconstruct orchestrators when the mode changes via
|
|
155
|
+
* {@link switchMode}.
|
|
156
|
+
* @param importerId - Unique importer ID
|
|
157
|
+
* @param factory - Factory function that produces orchestrators for a given mode
|
|
158
|
+
* @throws If the importer is not registered
|
|
159
|
+
*/
|
|
160
|
+
setOrchestratorFactory(importerId: string, factory: OrchestratorFactory): void;
|
|
161
|
+
/**
|
|
162
|
+
* Lists all registered importers with their current status.
|
|
163
|
+
* @returns Array of importer information
|
|
164
|
+
*/
|
|
165
|
+
listImporters(): LogImporterInfo[];
|
|
166
|
+
/**
|
|
167
|
+
* Gets a registered importer by ID.
|
|
168
|
+
* @param importerId - Unique importer ID
|
|
169
|
+
* @returns Importer registration or undefined if not found
|
|
170
|
+
*/
|
|
171
|
+
getImporter(importerId: string): LogImporterRegistration | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Gets a registered importer by adapter name.
|
|
174
|
+
* @param adapterName - Adapter name (e.g., 'claude-code-cli', 'codex-app-server')
|
|
175
|
+
* @returns Importer registration or undefined if not found
|
|
176
|
+
*/
|
|
177
|
+
getImporterByAdapterName(adapterName: string): LogImporterRegistration | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Auto-detects which importer can handle a log sample.
|
|
180
|
+
*
|
|
181
|
+
* Used during log upload to match unknown formats with compatible importers.
|
|
182
|
+
* @param sample - Sample log content (string or parsed JSON object)
|
|
183
|
+
* @returns Matching importer registration or undefined if no match
|
|
184
|
+
*/
|
|
185
|
+
detectImporter(sample: string | JsonObject): LogImporterRegistration | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Registers an orchestrator for a specific importer.
|
|
188
|
+
*
|
|
189
|
+
* This is called by adapters/extensions after they create their orchestrator instance.
|
|
190
|
+
* The registry manages the lifecycle but doesn't create orchestrators itself.
|
|
191
|
+
* @param importerId - Unique importer ID
|
|
192
|
+
* @param orchestrator - Orchestrator instance
|
|
193
|
+
* @throws If the importer is not registered
|
|
194
|
+
*/
|
|
195
|
+
registerOrchestrator(importerId: string, orchestrator: LogImportOrchestrator): Promise<void>;
|
|
196
|
+
/**
|
|
197
|
+
* Cleans up registry resources.
|
|
198
|
+
*
|
|
199
|
+
* Stops all running orchestrators and unsubscribes from bus handlers.
|
|
200
|
+
*/
|
|
201
|
+
destroy(): Promise<void>;
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region packages/services/log-import/src/types.d.ts
|
|
205
|
+
/**
|
|
206
|
+
* Factory function that creates a {@link LogImportOrchestrator} for a given mode.
|
|
207
|
+
*
|
|
208
|
+
* Returns `null` when no orchestrator is available for the requested mode
|
|
209
|
+
* (e.g., discovery requested but no `LogDiscoveryOrchestratorClass` was
|
|
210
|
+
* registered for this adapter).
|
|
211
|
+
* @param mode - Target import mode (never `'disabled'`)
|
|
212
|
+
* @returns Orchestrator instance or null if the mode requires no orchestrator
|
|
213
|
+
*/
|
|
214
|
+
type OrchestratorFactory = (mode: Exclude<LogImportMode, 'disabled'>) => LogImportOrchestrator | null;
|
|
215
|
+
/**
|
|
216
|
+
* Public provenance class for a registered log importer.
|
|
217
|
+
*/
|
|
218
|
+
type LogImporterSource = 'adapter' | 'extension';
|
|
219
|
+
/**
|
|
220
|
+
* Registration entry for a log importer.
|
|
221
|
+
*
|
|
222
|
+
* Stores metadata and references needed to manage the importer lifecycle.
|
|
223
|
+
*/
|
|
224
|
+
interface LogImporterRegistration {
|
|
225
|
+
/**
|
|
226
|
+
* Unique ID: adapterId for adapters, `package:{name}` for extensions.
|
|
227
|
+
*/
|
|
228
|
+
id: string;
|
|
229
|
+
/**
|
|
230
|
+
* Adapter name used for session lookup and provenance tracking.
|
|
231
|
+
* @example 'claude-code-cli', 'codex-app-server', 'github-copilot-sdk'
|
|
232
|
+
*/
|
|
233
|
+
adapterName: string;
|
|
234
|
+
/**
|
|
235
|
+
* Human-readable name.
|
|
236
|
+
* @example 'Claude Code', 'GitHub Copilot SDK'
|
|
237
|
+
*/
|
|
238
|
+
displayName: string;
|
|
239
|
+
/**
|
|
240
|
+
* Source type.
|
|
241
|
+
*/
|
|
242
|
+
source: LogImporterSource;
|
|
243
|
+
/**
|
|
244
|
+
* Importer instance.
|
|
245
|
+
*/
|
|
246
|
+
importer: LogImporter<unknown, unknown>;
|
|
247
|
+
/**
|
|
248
|
+
* Glob pattern for log files.
|
|
249
|
+
* @example '**\/session.jsonl'
|
|
250
|
+
*/
|
|
251
|
+
logFilePattern: string;
|
|
252
|
+
/**
|
|
253
|
+
* Whether this importer supports manual scan/import operations.
|
|
254
|
+
* Defaults to true.
|
|
255
|
+
*/
|
|
256
|
+
supportsManualImport?: boolean;
|
|
257
|
+
/**
|
|
258
|
+
* Factory for creating orchestrators for this importer.
|
|
259
|
+
*
|
|
260
|
+
* When present, the registry can swap orchestrators on mode change via
|
|
261
|
+
* {@link LogImportRegistry.switchMode}. Absent when neither
|
|
262
|
+
* `LogOrchestratorClass` nor `LogDiscoveryOrchestratorClass` was provided.
|
|
263
|
+
*/
|
|
264
|
+
orchestratorFactory?: OrchestratorFactory;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Configuration options for LogImportRegistry.
|
|
268
|
+
*/
|
|
269
|
+
interface LogImportRegistryOptions {
|
|
270
|
+
/**
|
|
271
|
+
* Message bus instance (defaults to MakaioBus).
|
|
272
|
+
*/
|
|
273
|
+
bus?: _$_makaio_bus_core0.IMakaioBus;
|
|
274
|
+
/**
|
|
275
|
+
* Capability service used to backfill providers registered before init().
|
|
276
|
+
*/
|
|
277
|
+
capabilityService?: CapabilityService;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Service instance returned by the log-import composition factory.
|
|
281
|
+
*
|
|
282
|
+
* Bundles the {@link LogImportRegistry} and the session-import handler
|
|
283
|
+
* cleanup so both are torn down together on shutdown.
|
|
284
|
+
*/
|
|
285
|
+
interface LogImportServiceInstance {
|
|
286
|
+
/** The live log-import registry. */
|
|
287
|
+
readonly registry: LogImportRegistry;
|
|
288
|
+
/** Tears down the registry and all session-import handlers. */
|
|
289
|
+
destroy(): Promise<void>;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Internal storage for orchestrator instances.
|
|
293
|
+
*/
|
|
294
|
+
interface OrchestratorEntry {
|
|
295
|
+
/**
|
|
296
|
+
* Orchestrator instance.
|
|
297
|
+
*/
|
|
298
|
+
orchestrator: LogImportOrchestrator;
|
|
299
|
+
/**
|
|
300
|
+
* Whether orchestrator was started by registry.
|
|
301
|
+
*/
|
|
302
|
+
isManaged: boolean;
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
export { OrchestratorFactory as a, OrchestratorEntry as i, LogImportServiceInstance as n, LogImportRegistry as o, LogImporterRegistration as r, LogImportRegistryOptions as t };
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { IMakaioBus } from "@makaio/framework/bus";
|
|
3
|
+
import { CliManifest } from "@makaio/framework/contracts/extension";
|
|
4
|
+
|
|
5
|
+
//#region packages/kernel/src/cli/types.d.ts
|
|
6
|
+
declare module 'zod' {
|
|
7
|
+
interface GlobalMeta {
|
|
8
|
+
/** Short flag alias for CLI options (e.g. `'-p'`, `'-f'`). */
|
|
9
|
+
short?: string;
|
|
10
|
+
/** Placeholder shown in help text (e.g. `'<name>'`, `'<path>'`). */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** When `true`, treat this field as a positional argument instead of a named option. */
|
|
13
|
+
positional?: boolean;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Injectable output channel for CLI command handlers.
|
|
18
|
+
*
|
|
19
|
+
* Handlers write to `ctx.output` instead of `process.stdout`/`process.stderr`
|
|
20
|
+
* directly. This enables output capture for remote execution via `cli.execute`
|
|
21
|
+
* and test assertions.
|
|
22
|
+
*/
|
|
23
|
+
interface OutputWriter {
|
|
24
|
+
/** Write to standard output. */
|
|
25
|
+
write(text: string): void;
|
|
26
|
+
/** Write to standard error. */
|
|
27
|
+
error(text: string): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Execution context provided to CLI command handlers.
|
|
31
|
+
* @typeParam TArgs - Inferred from the command's Zod schema via `z.infer<T>`.
|
|
32
|
+
*/
|
|
33
|
+
interface CommandContext<TArgs> {
|
|
34
|
+
/** Parsed and validated command arguments/options. */
|
|
35
|
+
readonly args: TArgs;
|
|
36
|
+
/**
|
|
37
|
+
* Bus client connected to the running Makaio instance.
|
|
38
|
+
*
|
|
39
|
+
* `null` when the bus is unavailable and the command opted into offline
|
|
40
|
+
* execution via {@link CliContribution.beforeRun}. Handlers that declared
|
|
41
|
+
* themselves runnable without the bus must check for `null` before making
|
|
42
|
+
* bus calls.
|
|
43
|
+
*/
|
|
44
|
+
readonly bus: IMakaioBus | null;
|
|
45
|
+
/** Output channel for writing to stdout/stderr. */
|
|
46
|
+
readonly output: OutputWriter;
|
|
47
|
+
/**
|
|
48
|
+
* Abort signal that is triggered when the process receives SIGINT (Ctrl-C).
|
|
49
|
+
*
|
|
50
|
+
* Long-running commands (e.g. `watch`) should honour this signal to perform
|
|
51
|
+
* clean teardown instead of relying on process termination. Short-lived
|
|
52
|
+
* commands may ignore it.
|
|
53
|
+
*
|
|
54
|
+
* Always present — contexts that cannot supply a meaningful signal must use
|
|
55
|
+
* `AbortSignal.timeout(Infinity)` or a never-aborting controller signal.
|
|
56
|
+
*/
|
|
57
|
+
readonly signal: AbortSignal;
|
|
58
|
+
/**
|
|
59
|
+
* Set the process-style exit code for the current command invocation.
|
|
60
|
+
*
|
|
61
|
+
* Local CLI execution forwards this to `process.exitCode`. Remote execution
|
|
62
|
+
* buffers it into the `cli.execute` RPC response instead of mutating the
|
|
63
|
+
* server process.
|
|
64
|
+
* @param exitCode - Command exit code to report.
|
|
65
|
+
*/
|
|
66
|
+
setExitCode(exitCode: number): void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Context provided to {@link CliContribution.beforeRun} for pre-execution
|
|
70
|
+
* gating decisions.
|
|
71
|
+
*/
|
|
72
|
+
interface BeforeRunContext {
|
|
73
|
+
/**
|
|
74
|
+
* Name of the subcommand being invoked (e.g. `'list'`, `'statusline'`).
|
|
75
|
+
*
|
|
76
|
+
* Set to {@link INTERACTIVE_SUBCOMMAND} (`'__interactive__'`) when the bare
|
|
77
|
+
* interactive invocation is dispatched.
|
|
78
|
+
*/
|
|
79
|
+
readonly subcommandName: string;
|
|
80
|
+
/** Parsed and validated arguments for the subcommand. */
|
|
81
|
+
readonly args: Record<string, unknown>;
|
|
82
|
+
/**
|
|
83
|
+
* Bus client, or `null` when the server is unreachable.
|
|
84
|
+
*
|
|
85
|
+
* Extensions that can operate without the bus inspect this to decide
|
|
86
|
+
* whether to proceed. Extensions that need a license check can use
|
|
87
|
+
* the bus (when available) to query license state.
|
|
88
|
+
*/
|
|
89
|
+
readonly bus: IMakaioBus | null;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Result of a {@link CliContribution.beforeRun} gate check.
|
|
93
|
+
*
|
|
94
|
+
* - `{ proceed: true }` — skip the default bus-required gate and run the
|
|
95
|
+
* handler. The handler receives `bus: IMakaioBus | null`.
|
|
96
|
+
* - `{ proceed: false, message, exitCode? }` — block execution and display
|
|
97
|
+
* the message. Defaults to exit code 1.
|
|
98
|
+
*/
|
|
99
|
+
type BeforeRunResult = {
|
|
100
|
+
readonly proceed: true;
|
|
101
|
+
} | {
|
|
102
|
+
readonly proceed: false;
|
|
103
|
+
readonly message: string;
|
|
104
|
+
readonly exitCode?: number;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* A single CLI subcommand with a Zod schema and strongly-typed handler.
|
|
108
|
+
*
|
|
109
|
+
* The schema defines both the data shape (for type inference) and CLI metadata
|
|
110
|
+
* (descriptions, short flags) via Zod's `.meta()` on each field.
|
|
111
|
+
* @typeParam T - A `z.ZodObject` whose shape defines the command's options/args.
|
|
112
|
+
*/
|
|
113
|
+
interface CliSubcommandDefinition<T extends z.ZodObject<z.ZodRawShape>> {
|
|
114
|
+
/** Subcommand name (e.g. `'list'`, `'switch'`). */
|
|
115
|
+
readonly name: string;
|
|
116
|
+
/** One-line description shown in help text. */
|
|
117
|
+
readonly description: string;
|
|
118
|
+
/** Zod object schema defining the command's options and arguments. */
|
|
119
|
+
readonly schema: T;
|
|
120
|
+
/** Handler invoked with the parsed, validated context. */
|
|
121
|
+
readonly handler: (ctx: CommandContext<z.infer<T>>) => Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Type-erased subcommand definition for collections.
|
|
125
|
+
*
|
|
126
|
+
* When collecting subcommands into arrays or registries, the per-schema generic
|
|
127
|
+
* is erased. The handler contract is preserved at runtime via the closure
|
|
128
|
+
* created by {@link defineCliSubcommand}.
|
|
129
|
+
*/
|
|
130
|
+
interface CliSubcommandEntry {
|
|
131
|
+
/** Subcommand name. */
|
|
132
|
+
readonly name: string;
|
|
133
|
+
/** One-line description. */
|
|
134
|
+
readonly description: string;
|
|
135
|
+
/** Zod object schema (type-erased for collection storage). */
|
|
136
|
+
readonly schema: z.ZodObject<z.ZodRawShape>;
|
|
137
|
+
/** Handler that receives a {@link CommandContext} with the schema's inferred type. */
|
|
138
|
+
readonly handler: (ctx: CommandContext<unknown>) => Promise<void>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Sentinel subcommand name passed to {@link CliContribution.beforeRun} when
|
|
142
|
+
* the bare interactive invocation (`makaio <name>`) is dispatched.
|
|
143
|
+
*/
|
|
144
|
+
declare const INTERACTIVE_SUBCOMMAND: "__interactive__";
|
|
145
|
+
/**
|
|
146
|
+
* Convenience {@link BeforeRunResult} for extensions that always proceed.
|
|
147
|
+
*
|
|
148
|
+
* Use this as the return value from {@link CliContribution.beforeRun} when
|
|
149
|
+
* the extension unconditionally opts into bus-optional execution.
|
|
150
|
+
*/
|
|
151
|
+
declare const ALWAYS_PROCEED: BeforeRunResult;
|
|
152
|
+
/**
|
|
153
|
+
* A plugin's CLI contribution, declared in its `MakaioExtension` manifest.
|
|
154
|
+
*
|
|
155
|
+
* Extends {@link CliManifest} (pure-data) with executable code: an optional
|
|
156
|
+
* interactive TUI handler and typed subcommand definitions. The CLI router
|
|
157
|
+
* uses {@link CliManifest} for discovery and help generation; this type is
|
|
158
|
+
* used when the package is loaded and ready to handle commands.
|
|
159
|
+
*
|
|
160
|
+
* The CLI router dispatches as follows:
|
|
161
|
+
* - `makaio account-manager` → {@link interactive} (if defined)
|
|
162
|
+
* - `makaio account-manager --help` → auto-generated from subcommands + schema metadata
|
|
163
|
+
* - `makaio account-manager list` → matched subcommand handler
|
|
164
|
+
*/
|
|
165
|
+
interface CliContribution extends CliManifest {
|
|
166
|
+
/**
|
|
167
|
+
* Interactive TUI launched when the command is invoked without a subcommand.
|
|
168
|
+
*
|
|
169
|
+
* When defined, bare `makaio <name>` enters this handler instead of printing
|
|
170
|
+
* help. Typically renders an Ink TUI that reuses the same bus RPC calls as
|
|
171
|
+
* the non-interactive subcommands.
|
|
172
|
+
*
|
|
173
|
+
* The bus is non-null when no {@link beforeRun} hook is defined (the default
|
|
174
|
+
* gate ensures a connected bus). When `beforeRun` opts into bus-optional
|
|
175
|
+
* execution, `bus` may be `null` — use {@link requireBus} at the top of the
|
|
176
|
+
* handler if the TUI needs bus RPC calls.
|
|
177
|
+
*/
|
|
178
|
+
readonly interactive?: (ctx: {
|
|
179
|
+
bus: IMakaioBus | null;
|
|
180
|
+
}) => Promise<void>;
|
|
181
|
+
/** Typed subcommand definitions with Zod schemas and strongly-typed handlers. */
|
|
182
|
+
readonly subcommands: ReadonlyArray<CliSubcommandEntry>;
|
|
183
|
+
/**
|
|
184
|
+
* Pre-execution gate evaluated before the default bus-required check.
|
|
185
|
+
*
|
|
186
|
+
* When provided, this hook **replaces** the default "bus must be connected"
|
|
187
|
+
* gate. The extension inspects the context (including bus availability) and
|
|
188
|
+
* decides whether execution should proceed.
|
|
189
|
+
*
|
|
190
|
+
* Use cases:
|
|
191
|
+
* - **Bus-optional commands** — extensions that can operate without the
|
|
192
|
+
* server (e.g. `claude-code-statusline`, fire-and-forget hooks).
|
|
193
|
+
* - **License gates** — paid extensions that need to verify a subscription
|
|
194
|
+
* before allowing execution.
|
|
195
|
+
*
|
|
196
|
+
* When absent, the CLI framework applies the default behavior: require a
|
|
197
|
+
* connected bus and fail with a connection error when unavailable.
|
|
198
|
+
* @param context - Subcommand name, parsed args, and bus availability.
|
|
199
|
+
* @returns Whether to proceed or block with a message.
|
|
200
|
+
*/
|
|
201
|
+
readonly beforeRun?: (context: BeforeRunContext) => BeforeRunResult | Promise<BeforeRunResult>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Assert that the bus is available and narrow the type to non-null.
|
|
205
|
+
*
|
|
206
|
+
* Handlers that require the bus (i.e. extensions without a `beforeRun` hook
|
|
207
|
+
* that permits offline execution) call this at the top of their handler to
|
|
208
|
+
* get a typed non-null bus reference. Throws if the bus is unexpectedly null
|
|
209
|
+
* — which should not happen when the default bus-required gate is active.
|
|
210
|
+
*
|
|
211
|
+
* Works with both subcommand {@link CommandContext} and interactive handler
|
|
212
|
+
* contexts — any object with a `bus` property satisfies the signature.
|
|
213
|
+
* @param ctx - Context containing a potentially null bus reference.
|
|
214
|
+
* @returns The non-null bus instance.
|
|
215
|
+
*/
|
|
216
|
+
declare function requireBus(ctx: {
|
|
217
|
+
readonly bus: IMakaioBus | null;
|
|
218
|
+
}): IMakaioBus;
|
|
219
|
+
/**
|
|
220
|
+
* Define a CLI subcommand with full type inference from schema to handler.
|
|
221
|
+
*
|
|
222
|
+
* This is an identity function whose only purpose is to create a scope where
|
|
223
|
+
* TypeScript infers `T` from `schema` and flows it into `handler`. No runtime
|
|
224
|
+
* cost. Same pattern as Vite's `defineConfig()` or Vue's `defineComponent()`.
|
|
225
|
+
* @param name - Subcommand name.
|
|
226
|
+
* @param description - One-line description for help text.
|
|
227
|
+
* @param schema - Zod object schema defining options/arguments.
|
|
228
|
+
* @param handler - Async handler receiving the typed {@link CommandContext}.
|
|
229
|
+
* @returns A {@link CliSubcommandEntry} suitable for inclusion in a {@link CliContribution}.
|
|
230
|
+
*/
|
|
231
|
+
declare function defineCliSubcommand<T extends z.ZodObject<z.ZodRawShape>>(name: string, description: string, schema: T, handler: (ctx: CommandContext<z.infer<T>>) => Promise<void>): CliSubcommandEntry;
|
|
232
|
+
//#endregion
|
|
233
|
+
export { CliSubcommandDefinition as a, INTERACTIVE_SUBCOMMAND as c, requireBus as d, CliContribution as i, OutputWriter as l, BeforeRunContext as n, CliSubcommandEntry as o, BeforeRunResult as r, CommandContext as s, ALWAYS_PROCEED as t, defineCliSubcommand as u };
|