@entelligentsia/forgecli 0.7.9 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +93 -0
- package/dist/CHANGELOG-forge-plugin.md +96 -0
- package/dist/CHANGELOG-pi.md +63 -0
- package/dist/bin/argv.d.ts +2 -2
- package/dist/bin/argv.js +22 -3
- package/dist/bin/argv.js.map +1 -1
- package/dist/bin/doctor.d.ts +59 -0
- package/dist/bin/doctor.js +149 -0
- package/dist/bin/doctor.js.map +1 -0
- package/dist/bin/env-defaults.d.ts +1 -0
- package/dist/bin/env-defaults.js +13 -0
- package/dist/bin/env-defaults.js.map +1 -0
- package/dist/bin/forge.js +22 -0
- package/dist/bin/forge.js.map +1 -1
- package/dist/bin/update-cli.d.ts +9 -0
- package/dist/bin/update-cli.js +120 -0
- package/dist/bin/update-cli.js.map +1 -0
- package/dist/extensions/forgecli/fix-bug.js +35 -110
- package/dist/extensions/forgecli/fix-bug.js.map +1 -1
- package/dist/extensions/forgecli/index.js +31 -3
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/review-command.d.ts +2 -0
- package/dist/extensions/forgecli/review-command.js +184 -0
- package/dist/extensions/forgecli/review-command.js.map +1 -0
- package/dist/extensions/forgecli/run-sprint.js +10 -0
- package/dist/extensions/forgecli/run-sprint.js.map +1 -1
- package/dist/extensions/forgecli/run-task.d.ts +1 -7
- package/dist/extensions/forgecli/run-task.js +30 -142
- package/dist/extensions/forgecli/run-task.js.map +1 -1
- package/dist/extensions/forgecli/session-registry.d.ts +68 -0
- package/dist/extensions/forgecli/session-registry.js +61 -0
- package/dist/extensions/forgecli/session-registry.js.map +1 -1
- package/dist/extensions/forgecli/thread-switcher.js +128 -9
- package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
- package/dist/extensions/forgecli/update-check.js +1 -1
- package/dist/extensions/forgecli/update-check.js.map +1 -1
- package/dist/extensions/forgecli/viewport-events.d.ts +74 -0
- package/dist/extensions/forgecli/viewport-events.js +184 -0
- package/dist/extensions/forgecli/viewport-events.js.map +1 -0
- package/dist/extensions/forgecli/viewport-renderer.d.ts +55 -0
- package/dist/extensions/forgecli/viewport-renderer.js +204 -0
- package/dist/extensions/forgecli/viewport-renderer.js.map +1 -0
- package/dist/extensions/forgecli/viewport-theme.d.ts +11 -0
- package/dist/extensions/forgecli/viewport-theme.js +124 -0
- package/dist/extensions/forgecli/viewport-theme.js.map +1 -0
- package/dist/extensions/forgecli/whats-new-widget.d.ts +5 -5
- package/dist/extensions/forgecli/whats-new-widget.js +11 -11
- package/dist/extensions/forgecli/whats-new-widget.js.map +1 -1
- package/dist/extensions/forgecli/whats-new.js +6 -5
- package/dist/extensions/forgecli/whats-new.js.map +1 -1
- package/dist/forge-payload/.base-pack/workflows/_fragments/store-cli-verbs.md +18 -2
- package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +21 -14
- package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
- package/dist/forge-payload/.tools/banners.cjs +435 -0
- package/dist/forge-payload/.tools/build-context-pack.cjs +290 -0
- package/dist/forge-payload/.tools/build-init-context.cjs +322 -0
- package/dist/forge-payload/.tools/build-overlay.cjs +326 -0
- package/dist/forge-payload/.tools/build-persona-pack.cjs +226 -0
- package/dist/forge-payload/.tools/collate.cjs +1041 -0
- package/dist/forge-payload/.tools/generation-manifest.cjs +311 -0
- package/dist/forge-payload/.tools/lib/forge-root.cjs +59 -0
- package/dist/forge-payload/.tools/lib/paths.cjs +29 -0
- package/dist/forge-payload/.tools/lib/pricing.cjs +165 -0
- package/dist/forge-payload/.tools/lib/project-root.cjs +32 -0
- package/dist/forge-payload/.tools/lib/result.js +40 -0
- package/dist/forge-payload/.tools/lib/store-facade.cjs +162 -0
- package/dist/forge-payload/.tools/lib/store-nlp.cjs +250 -0
- package/dist/forge-payload/.tools/lib/store-query-exec.cjs +272 -0
- package/dist/forge-payload/.tools/lib/validate.js +141 -0
- package/dist/forge-payload/.tools/manage-config.cjs +340 -0
- package/dist/forge-payload/.tools/manage-versions.cjs +365 -0
- package/dist/forge-payload/.tools/package.json +3 -0
- package/dist/forge-payload/.tools/parse-gates.cjs +151 -0
- package/dist/forge-payload/.tools/parse-verdict.cjs +67 -0
- package/dist/forge-payload/.tools/preflight-gate.cjs +350 -0
- package/dist/forge-payload/.tools/prompts/sprint-plan-prompt.md +70 -0
- package/dist/forge-payload/.tools/schemas/task-list.schema.json +53 -0
- package/dist/forge-payload/.tools/seed-store.cjs +237 -0
- package/dist/forge-payload/.tools/store-cli.cjs +1226 -0
- package/dist/forge-payload/.tools/store-query.cjs +319 -0
- package/dist/forge-payload/.tools/store.cjs +315 -0
- package/dist/forge-payload/.tools/substitute-placeholders.cjs +625 -0
- package/dist/forge-payload/.tools/validate-store.cjs +593 -0
- package/dist/forge-payload/skills/refresh-kb-links/SKILL.md +217 -0
- package/dist/forge-payload/skills/store-custodian/SKILL.md +163 -0
- package/dist/forge-payload/skills/store-query-grammar/SKILL.md +145 -0
- package/dist/forge-payload/skills/store-query-nlp/SKILL.md +110 -0
- package/dist/forge-payload/tools/lib/suggest.cjs +211 -0
- package/dist/forge-payload/tools/lib/validate.js +12 -2
- package/dist/forge-payload/tools/store-cli.cjs +192 -18
- package/dist/forge-payload/tools/validate-store.cjs +22 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/endpointResolver.js +2 -2
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +9 -13
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.browser.js +5 -5
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.js +2 -3
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntimeClient.js +1 -4
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/BedrockRuntimeClient.d.ts +1 -2
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/BedrockRuntimeClient.d.ts +5 -7
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +11 -19
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +4 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +595 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +715 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +588 -0
- package/node_modules/@aws-sdk/core/dist-es/index.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.browser.js +36 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +26 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.native.js +37 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.js +3 -0
- package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/check-features.js +1 -1
- package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/user-agent-middleware.js +1 -1
- package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/partition.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.browser.js +1 -0
- package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.js +1 -1
- package/node_modules/@aws-sdk/core/dist-types/api-extractor-type-index.d.ts +3 -2
- package/node_modules/@aws-sdk/core/dist-types/index.d.ts +12 -14
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.browser.d.ts +47 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +38 -4
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.native.d.ts +48 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -0
- package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types → core/dist-types/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +0 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +65 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +116 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +123 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +116 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +647 -0
- package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +27 -8
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-websocket/package.json +5 -5
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +13 -20
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +14 -21
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/CognitoIdentityClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js +1 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentityClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/SigninClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/SSOClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/SSOOIDCClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/STSClient.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +6 -14
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
- package/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +27 -98
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +62 -132
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +25 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +8 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +63 -0
- package/node_modules/@earendil-works/pi-coding-agent/README.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js +6 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +12 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +30 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +23 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +58 -38
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +3 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +60 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -3
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/index.d.ts +7 -7
- package/node_modules/@protobufjs/fetch/index.js +4 -7
- package/node_modules/@protobufjs/fetch/package.json +7 -5
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +150 -8
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/index.d.ts +1 -0
- package/node_modules/@protobufjs/inquire/index.js +1 -0
- package/node_modules/@protobufjs/inquire/package.json +1 -1
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@smithy/signature-v4/package.json +3 -3
- package/node_modules/@smithy/types/README.md +3 -3
- package/node_modules/@smithy/types/dist-types/abort.d.ts +4 -6
- package/node_modules/@smithy/types/dist-types/auth/auth.d.ts +6 -4
- package/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +7 -10
- package/node_modules/@smithy/types/dist-types/checksum.d.ts +4 -6
- package/node_modules/@smithy/types/dist-types/client.d.ts +8 -8
- package/node_modules/@smithy/types/dist-types/command.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/crypto.d.ts +6 -8
- package/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +6 -7
- package/node_modules/@smithy/types/dist-types/eventStream.d.ts +10 -10
- package/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +9 -10
- package/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +10 -10
- package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/http.d.ts +18 -21
- package/node_modules/@smithy/types/dist-types/logger.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/middleware.d.ts +28 -27
- package/node_modules/@smithy/types/dist-types/pagination.d.ts +4 -4
- package/node_modules/@smithy/types/dist-types/serde.d.ts +10 -10
- package/node_modules/@smithy/types/dist-types/shapes.d.ts +9 -12
- package/node_modules/@smithy/types/dist-types/signature.d.ts +4 -4
- package/node_modules/@smithy/types/dist-types/stream.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +7 -11
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +23 -29
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +9 -19
- package/node_modules/@smithy/types/dist-types/transfer.d.ts +2 -1
- package/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +4 -4
- package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +14 -18
- package/node_modules/@smithy/types/dist-types/transform/exact.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +12 -12
- package/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +14 -9
- package/node_modules/@smithy/types/dist-types/uri.d.ts +2 -2
- package/node_modules/@smithy/types/dist-types/util.d.ts +28 -28
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/fast-xml-parser/CHANGELOG.md +7 -0
- package/node_modules/fast-xml-parser/README.md +0 -3
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
- package/node_modules/fast-xml-parser/package.json +2 -4
- package/node_modules/fast-xml-parser/src/fxp.d.ts +1 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +1 -1
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +4 -0
- package/node_modules/protobufjs/dist/light/protobuf.js +187 -153
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +14 -5
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +207 -173
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +6 -3
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/minimal.js +10 -2
- package/node_modules/protobufjs/src/util.js +1 -1
- package/node_modules/undici/README.md +14 -5
- package/node_modules/undici/docs/docs/api/Client.md +4 -2
- package/node_modules/undici/docs/docs/api/Dispatcher.md +62 -27
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +7 -5
- package/node_modules/undici/docs/docs/api/H2CClient.md +1 -1
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +14 -9
- package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -1
- package/node_modules/undici/docs/docs/api/RetryHandler.md +12 -14
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +23 -0
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +231 -0
- package/node_modules/undici/index.js +4 -2
- package/node_modules/undici/lib/api/api-connect.js +13 -11
- package/node_modules/undici/lib/api/api-pipeline.js +26 -13
- package/node_modules/undici/lib/api/api-request.js +45 -21
- package/node_modules/undici/lib/api/api-stream.js +81 -20
- package/node_modules/undici/lib/api/api-upgrade.js +21 -11
- package/node_modules/undici/lib/api/readable.js +3 -2
- package/node_modules/undici/lib/cache/memory-cache-store.js +1 -1
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +6 -4
- package/node_modules/undici/lib/core/connect.js +17 -1
- package/node_modules/undici/lib/core/constants.js +1 -24
- package/node_modules/undici/lib/core/errors.js +2 -2
- package/node_modules/undici/lib/core/request.js +115 -18
- package/node_modules/undici/lib/core/socks5-client.js +24 -9
- package/node_modules/undici/lib/core/socks5-utils.js +32 -23
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/core/util.js +70 -43
- package/node_modules/undici/lib/dispatcher/agent.js +47 -33
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +21 -26
- package/node_modules/undici/lib/dispatcher/client-h1.js +98 -39
- package/node_modules/undici/lib/dispatcher/client-h2.js +603 -272
- package/node_modules/undici/lib/dispatcher/client.js +12 -5
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +24 -5
- package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -4
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +107 -0
- package/node_modules/undici/lib/dispatcher/h2c-client.js +5 -5
- package/node_modules/undici/lib/dispatcher/pool-base.js +28 -10
- package/node_modules/undici/lib/dispatcher/pool.js +31 -6
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +38 -13
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +31 -9
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +95 -80
- package/node_modules/undici/lib/global.js +13 -1
- package/node_modules/undici/lib/handler/cache-handler.js +16 -8
- package/node_modules/undici/lib/handler/decorator-handler.js +1 -2
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -51
- package/node_modules/undici/lib/handler/retry-handler.js +15 -2
- package/node_modules/undici/lib/interceptor/cache.js +30 -17
- package/node_modules/undici/lib/interceptor/decompress.js +28 -2
- package/node_modules/undici/lib/interceptor/dns.js +1 -1
- package/node_modules/undici/lib/interceptor/redirect.js +3 -3
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -1
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -1
- package/node_modules/undici/lib/mock/mock-agent.js +8 -8
- package/node_modules/undici/lib/mock/mock-call-history.js +15 -15
- package/node_modules/undici/lib/mock/mock-utils.js +37 -22
- package/node_modules/undici/lib/mock/snapshot-agent.js +16 -6
- package/node_modules/undici/lib/mock/snapshot-recorder.js +38 -3
- package/node_modules/undici/lib/util/cache.js +8 -7
- package/node_modules/undici/lib/util/runtime-features.js +3 -34
- package/node_modules/undici/lib/web/cache/cache.js +6 -8
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/fetch/body.js +3 -9
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +17 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +21 -2
- package/node_modules/undici/lib/web/fetch/index.js +214 -221
- package/node_modules/undici/lib/web/webidl/index.js +7 -9
- package/node_modules/undici/lib/web/websocket/frame.js +1 -7
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +13 -31
- package/node_modules/undici/lib/web/websocket/receiver.js +62 -22
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +11 -17
- package/node_modules/undici/lib/web/websocket/websocket.js +6 -1
- package/node_modules/undici/package.json +9 -9
- package/node_modules/undici/types/agent.d.ts +0 -2
- package/node_modules/undici/types/client.d.ts +25 -19
- package/node_modules/undici/types/dispatcher.d.ts +7 -27
- package/node_modules/undici/types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici/types/formdata.d.ts +0 -6
- package/node_modules/undici/types/h2c-client.d.ts +6 -6
- package/node_modules/undici/types/header.d.ts +5 -0
- package/node_modules/undici/types/index.d.ts +3 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/pool.d.ts +0 -2
- package/node_modules/undici/types/proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici/types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/webidl.d.ts +0 -1
- package/package.json +8 -9
- package/node_modules/@aws-sdk/middleware-host-header/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-host-header/README.md +0 -4
- package/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js +0 -41
- package/node_modules/@aws-sdk/middleware-host-header/package.json +0 -59
- package/node_modules/@aws-sdk/middleware-logger/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-logger/README.md +0 -4
- package/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js +0 -48
- package/node_modules/@aws-sdk/middleware-logger/dist-es/index.js +0 -1
- package/node_modules/@aws-sdk/middleware-logger/dist-types/index.d.ts +0 -1
- package/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/index.d.ts +0 -1
- package/node_modules/@aws-sdk/middleware-logger/package.json +0 -59
- package/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-recursion-detection/README.md +0 -17
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +0 -29
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.browser.js +0 -5
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js +0 -33
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.native.js +0 -5
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js +0 -2
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +0 -66
- package/node_modules/@aws-sdk/middleware-user-agent/LICENSE +0 -201
- package/node_modules/@aws-sdk/middleware-user-agent/README.md +0 -4
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +0 -194
- package/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js +0 -2
- package/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts +0 -2
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +0 -61
- package/node_modules/@aws-sdk/region-config-resolver/LICENSE +0 -201
- package/node_modules/@aws-sdk/region-config-resolver/README.md +0 -19
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js +0 -38
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.browser.js +0 -6
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js +0 -19
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.native.js +0 -6
- package/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js +0 -3
- package/node_modules/@aws-sdk/region-config-resolver/dist-types/index.d.ts +0 -3
- package/node_modules/@aws-sdk/region-config-resolver/dist-types/ts3.4/index.d.ts +0 -3
- package/node_modules/@aws-sdk/region-config-resolver/package.json +0 -64
- package/node_modules/@aws-sdk/util-endpoints/LICENSE +0 -201
- package/node_modules/@aws-sdk/util-endpoints/README.md +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +0 -406
- package/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json +0 -267
- package/node_modules/@aws-sdk/util-endpoints/dist-es/index.js +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js +0 -3
- package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json +0 -267
- package/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts +0 -3
- package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts +0 -3
- package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts +0 -6
- package/node_modules/@aws-sdk/util-endpoints/package.json +0 -59
- package/node_modules/@aws-sdk/util-user-agent-browser/LICENSE +0 -201
- package/node_modules/@aws-sdk/util-user-agent-browser/README.md +0 -29
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/createUserAgentStringParsingProvider.js +0 -24
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.browser.js +0 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js +0 -61
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js +0 -22
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.browser.js +0 -1
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.browser.d.ts +0 -1
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.browser.d.ts +0 -1
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +0 -60
- package/node_modules/@aws-sdk/util-user-agent-node/LICENSE +0 -201
- package/node_modules/@aws-sdk/util-user-agent-node/README.md +0 -17
- package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +0 -185
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js +0 -2
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/index.d.ts +0 -2
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/index.d.ts +0 -2
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +0 -68
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +0 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts +0 -20
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +0 -92
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts +0 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +0 -42
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts +0 -10
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +0 -31
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts +0 -30
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +0 -170
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts +0 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +0 -90
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js.map +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +0 -92
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +0 -31
- package/node_modules/undici/lib/handler/unwrap-handler.js +0 -100
- package/node_modules/undici/lib/handler/wrap-handler.js +0 -105
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/util/promise.js +0 -28
- package/skills/.gitkeep +0 -0
- /package/node_modules/@aws-sdk/{middleware-host-header/dist-es/index.js → core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js} +0 -0
- /package/node_modules/@aws-sdk/{middleware-logger/dist-es → core/dist-es/submodules/client/middleware-logger}/loggerMiddleware.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/configuration.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/getRecursionDetectionPlugin.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/configurations.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/constants.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/encode-features.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/awsRegionConfig.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/extensions/index.js → core/dist-es/submodules/client/region-config-resolver/extensions.js} +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.js +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/aws.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/parseArn.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/isIpAddress.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/resolveEndpoint.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/EndpointError.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/EndpointRuleObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/ErrorRuleObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/RuleSetObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/TreeRuleObject.js +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/shared.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/configurations.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.native.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.native.js} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/crt-availability.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/defaultUserAgent.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.js +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/is-crt-available.js +0 -0
- /package/node_modules/@aws-sdk/{middleware-host-header/dist-types/index.d.ts → core/dist-types/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-logger/dist-types → core/dist-types/submodules/client/middleware-logger}/loggerMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/configuration.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/getRecursionDetectionPlugin.d.ts → core/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/check-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/constants.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/encode-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/user-agent-middleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/awsRegionConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/extensions/index.d.ts → core/dist-types/submodules/client/region-config-resolver/extensions.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/aws.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/parseArn.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/partition.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/isIpAddress.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/resolveEndpoint.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/EndpointError.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/EndpointRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/ErrorRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/RuleSetObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/TreeRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/shared.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types → core/dist-types/submodules/client/util-user-agent-browser}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/index.d.ts → core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/index.native.d.ts → core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/crt-availability.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/defaultUserAgent.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/is-crt-available.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-host-header/dist-types/ts3.4/index.d.ts → core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-logger/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-logger}/loggerMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/configuration.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4/getRecursionDetectionPlugin.d.ts → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/check-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/constants.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/encode-features.d.ts +0 -0
- /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/user-agent-middleware.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/awsRegionConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/extensions/index.d.ts → core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.d.ts +0 -0
- /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/aws.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/parseArn.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/partition.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/isIpAddress.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/resolveEndpoint.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/EndpointError.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/EndpointRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/ErrorRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/RuleSetObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/TreeRuleObject.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/shared.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-browser}/configurations.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4/index.d.ts → core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4/index.native.d.ts → core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts} +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/crt-availability.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/defaultUserAgent.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/is-crt-available.d.ts +0 -0
- /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.d.ts +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { JsonlSessionCreateOptions, JsonlSessionListOptions, JsonlSessionMetadata, JsonlSessionRepoApi, Session } from "../../types.js";
|
|
2
|
-
export declare class JsonlSessionRepo implements JsonlSessionRepoApi {
|
|
3
|
-
private sessionsRoot;
|
|
4
|
-
constructor(options: {
|
|
5
|
-
sessionsRoot: string;
|
|
6
|
-
});
|
|
7
|
-
private getSessionDir;
|
|
8
|
-
private createSessionFilePath;
|
|
9
|
-
create(options: JsonlSessionCreateOptions): Promise<Session<JsonlSessionMetadata>>;
|
|
10
|
-
open(metadata: JsonlSessionMetadata): Promise<Session<JsonlSessionMetadata>>;
|
|
11
|
-
list(options?: JsonlSessionListOptions): Promise<JsonlSessionMetadata[]>;
|
|
12
|
-
delete(metadata: JsonlSessionMetadata): Promise<void>;
|
|
13
|
-
fork(sourceMetadata: JsonlSessionMetadata, options: JsonlSessionCreateOptions & {
|
|
14
|
-
entryId?: string;
|
|
15
|
-
position?: "before" | "at";
|
|
16
|
-
id?: string;
|
|
17
|
-
}): Promise<Session<JsonlSessionMetadata>>;
|
|
18
|
-
private listSessionDirs;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=jsonl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/repo/jsonl.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,EACP,MAAM,gBAAgB,CAAC;AAiBxB,qBAAa,gBAAiB,YAAW,mBAAmB;IAC3D,OAAO,CAAC,YAAY,CAAS;IAE7B,YAAY,OAAO,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,EAE5C;IAED,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,qBAAqB;IAIvB,MAAM,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAWvF;IAEK,IAAI,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAMjF;IAEK,IAAI,CAAC,OAAO,GAAE,uBAA4B,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAgBjF;IAEK,MAAM,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;IAEK,IAAI,CACT,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,yBAAyB,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAChG,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAcxC;YAEa,eAAe;CAK7B","sourcesContent":["import { constants } from \"node:fs\";\nimport { access, mkdir, readdir, rm } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport type {\n\tJsonlSessionCreateOptions,\n\tJsonlSessionListOptions,\n\tJsonlSessionMetadata,\n\tJsonlSessionRepoApi,\n\tSession,\n} from \"../../types.js\";\nimport { JsonlSessionStorage, loadJsonlSessionMetadata } from \"../storage/jsonl.js\";\nimport { createSessionId, createTimestamp, getEntriesToFork, toSession } from \"./shared.js\";\n\nasync function exists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path, constants.F_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction encodeCwd(cwd: string): string {\n\treturn `--${cwd.replace(/^[/\\\\]/, \"\").replace(/[/\\\\:]/g, \"-\")}--`;\n}\n\nexport class JsonlSessionRepo implements JsonlSessionRepoApi {\n\tprivate sessionsRoot: string;\n\n\tconstructor(options: { sessionsRoot: string }) {\n\t\tthis.sessionsRoot = resolve(options.sessionsRoot);\n\t}\n\n\tprivate getSessionDir(cwd: string): string {\n\t\treturn join(this.sessionsRoot, encodeCwd(cwd));\n\t}\n\n\tprivate createSessionFilePath(cwd: string, sessionId: string, timestamp: string): string {\n\t\treturn join(this.getSessionDir(cwd), `${timestamp.replace(/[:.]/g, \"-\")}_${sessionId}.jsonl`);\n\t}\n\n\tasync create(options: JsonlSessionCreateOptions): Promise<Session<JsonlSessionMetadata>> {\n\t\tawait mkdir(this.sessionsRoot, { recursive: true });\n\t\tconst id = options.id ?? createSessionId();\n\t\tconst createdAt = createTimestamp();\n\t\tconst filePath = this.createSessionFilePath(options.cwd, id, createdAt);\n\t\tconst storage = await JsonlSessionStorage.create(filePath, {\n\t\t\tcwd: options.cwd,\n\t\t\tsessionId: id,\n\t\t\tparentSessionPath: options.parentSessionPath,\n\t\t});\n\t\treturn toSession(storage);\n\t}\n\n\tasync open(metadata: JsonlSessionMetadata): Promise<Session<JsonlSessionMetadata>> {\n\t\tif (!(await exists(metadata.path))) {\n\t\t\tthrow new Error(`Session not found: ${metadata.path}`);\n\t\t}\n\t\tconst storage = await JsonlSessionStorage.open(metadata.path);\n\t\treturn toSession(storage);\n\t}\n\n\tasync list(options: JsonlSessionListOptions = {}): Promise<JsonlSessionMetadata[]> {\n\t\tconst dirs = options.cwd ? [this.getSessionDir(options.cwd)] : await this.listSessionDirs();\n\t\tconst sessions: JsonlSessionMetadata[] = [];\n\t\tfor (const dir of dirs) {\n\t\t\tif (!(await exists(dir))) continue;\n\t\t\tconst files = (await readdir(dir)).filter((file) => file.endsWith(\".jsonl\")).map((file) => join(dir, file));\n\t\t\tfor (const filePath of files) {\n\t\t\t\ttry {\n\t\t\t\t\tsessions.push(await loadJsonlSessionMetadata(filePath));\n\t\t\t\t} catch {\n\t\t\t\t\t// Ignore invalid session files when listing a directory.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsessions.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());\n\t\treturn sessions;\n\t}\n\n\tasync delete(metadata: JsonlSessionMetadata): Promise<void> {\n\t\tawait rm(metadata.path, { force: true });\n\t}\n\n\tasync fork(\n\t\tsourceMetadata: JsonlSessionMetadata,\n\t\toptions: JsonlSessionCreateOptions & { entryId?: string; position?: \"before\" | \"at\"; id?: string },\n\t): Promise<Session<JsonlSessionMetadata>> {\n\t\tconst source = await this.open(sourceMetadata);\n\t\tconst forkedEntries = await getEntriesToFork(source.getStorage(), options);\n\t\tconst id = options.id ?? createSessionId();\n\t\tconst createdAt = createTimestamp();\n\t\tconst storage = await JsonlSessionStorage.create(this.createSessionFilePath(options.cwd, id, createdAt), {\n\t\t\tcwd: options.cwd,\n\t\t\tsessionId: id,\n\t\t\tparentSessionPath: options.parentSessionPath ?? sourceMetadata.path,\n\t\t});\n\t\tfor (const entry of forkedEntries) {\n\t\t\tawait storage.appendEntry(entry);\n\t\t}\n\t\treturn toSession(storage);\n\t}\n\n\tprivate async listSessionDirs(): Promise<string[]> {\n\t\tif (!(await exists(this.sessionsRoot))) return [];\n\t\tconst entries = await readdir(this.sessionsRoot, { withFileTypes: true });\n\t\treturn entries.filter((entry) => entry.isDirectory()).map((entry) => join(this.sessionsRoot, entry.name));\n\t}\n}\n"]}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { constants } from "node:fs";
|
|
2
|
-
import { access, mkdir, readdir, rm } from "node:fs/promises";
|
|
3
|
-
import { join, resolve } from "node:path";
|
|
4
|
-
import { JsonlSessionStorage, loadJsonlSessionMetadata } from "../storage/jsonl.js";
|
|
5
|
-
import { createSessionId, createTimestamp, getEntriesToFork, toSession } from "./shared.js";
|
|
6
|
-
async function exists(path) {
|
|
7
|
-
try {
|
|
8
|
-
await access(path, constants.F_OK);
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function encodeCwd(cwd) {
|
|
16
|
-
return `--${cwd.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
|
|
17
|
-
}
|
|
18
|
-
export class JsonlSessionRepo {
|
|
19
|
-
sessionsRoot;
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.sessionsRoot = resolve(options.sessionsRoot);
|
|
22
|
-
}
|
|
23
|
-
getSessionDir(cwd) {
|
|
24
|
-
return join(this.sessionsRoot, encodeCwd(cwd));
|
|
25
|
-
}
|
|
26
|
-
createSessionFilePath(cwd, sessionId, timestamp) {
|
|
27
|
-
return join(this.getSessionDir(cwd), `${timestamp.replace(/[:.]/g, "-")}_${sessionId}.jsonl`);
|
|
28
|
-
}
|
|
29
|
-
async create(options) {
|
|
30
|
-
await mkdir(this.sessionsRoot, { recursive: true });
|
|
31
|
-
const id = options.id ?? createSessionId();
|
|
32
|
-
const createdAt = createTimestamp();
|
|
33
|
-
const filePath = this.createSessionFilePath(options.cwd, id, createdAt);
|
|
34
|
-
const storage = await JsonlSessionStorage.create(filePath, {
|
|
35
|
-
cwd: options.cwd,
|
|
36
|
-
sessionId: id,
|
|
37
|
-
parentSessionPath: options.parentSessionPath,
|
|
38
|
-
});
|
|
39
|
-
return toSession(storage);
|
|
40
|
-
}
|
|
41
|
-
async open(metadata) {
|
|
42
|
-
if (!(await exists(metadata.path))) {
|
|
43
|
-
throw new Error(`Session not found: ${metadata.path}`);
|
|
44
|
-
}
|
|
45
|
-
const storage = await JsonlSessionStorage.open(metadata.path);
|
|
46
|
-
return toSession(storage);
|
|
47
|
-
}
|
|
48
|
-
async list(options = {}) {
|
|
49
|
-
const dirs = options.cwd ? [this.getSessionDir(options.cwd)] : await this.listSessionDirs();
|
|
50
|
-
const sessions = [];
|
|
51
|
-
for (const dir of dirs) {
|
|
52
|
-
if (!(await exists(dir)))
|
|
53
|
-
continue;
|
|
54
|
-
const files = (await readdir(dir)).filter((file) => file.endsWith(".jsonl")).map((file) => join(dir, file));
|
|
55
|
-
for (const filePath of files) {
|
|
56
|
-
try {
|
|
57
|
-
sessions.push(await loadJsonlSessionMetadata(filePath));
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
// Ignore invalid session files when listing a directory.
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
sessions.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
65
|
-
return sessions;
|
|
66
|
-
}
|
|
67
|
-
async delete(metadata) {
|
|
68
|
-
await rm(metadata.path, { force: true });
|
|
69
|
-
}
|
|
70
|
-
async fork(sourceMetadata, options) {
|
|
71
|
-
const source = await this.open(sourceMetadata);
|
|
72
|
-
const forkedEntries = await getEntriesToFork(source.getStorage(), options);
|
|
73
|
-
const id = options.id ?? createSessionId();
|
|
74
|
-
const createdAt = createTimestamp();
|
|
75
|
-
const storage = await JsonlSessionStorage.create(this.createSessionFilePath(options.cwd, id, createdAt), {
|
|
76
|
-
cwd: options.cwd,
|
|
77
|
-
sessionId: id,
|
|
78
|
-
parentSessionPath: options.parentSessionPath ?? sourceMetadata.path,
|
|
79
|
-
});
|
|
80
|
-
for (const entry of forkedEntries) {
|
|
81
|
-
await storage.appendEntry(entry);
|
|
82
|
-
}
|
|
83
|
-
return toSession(storage);
|
|
84
|
-
}
|
|
85
|
-
async listSessionDirs() {
|
|
86
|
-
if (!(await exists(this.sessionsRoot)))
|
|
87
|
-
return [];
|
|
88
|
-
const entries = await readdir(this.sessionsRoot, { withFileTypes: true });
|
|
89
|
-
return entries.filter((entry) => entry.isDirectory()).map((entry) => join(this.sessionsRoot, entry.name));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=jsonl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../../../src/harness/session/repo/jsonl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM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AAO,CAAC,EAAE,IAAI,eAAe,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE;YACxG,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,SAAS,EAAE,EAAE;YACb,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,cAAc,CAAC,IAAI;SACnE,CAAC,CAAC;QACH,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;YACnC,MAAM,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAAA,CAC1B;IAEO,KAAK,CAAC,eAAe,GAAsB;QAClD,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAAE,OAAO,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1E,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAAA,CAC1G;CACD","sourcesContent":["import { constants } from \"node:fs\";\nimport { access, mkdir, readdir, rm } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport type {\n\tJsonlSessionCreateOptions,\n\tJsonlSessionListOptions,\n\tJsonlSessionMetadata,\n\tJsonlSessionRepoApi,\n\tSession,\n} from \"../../types.js\";\nimport { JsonlSessionStorage, loadJsonlSessionMetadata } from \"../storage/jsonl.js\";\nimport { createSessionId, createTimestamp, getEntriesToFork, toSession } from \"./shared.js\";\n\nasync function exists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path, constants.F_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction encodeCwd(cwd: string): string {\n\treturn `--${cwd.replace(/^[/\\\\]/, \"\").replace(/[/\\\\:]/g, \"-\")}--`;\n}\n\nexport class JsonlSessionRepo implements JsonlSessionRepoApi {\n\tprivate sessionsRoot: string;\n\n\tconstructor(options: { sessionsRoot: string }) {\n\t\tthis.sessionsRoot = resolve(options.sessionsRoot);\n\t}\n\n\tprivate getSessionDir(cwd: string): string {\n\t\treturn join(this.sessionsRoot, encodeCwd(cwd));\n\t}\n\n\tprivate createSessionFilePath(cwd: string, sessionId: string, timestamp: string): string {\n\t\treturn join(this.getSessionDir(cwd), `${timestamp.replace(/[:.]/g, \"-\")}_${sessionId}.jsonl`);\n\t}\n\n\tasync create(options: JsonlSessionCreateOptions): Promise<Session<JsonlSessionMetadata>> {\n\t\tawait mkdir(this.sessionsRoot, { recursive: true });\n\t\tconst id = options.id ?? createSessionId();\n\t\tconst createdAt = createTimestamp();\n\t\tconst filePath = this.createSessionFilePath(options.cwd, id, createdAt);\n\t\tconst storage = await JsonlSessionStorage.create(filePath, {\n\t\t\tcwd: options.cwd,\n\t\t\tsessionId: id,\n\t\t\tparentSessionPath: options.parentSessionPath,\n\t\t});\n\t\treturn toSession(storage);\n\t}\n\n\tasync open(metadata: JsonlSessionMetadata): Promise<Session<JsonlSessionMetadata>> {\n\t\tif (!(await exists(metadata.path))) {\n\t\t\tthrow new Error(`Session not found: ${metadata.path}`);\n\t\t}\n\t\tconst storage = await JsonlSessionStorage.open(metadata.path);\n\t\treturn toSession(storage);\n\t}\n\n\tasync list(options: JsonlSessionListOptions = {}): Promise<JsonlSessionMetadata[]> {\n\t\tconst dirs = options.cwd ? [this.getSessionDir(options.cwd)] : await this.listSessionDirs();\n\t\tconst sessions: JsonlSessionMetadata[] = [];\n\t\tfor (const dir of dirs) {\n\t\t\tif (!(await exists(dir))) continue;\n\t\t\tconst files = (await readdir(dir)).filter((file) => file.endsWith(\".jsonl\")).map((file) => join(dir, file));\n\t\t\tfor (const filePath of files) {\n\t\t\t\ttry {\n\t\t\t\t\tsessions.push(await loadJsonlSessionMetadata(filePath));\n\t\t\t\t} catch {\n\t\t\t\t\t// Ignore invalid session files when listing a directory.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsessions.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());\n\t\treturn sessions;\n\t}\n\n\tasync delete(metadata: JsonlSessionMetadata): Promise<void> {\n\t\tawait rm(metadata.path, { force: true });\n\t}\n\n\tasync fork(\n\t\tsourceMetadata: JsonlSessionMetadata,\n\t\toptions: JsonlSessionCreateOptions & { entryId?: string; position?: \"before\" | \"at\"; id?: string },\n\t): Promise<Session<JsonlSessionMetadata>> {\n\t\tconst source = await this.open(sourceMetadata);\n\t\tconst forkedEntries = await getEntriesToFork(source.getStorage(), options);\n\t\tconst id = options.id ?? createSessionId();\n\t\tconst createdAt = createTimestamp();\n\t\tconst storage = await JsonlSessionStorage.create(this.createSessionFilePath(options.cwd, id, createdAt), {\n\t\t\tcwd: options.cwd,\n\t\t\tsessionId: id,\n\t\t\tparentSessionPath: options.parentSessionPath ?? sourceMetadata.path,\n\t\t});\n\t\tfor (const entry of forkedEntries) {\n\t\t\tawait storage.appendEntry(entry);\n\t\t}\n\t\treturn toSession(storage);\n\t}\n\n\tprivate async listSessionDirs(): Promise<string[]> {\n\t\tif (!(await exists(this.sessionsRoot))) return [];\n\t\tconst entries = await readdir(this.sessionsRoot, { withFileTypes: true });\n\t\treturn entries.filter((entry) => entry.isDirectory()).map((entry) => join(this.sessionsRoot, entry.name));\n\t}\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Session, SessionMetadata, SessionRepo } from "../../types.js";
|
|
2
|
-
export declare class InMemorySessionRepo implements SessionRepo<SessionMetadata, {
|
|
3
|
-
id?: string;
|
|
4
|
-
}, void> {
|
|
5
|
-
private sessions;
|
|
6
|
-
create(options?: {
|
|
7
|
-
id?: string;
|
|
8
|
-
}): Promise<Session<SessionMetadata>>;
|
|
9
|
-
open(metadata: SessionMetadata): Promise<Session<SessionMetadata>>;
|
|
10
|
-
list(): Promise<SessionMetadata[]>;
|
|
11
|
-
delete(metadata: SessionMetadata): Promise<void>;
|
|
12
|
-
fork(sourceMetadata: SessionMetadata, options: {
|
|
13
|
-
entryId?: string;
|
|
14
|
-
position?: "before" | "at";
|
|
15
|
-
id?: string;
|
|
16
|
-
}): Promise<Session<SessionMetadata>>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=memory.d.ts.map
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/repo/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI5E,qBAAa,mBAAoB,YAAW,WAAW,CAAC,eAAe,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,CAAC;IAC9F,OAAO,CAAC,QAAQ,CAA+C;IAEzD,MAAM,CAAC,OAAO,GAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAS7E;IAEK,IAAI,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAMvE;IAEK,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAEvC;IAEK,MAAM,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD;IAEK,IAAI,CACT,cAAc,EAAE,eAAe,EAC/B,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GACpE,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAYnC;CACD","sourcesContent":["import type { Session, SessionMetadata, SessionRepo } from \"../../types.js\";\nimport { InMemorySessionStorage } from \"../storage/memory.js\";\nimport { createSessionId, createTimestamp, getEntriesToFork, toSession } from \"./shared.js\";\n\nexport class InMemorySessionRepo implements SessionRepo<SessionMetadata, { id?: string }, void> {\n\tprivate sessions = new Map<string, Session<SessionMetadata>>();\n\n\tasync create(options: { id?: string } = {}): Promise<Session<SessionMetadata>> {\n\t\tconst metadata: SessionMetadata = {\n\t\t\tid: options.id ?? createSessionId(),\n\t\t\tcreatedAt: createTimestamp(),\n\t\t};\n\t\tconst storage = new InMemorySessionStorage({ metadata });\n\t\tconst session = toSession(storage);\n\t\tthis.sessions.set(metadata.id, session);\n\t\treturn session;\n\t}\n\n\tasync open(metadata: SessionMetadata): Promise<Session<SessionMetadata>> {\n\t\tconst session = this.sessions.get(metadata.id);\n\t\tif (!session) {\n\t\t\tthrow new Error(`Session not found: ${metadata.id}`);\n\t\t}\n\t\treturn session;\n\t}\n\n\tasync list(): Promise<SessionMetadata[]> {\n\t\treturn Promise.all([...this.sessions.values()].map((session) => session.getMetadata()));\n\t}\n\n\tasync delete(metadata: SessionMetadata): Promise<void> {\n\t\tthis.sessions.delete(metadata.id);\n\t}\n\n\tasync fork(\n\t\tsourceMetadata: SessionMetadata,\n\t\toptions: { entryId?: string; position?: \"before\" | \"at\"; id?: string },\n\t): Promise<Session<SessionMetadata>> {\n\t\tconst source = await this.open(sourceMetadata);\n\t\tconst forkedEntries = await getEntriesToFork(source.getStorage(), options);\n\t\tconst metadata: SessionMetadata = {\n\t\t\tid: options.id ?? createSessionId(),\n\t\t\tcreatedAt: createTimestamp(),\n\t\t};\n\t\tconst leafId = forkedEntries[forkedEntries.length - 1]?.id ?? null;\n\t\tconst storage = new InMemorySessionStorage({ metadata, entries: forkedEntries, leafId });\n\t\tconst session = toSession(storage);\n\t\tthis.sessions.set(metadata.id, session);\n\t\treturn session;\n\t}\n}\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { InMemorySessionStorage } from "../storage/memory.js";
|
|
2
|
-
import { createSessionId, createTimestamp, getEntriesToFork, toSession } from "./shared.js";
|
|
3
|
-
export class InMemorySessionRepo {
|
|
4
|
-
sessions = new Map();
|
|
5
|
-
async create(options = {}) {
|
|
6
|
-
const metadata = {
|
|
7
|
-
id: options.id ?? createSessionId(),
|
|
8
|
-
createdAt: createTimestamp(),
|
|
9
|
-
};
|
|
10
|
-
const storage = new InMemorySessionStorage({ metadata });
|
|
11
|
-
const session = toSession(storage);
|
|
12
|
-
this.sessions.set(metadata.id, session);
|
|
13
|
-
return session;
|
|
14
|
-
}
|
|
15
|
-
async open(metadata) {
|
|
16
|
-
const session = this.sessions.get(metadata.id);
|
|
17
|
-
if (!session) {
|
|
18
|
-
throw new Error(`Session not found: ${metadata.id}`);
|
|
19
|
-
}
|
|
20
|
-
return session;
|
|
21
|
-
}
|
|
22
|
-
async list() {
|
|
23
|
-
return Promise.all([...this.sessions.values()].map((session) => session.getMetadata()));
|
|
24
|
-
}
|
|
25
|
-
async delete(metadata) {
|
|
26
|
-
this.sessions.delete(metadata.id);
|
|
27
|
-
}
|
|
28
|
-
async fork(sourceMetadata, options) {
|
|
29
|
-
const source = await this.open(sourceMetadata);
|
|
30
|
-
const forkedEntries = await getEntriesToFork(source.getStorage(), options);
|
|
31
|
-
const metadata = {
|
|
32
|
-
id: options.id ?? createSessionId(),
|
|
33
|
-
createdAt: createTimestamp(),
|
|
34
|
-
};
|
|
35
|
-
const leafId = forkedEntries[forkedEntries.length - 1]?.id ?? null;
|
|
36
|
-
const storage = new InMemorySessionStorage({ metadata, entries: forkedEntries, leafId });
|
|
37
|
-
const session = toSession(storage);
|
|
38
|
-
this.sessions.set(metadata.id, session);
|
|
39
|
-
return session;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=memory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/harness/session/repo/memory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE5F,MAAM,OAAO,mBAAmB;IACvB,QAAQ,GAAG,IAAI,GAAG,EAAoC,CAAC;IAE/D,KAAK,CAAC,MAAM,CAAC,OAAO,GAAoB,EAAE,EAAqC;QAC9E,MAAM,QAAQ,GAAoB;YACjC,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,eAAe,EAAE;YACnC,SAAS,EAAE,eAAe,EAAE;SAC5B,CAAC;QACF,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACxC,OAAO,OAAO,CAAC;IAAA,CACf;IAED,KAAK,CAAC,IAAI,CAAC,QAAyB,EAAqC;QACxE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,OAAO,CAAC;IAAA,CACf;IAED,KAAK,CAAC,IAAI,GAA+B;QACxC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAAA,CACxF;IAED,KAAK,CAAC,MAAM,CAAC,QAAyB,EAAiB;QACtD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAAA,CAClC;IAED,KAAK,CAAC,IAAI,CACT,cAA+B,EAC/B,OAAsE,EAClC;QACpC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;QAC3E,MAAM,QAAQ,GAAoB;YACjC,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,eAAe,EAAE;YACnC,SAAS,EAAE,eAAe,EAAE;SAC5B,CAAC;QACF,MAAM,MAAM,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC;QACnE,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC;QACzF,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACxC,OAAO,OAAO,CAAC;IAAA,CACf;CACD","sourcesContent":["import type { Session, SessionMetadata, SessionRepo } from \"../../types.js\";\nimport { InMemorySessionStorage } from \"../storage/memory.js\";\nimport { createSessionId, createTimestamp, getEntriesToFork, toSession } from \"./shared.js\";\n\nexport class InMemorySessionRepo implements SessionRepo<SessionMetadata, { id?: string }, void> {\n\tprivate sessions = new Map<string, Session<SessionMetadata>>();\n\n\tasync create(options: { id?: string } = {}): Promise<Session<SessionMetadata>> {\n\t\tconst metadata: SessionMetadata = {\n\t\t\tid: options.id ?? createSessionId(),\n\t\t\tcreatedAt: createTimestamp(),\n\t\t};\n\t\tconst storage = new InMemorySessionStorage({ metadata });\n\t\tconst session = toSession(storage);\n\t\tthis.sessions.set(metadata.id, session);\n\t\treturn session;\n\t}\n\n\tasync open(metadata: SessionMetadata): Promise<Session<SessionMetadata>> {\n\t\tconst session = this.sessions.get(metadata.id);\n\t\tif (!session) {\n\t\t\tthrow new Error(`Session not found: ${metadata.id}`);\n\t\t}\n\t\treturn session;\n\t}\n\n\tasync list(): Promise<SessionMetadata[]> {\n\t\treturn Promise.all([...this.sessions.values()].map((session) => session.getMetadata()));\n\t}\n\n\tasync delete(metadata: SessionMetadata): Promise<void> {\n\t\tthis.sessions.delete(metadata.id);\n\t}\n\n\tasync fork(\n\t\tsourceMetadata: SessionMetadata,\n\t\toptions: { entryId?: string; position?: \"before\" | \"at\"; id?: string },\n\t): Promise<Session<SessionMetadata>> {\n\t\tconst source = await this.open(sourceMetadata);\n\t\tconst forkedEntries = await getEntriesToFork(source.getStorage(), options);\n\t\tconst metadata: SessionMetadata = {\n\t\t\tid: options.id ?? createSessionId(),\n\t\t\tcreatedAt: createTimestamp(),\n\t\t};\n\t\tconst leafId = forkedEntries[forkedEntries.length - 1]?.id ?? null;\n\t\tconst storage = new InMemorySessionStorage({ metadata, entries: forkedEntries, leafId });\n\t\tconst session = toSession(storage);\n\t\tthis.sessions.set(metadata.id, session);\n\t\treturn session;\n\t}\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { SessionMetadata, SessionStorage, SessionTreeEntry } from "../../types.js";
|
|
2
|
-
import { Session } from "../session.js";
|
|
3
|
-
export declare function createSessionId(): string;
|
|
4
|
-
export declare function createTimestamp(): string;
|
|
5
|
-
export declare function toSession<TMetadata extends SessionMetadata>(storage: SessionStorage<TMetadata>): Session<TMetadata>;
|
|
6
|
-
export declare function getEntriesToFork(storage: SessionStorage, options: {
|
|
7
|
-
entryId?: string;
|
|
8
|
-
position?: "before" | "at";
|
|
9
|
-
}): Promise<SessionTreeEntry[]>;
|
|
10
|
-
//# sourceMappingURL=shared.d.ts.map
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/repo/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,SAAS,CAAC,SAAS,SAAS,eAAe,EAAE,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAEnH;AAED,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAA;CAAE,GACvD,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAgB7B","sourcesContent":["import type { SessionMetadata, SessionStorage, SessionTreeEntry } from \"../../types.js\";\nimport { Session } from \"../session.js\";\nimport { uuidv7 } from \"../uuid.js\";\n\nexport function createSessionId(): string {\n\treturn uuidv7();\n}\n\nexport function createTimestamp(): string {\n\treturn new Date().toISOString();\n}\n\nexport function toSession<TMetadata extends SessionMetadata>(storage: SessionStorage<TMetadata>): Session<TMetadata> {\n\treturn new Session(storage);\n}\n\nexport async function getEntriesToFork(\n\tstorage: SessionStorage,\n\toptions: { entryId?: string; position?: \"before\" | \"at\" },\n): Promise<SessionTreeEntry[]> {\n\tif (!options.entryId) return storage.getEntries();\n\tconst target = await storage.getEntry(options.entryId);\n\tif (!target) {\n\t\tthrow new Error(`Entry ${options.entryId} not found`);\n\t}\n\tlet effectiveLeafId: string | null;\n\tif ((options.position ?? \"before\") === \"at\") {\n\t\teffectiveLeafId = target.id;\n\t} else {\n\t\tif (target.type !== \"message\" || target.message.role !== \"user\") {\n\t\t\tthrow new Error(`Entry ${options.entryId} is not a user message`);\n\t\t}\n\t\teffectiveLeafId = target.parentId;\n\t}\n\treturn storage.getPathToRoot(effectiveLeafId);\n}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Session } from "../session.js";
|
|
2
|
-
import { uuidv7 } from "../uuid.js";
|
|
3
|
-
export function createSessionId() {
|
|
4
|
-
return uuidv7();
|
|
5
|
-
}
|
|
6
|
-
export function createTimestamp() {
|
|
7
|
-
return new Date().toISOString();
|
|
8
|
-
}
|
|
9
|
-
export function toSession(storage) {
|
|
10
|
-
return new Session(storage);
|
|
11
|
-
}
|
|
12
|
-
export async function getEntriesToFork(storage, options) {
|
|
13
|
-
if (!options.entryId)
|
|
14
|
-
return storage.getEntries();
|
|
15
|
-
const target = await storage.getEntry(options.entryId);
|
|
16
|
-
if (!target) {
|
|
17
|
-
throw new Error(`Entry ${options.entryId} not found`);
|
|
18
|
-
}
|
|
19
|
-
let effectiveLeafId;
|
|
20
|
-
if ((options.position ?? "before") === "at") {
|
|
21
|
-
effectiveLeafId = target.id;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
if (target.type !== "message" || target.message.role !== "user") {
|
|
25
|
-
throw new Error(`Entry ${options.entryId} is not a user message`);
|
|
26
|
-
}
|
|
27
|
-
effectiveLeafId = target.parentId;
|
|
28
|
-
}
|
|
29
|
-
return storage.getPathToRoot(effectiveLeafId);
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/harness/session/repo/shared.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,eAAe,GAAW;IACzC,OAAO,MAAM,EAAE,CAAC;AAAA,CAChB;AAED,MAAM,UAAU,eAAe,GAAW;IACzC,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAAA,CAChC;AAED,MAAM,UAAU,SAAS,CAAoC,OAAkC,EAAsB;IACpH,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;AAAA,CAC5B;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAAuB,EACvB,OAAyD,EAC3B;IAC9B,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC,UAAU,EAAE,CAAC;IAClD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,eAA8B,CAAC;IACnC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7C,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7B,CAAC;SAAM,CAAC;QACP,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACjE,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,CAAC,OAAO,wBAAwB,CAAC,CAAC;QACnE,CAAC;QACD,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC;IACnC,CAAC;IACD,OAAO,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;AAAA,CAC9C","sourcesContent":["import type { SessionMetadata, SessionStorage, SessionTreeEntry } from \"../../types.js\";\nimport { Session } from \"../session.js\";\nimport { uuidv7 } from \"../uuid.js\";\n\nexport function createSessionId(): string {\n\treturn uuidv7();\n}\n\nexport function createTimestamp(): string {\n\treturn new Date().toISOString();\n}\n\nexport function toSession<TMetadata extends SessionMetadata>(storage: SessionStorage<TMetadata>): Session<TMetadata> {\n\treturn new Session(storage);\n}\n\nexport async function getEntriesToFork(\n\tstorage: SessionStorage,\n\toptions: { entryId?: string; position?: \"before\" | \"at\" },\n): Promise<SessionTreeEntry[]> {\n\tif (!options.entryId) return storage.getEntries();\n\tconst target = await storage.getEntry(options.entryId);\n\tif (!target) {\n\t\tthrow new Error(`Entry ${options.entryId} not found`);\n\t}\n\tlet effectiveLeafId: string | null;\n\tif ((options.position ?? \"before\") === \"at\") {\n\t\teffectiveLeafId = target.id;\n\t} else {\n\t\tif (target.type !== \"message\" || target.message.role !== \"user\") {\n\t\t\tthrow new Error(`Entry ${options.entryId} is not a user message`);\n\t\t}\n\t\teffectiveLeafId = target.parentId;\n\t}\n\treturn storage.getPathToRoot(effectiveLeafId);\n}\n"]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { JsonlSessionMetadata, SessionStorage, SessionTreeEntry } from "../../types.js";
|
|
2
|
-
export declare function loadJsonlSessionMetadata(filePath: string): Promise<JsonlSessionMetadata>;
|
|
3
|
-
export declare class JsonlSessionStorage implements SessionStorage<JsonlSessionMetadata> {
|
|
4
|
-
private readonly filePath;
|
|
5
|
-
private readonly metadata;
|
|
6
|
-
private entries;
|
|
7
|
-
private byId;
|
|
8
|
-
private labelsById;
|
|
9
|
-
private currentLeafId;
|
|
10
|
-
private constructor();
|
|
11
|
-
static open(filePath: string): Promise<JsonlSessionStorage>;
|
|
12
|
-
static create(filePath: string, options: {
|
|
13
|
-
cwd: string;
|
|
14
|
-
sessionId: string;
|
|
15
|
-
parentSessionPath?: string;
|
|
16
|
-
}): Promise<JsonlSessionStorage>;
|
|
17
|
-
getMetadata(): Promise<JsonlSessionMetadata>;
|
|
18
|
-
getLeafId(): Promise<string | null>;
|
|
19
|
-
setLeafId(leafId: string | null): Promise<void>;
|
|
20
|
-
createEntryId(): Promise<string>;
|
|
21
|
-
appendEntry(entry: SessionTreeEntry): Promise<void>;
|
|
22
|
-
getEntry(id: string): Promise<SessionTreeEntry | undefined>;
|
|
23
|
-
findEntries<TType extends SessionTreeEntry["type"]>(type: TType): Promise<Array<Extract<SessionTreeEntry, {
|
|
24
|
-
type: TType;
|
|
25
|
-
}>>>;
|
|
26
|
-
getLabel(id: string): Promise<string | undefined>;
|
|
27
|
-
getPathToRoot(leafId: string | null): Promise<SessionTreeEntry[]>;
|
|
28
|
-
getEntries(): Promise<SessionTreeEntry[]>;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=jsonl.d.ts.map
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/storage/jsonl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA+C7F,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkB9F;AAkCD,qBAAa,mBAAoB,YAAW,cAAc,CAAC,oBAAoB,CAAC;IAC/E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAChD,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,IAAI,CAAgC;IAC5C,OAAO,CA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nimport { createReadStream } from \"node:fs\";\nimport { appendFile, mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport { createInterface } from \"node:readline\";\nimport type { JsonlSessionMetadata, SessionStorage, SessionTreeEntry } from \"../../types.js\";\n\ninterface SessionHeader {\n\ttype: \"session\";\n\tversion: 3;\n\tid: string;\n\ttimestamp: string;\n\tcwd: string;\n\tparentSession?: string;\n}\n\nfunction updateLabelCache(labelsById: Map<string, string>, entry: SessionTreeEntry): void {\n\tif (entry.type !== \"label\") return;\n\tconst label = entry.label?.trim();\n\tif (label) {\n\t\tlabelsById.set(entry.targetId, label);\n\t} else {\n\t\tlabelsById.delete(entry.targetId);\n\t}\n}\n\nfunction buildLabelsById(entries: SessionTreeEntry[]): Map<string, string> {\n\tconst labelsById = new Map<string, string>();\n\tfor (const entry of entries) {\n\t\tupdateLabelCache(labelsById, entry);\n\t}\n\treturn labelsById;\n}\n\nfunction generateEntryId(byId: { has(id: string): boolean }): string {\n\tfor (let i = 0; i < 100; i++) {\n\t\tconst id = randomUUID().slice(0, 8);\n\t\tif (!byId.has(id)) return id;\n\t}\n\treturn randomUUID();\n}\n\nfunction headerToSessionMetadata(header: SessionHeader, path: string): JsonlSessionMetadata {\n\treturn {\n\t\tid: header.id,\n\t\tcreatedAt: header.timestamp,\n\t\tcwd: header.cwd,\n\t\tpath,\n\t\tparentSessionPath: header.parentSession,\n\t};\n}\n\nexport async function loadJsonlSessionMetadata(filePath: string): Promise<JsonlSessionMetadata> {\n\tconst stream = createReadStream(filePath, { encoding: \"utf8\" });\n\tconst lines = createInterface({ input: stream, crlfDelay: Infinity });\n\ttry {\n\t\tfor await (const line of lines) {\n\t\t\tif (!line.trim()) break;\n\t\t\ttry {\n\t\t\t\tconst header = JSON.parse(line) as SessionHeader;\n\t\t\t\treturn headerToSessionMetadata(header, resolve(filePath));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(`Invalid JSONL session file ${filePath}: first line is not a valid session header`);\n\t\t\t}\n\t\t}\n\t\tthrow new Error(`Invalid JSONL session file ${filePath}: missing session header`);\n\t} finally {\n\t\tlines.close();\n\t\tstream.destroy();\n\t}\n}\n\nasync function loadJsonlStorage(filePath: string): Promise<{\n\theader: SessionHeader;\n\tentries: SessionTreeEntry[];\n\tleafId: string | null;\n}> {\n\tconst content = await readFile(filePath, \"utf8\");\n\tconst lines = content.split(\"\\n\").filter((line) => line.trim());\n\tif (lines.length === 0) {\n\t\tthrow new Error(`Invalid JSONL session file ${filePath}: missing session header`);\n\t}\n\n\tlet header: SessionHeader;\n\ttry {\n\t\theader = JSON.parse(lines[0]!) as SessionHeader;\n\t} catch {\n\t\tthrow new Error(`Invalid JSONL session file ${filePath}: first line is not a valid session header`);\n\t}\n\n\tconst entries: SessionTreeEntry[] = [];\n\tlet leafId: string | null = null;\n\tfor (const line of lines.slice(1)) {\n\t\ttry {\n\t\t\tconst entry = JSON.parse(line) as SessionTreeEntry;\n\t\t\tentries.push(entry);\n\t\t\tleafId = entry.id;\n\t\t} catch {\n\t\t\t// ignore malformed entry lines\n\t\t}\n\t}\n\treturn { header, entries, leafId };\n}\n\nexport class JsonlSessionStorage implements SessionStorage<JsonlSessionMetadata> {\n\tprivate readonly filePath: string;\n\tprivate readonly metadata: JsonlSessionMetadata;\n\tprivate entries: SessionTreeEntry[];\n\tprivate byId: Map<string, SessionTreeEntry>;\n\tprivate labelsById: Map<string, string>;\n\tprivate currentLeafId: string | null;\n\n\tprivate constructor(filePath: string, header: SessionHeader, entries: SessionTreeEntry[], leafId: string | null) {\n\t\tthis.filePath = resolve(filePath);\n\t\tthis.metadata = headerToSessionMetadata(header, this.filePath);\n\t\tthis.entries = entries;\n\t\tthis.byId = new Map(entries.map((entry) => [entry.id, entry]));\n\t\tthis.labelsById = buildLabelsById(entries);\n\t\tthis.currentLeafId = leafId;\n\t}\n\n\tstatic async open(filePath: string): Promise<JsonlSessionStorage> {\n\t\tconst resolvedPath = resolve(filePath);\n\t\tconst loaded = await loadJsonlStorage(resolvedPath);\n\t\treturn new JsonlSessionStorage(resolvedPath, loaded.header, loaded.entries, loaded.leafId);\n\t}\n\n\tstatic async create(\n\t\tfilePath: string,\n\t\toptions: {\n\t\t\tcwd: string;\n\t\t\tsessionId: string;\n\t\t\tparentSessionPath?: string;\n\t\t},\n\t): Promise<JsonlSessionStorage> {\n\t\tconst resolvedPath = resolve(filePath);\n\t\tconst header: SessionHeader = {\n\t\t\ttype: \"session\",\n\t\t\tversion: 3,\n\t\t\tid: options.sessionId,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tcwd: options.cwd,\n\t\t\tparentSession: options.parentSessionPath,\n\t\t};\n\t\tawait mkdir(dirname(resolvedPath), { recursive: true });\n\t\tawait writeFile(resolvedPath, `${JSON.stringify(header)}\\n`);\n\t\treturn new JsonlSessionStorage(resolvedPath, header, [], null);\n\t}\n\n\tasync getMetadata(): Promise<JsonlSessionMetadata> {\n\t\treturn this.metadata;\n\t}\n\n\tasync getLeafId(): Promise<string | null> {\n\t\treturn this.currentLeafId;\n\t}\n\n\tasync setLeafId(leafId: string | null): Promise<void> {\n\t\tif (leafId !== null && !this.byId.has(leafId)) {\n\t\t\tthrow new Error(`Entry ${leafId} not found`);\n\t\t}\n\t\tthis.currentLeafId = leafId;\n\t}\n\n\tasync createEntryId(): Promise<string> {\n\t\treturn generateEntryId(this.byId);\n\t}\n\n\tasync appendEntry(entry: SessionTreeEntry): Promise<void> {\n\t\tawait appendFile(this.filePath, `${JSON.stringify(entry)}\\n`);\n\t\tthis.entries.push(entry);\n\t\tthis.byId.set(entry.id, entry);\n\t\tupdateLabelCache(this.labelsById, entry);\n\t\tthis.currentLeafId = entry.id;\n\t}\n\n\tasync getEntry(id: string): Promise<SessionTreeEntry | undefined> {\n\t\treturn this.byId.get(id);\n\t}\n\n\tasync findEntries<TType extends SessionTreeEntry[\"type\"]>(\n\t\ttype: TType,\n\t): Promise<Array<Extract<SessionTreeEntry, { type: TType }>>> {\n\t\treturn this.entries.filter((entry): entry is Extract<SessionTreeEntry, { type: TType }> => entry.type === type);\n\t}\n\n\tasync getLabel(id: string): Promise<string | undefined> {\n\t\treturn this.labelsById.get(id);\n\t}\n\n\tasync getPathToRoot(leafId: string | null): Promise<SessionTreeEntry[]> {\n\t\tif (leafId === null) return [];\n\t\tconst path: SessionTreeEntry[] = [];\n\t\tlet current = this.byId.get(leafId);\n\t\twhile (current) {\n\t\t\tpath.unshift(current);\n\t\t\tcurrent = current.parentId ? this.byId.get(current.parentId) : undefined;\n\t\t}\n\t\treturn path;\n\t}\n\n\tasync getEntries(): Promise<SessionTreeEntry[]> {\n\t\treturn [...this.entries];\n\t}\n}\n"]}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { createReadStream } from "node:fs";
|
|
3
|
-
import { appendFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
4
|
-
import { dirname, resolve } from "node:path";
|
|
5
|
-
import { createInterface } from "node:readline";
|
|
6
|
-
function updateLabelCache(labelsById, entry) {
|
|
7
|
-
if (entry.type !== "label")
|
|
8
|
-
return;
|
|
9
|
-
const label = entry.label?.trim();
|
|
10
|
-
if (label) {
|
|
11
|
-
labelsById.set(entry.targetId, label);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
labelsById.delete(entry.targetId);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function buildLabelsById(entries) {
|
|
18
|
-
const labelsById = new Map();
|
|
19
|
-
for (const entry of entries) {
|
|
20
|
-
updateLabelCache(labelsById, entry);
|
|
21
|
-
}
|
|
22
|
-
return labelsById;
|
|
23
|
-
}
|
|
24
|
-
function generateEntryId(byId) {
|
|
25
|
-
for (let i = 0; i < 100; i++) {
|
|
26
|
-
const id = randomUUID().slice(0, 8);
|
|
27
|
-
if (!byId.has(id))
|
|
28
|
-
return id;
|
|
29
|
-
}
|
|
30
|
-
return randomUUID();
|
|
31
|
-
}
|
|
32
|
-
function headerToSessionMetadata(header, path) {
|
|
33
|
-
return {
|
|
34
|
-
id: header.id,
|
|
35
|
-
createdAt: header.timestamp,
|
|
36
|
-
cwd: header.cwd,
|
|
37
|
-
path,
|
|
38
|
-
parentSessionPath: header.parentSession,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export async function loadJsonlSessionMetadata(filePath) {
|
|
42
|
-
const stream = createReadStream(filePath, { encoding: "utf8" });
|
|
43
|
-
const lines = createInterface({ input: stream, crlfDelay: Infinity });
|
|
44
|
-
try {
|
|
45
|
-
for await (const line of lines) {
|
|
46
|
-
if (!line.trim())
|
|
47
|
-
break;
|
|
48
|
-
try {
|
|
49
|
-
const header = JSON.parse(line);
|
|
50
|
-
return headerToSessionMetadata(header, resolve(filePath));
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
throw new Error(`Invalid JSONL session file ${filePath}: first line is not a valid session header`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
throw new Error(`Invalid JSONL session file ${filePath}: missing session header`);
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
lines.close();
|
|
60
|
-
stream.destroy();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
async function loadJsonlStorage(filePath) {
|
|
64
|
-
const content = await readFile(filePath, "utf8");
|
|
65
|
-
const lines = content.split("\n").filter((line) => line.trim());
|
|
66
|
-
if (lines.length === 0) {
|
|
67
|
-
throw new Error(`Invalid JSONL session file ${filePath}: missing session header`);
|
|
68
|
-
}
|
|
69
|
-
let header;
|
|
70
|
-
try {
|
|
71
|
-
header = JSON.parse(lines[0]);
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
throw new Error(`Invalid JSONL session file ${filePath}: first line is not a valid session header`);
|
|
75
|
-
}
|
|
76
|
-
const entries = [];
|
|
77
|
-
let leafId = null;
|
|
78
|
-
for (const line of lines.slice(1)) {
|
|
79
|
-
try {
|
|
80
|
-
const entry = JSON.parse(line);
|
|
81
|
-
entries.push(entry);
|
|
82
|
-
leafId = entry.id;
|
|
83
|
-
}
|
|
84
|
-
catch {
|
|
85
|
-
// ignore malformed entry lines
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return { header, entries, leafId };
|
|
89
|
-
}
|
|
90
|
-
export class JsonlSessionStorage {
|
|
91
|
-
filePath;
|
|
92
|
-
metadata;
|
|
93
|
-
entries;
|
|
94
|
-
byId;
|
|
95
|
-
labelsById;
|
|
96
|
-
currentLeafId;
|
|
97
|
-
constructor(filePath, header, entries, leafId) {
|
|
98
|
-
this.filePath = resolve(filePath);
|
|
99
|
-
this.metadata = headerToSessionMetadata(header, this.filePath);
|
|
100
|
-
this.entries = entries;
|
|
101
|
-
this.byId = new Map(entries.map((entry) => [entry.id, entry]));
|
|
102
|
-
this.labelsById = buildLabelsById(entries);
|
|
103
|
-
this.currentLeafId = leafId;
|
|
104
|
-
}
|
|
105
|
-
static async open(filePath) {
|
|
106
|
-
const resolvedPath = resolve(filePath);
|
|
107
|
-
const loaded = await loadJsonlStorage(resolvedPath);
|
|
108
|
-
return new JsonlSessionStorage(resolvedPath, loaded.header, loaded.entries, loaded.leafId);
|
|
109
|
-
}
|
|
110
|
-
static async create(filePath, options) {
|
|
111
|
-
const resolvedPath = resolve(filePath);
|
|
112
|
-
const header = {
|
|
113
|
-
type: "session",
|
|
114
|
-
version: 3,
|
|
115
|
-
id: options.sessionId,
|
|
116
|
-
timestamp: new Date().toISOString(),
|
|
117
|
-
cwd: options.cwd,
|
|
118
|
-
parentSession: options.parentSessionPath,
|
|
119
|
-
};
|
|
120
|
-
await mkdir(dirname(resolvedPath), { recursive: true });
|
|
121
|
-
await writeFile(resolvedPath, `${JSON.stringify(header)}\n`);
|
|
122
|
-
return new JsonlSessionStorage(resolvedPath, header, [], null);
|
|
123
|
-
}
|
|
124
|
-
async getMetadata() {
|
|
125
|
-
return this.metadata;
|
|
126
|
-
}
|
|
127
|
-
async getLeafId() {
|
|
128
|
-
return this.currentLeafId;
|
|
129
|
-
}
|
|
130
|
-
async setLeafId(leafId) {
|
|
131
|
-
if (leafId !== null && !this.byId.has(leafId)) {
|
|
132
|
-
throw new Error(`Entry ${leafId} not found`);
|
|
133
|
-
}
|
|
134
|
-
this.currentLeafId = leafId;
|
|
135
|
-
}
|
|
136
|
-
async createEntryId() {
|
|
137
|
-
return generateEntryId(this.byId);
|
|
138
|
-
}
|
|
139
|
-
async appendEntry(entry) {
|
|
140
|
-
await appendFile(this.filePath, `${JSON.stringify(entry)}\n`);
|
|
141
|
-
this.entries.push(entry);
|
|
142
|
-
this.byId.set(entry.id, entry);
|
|
143
|
-
updateLabelCache(this.labelsById, entry);
|
|
144
|
-
this.currentLeafId = entry.id;
|
|
145
|
-
}
|
|
146
|
-
async getEntry(id) {
|
|
147
|
-
return this.byId.get(id);
|
|
148
|
-
}
|
|
149
|
-
async findEntries(type) {
|
|
150
|
-
return this.entries.filter((entry) => entry.type === type);
|
|
151
|
-
}
|
|
152
|
-
async getLabel(id) {
|
|
153
|
-
return this.labelsById.get(id);
|
|
154
|
-
}
|
|
155
|
-
async getPathToRoot(leafId) {
|
|
156
|
-
if (leafId === null)
|
|
157
|
-
return [];
|
|
158
|
-
const path = [];
|
|
159
|
-
let current = this.byId.get(leafId);
|
|
160
|
-
while (current) {
|
|
161
|
-
path.unshift(current);
|
|
162
|
-
current = current.parentId ? this.byId.get(current.parentId) : undefined;
|
|
163
|
-
}
|
|
164
|
-
return path;
|
|
165
|
-
}
|
|
166
|
-
async getEntries() {
|
|
167
|
-
return [...this.entries];
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=jsonl.js.map
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../../../src/harness/session/storage/jsonl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM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ED,KAAK,CAAC,WAAW,CAChB,IAAW,EACkD;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAuD,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAAA,CAChH;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU,EAA+B;QACvD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAAA,CAC/B;IAED,KAAK,CAAC,aAAa,CAAC,MAAqB,EAA+B;QACvE,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAuB,EAAE,CAAC;QACpC,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,OAAO,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1E,CAAC;QACD,OAAO,IAAI,CAAC;IAAA,CACZ;IAED,KAAK,CAAC,UAAU,GAAgC;QAC/C,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAAA,CACzB;CACD","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { createReadStream } from \"node:fs\";\nimport { appendFile, mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport { createInterface } from \"node:readline\";\nimport type { JsonlSessionMetadata, SessionStorage, SessionTreeEntry } from \"../../types.js\";\n\ninterface SessionHeader {\n\ttype: \"session\";\n\tversion: 3;\n\tid: string;\n\ttimestamp: string;\n\tcwd: string;\n\tparentSession?: string;\n}\n\nfunction updateLabelCache(labelsById: Map<string, string>, entry: SessionTreeEntry): void {\n\tif (entry.type !== \"label\") return;\n\tconst label = entry.label?.trim();\n\tif (label) {\n\t\tlabelsById.set(entry.targetId, label);\n\t} else {\n\t\tlabelsById.delete(entry.targetId);\n\t}\n}\n\nfunction buildLabelsById(entries: SessionTreeEntry[]): Map<string, string> {\n\tconst labelsById = new Map<string, string>();\n\tfor (const entry of entries) {\n\t\tupdateLabelCache(labelsById, entry);\n\t}\n\treturn labelsById;\n}\n\nfunction generateEntryId(byId: { has(id: string): boolean }): string {\n\tfor (let i = 0; i < 100; i++) {\n\t\tconst id = randomUUID().slice(0, 8);\n\t\tif (!byId.has(id)) return id;\n\t}\n\treturn randomUUID();\n}\n\nfunction headerToSessionMetadata(header: SessionHeader, path: string): JsonlSessionMetadata {\n\treturn {\n\t\tid: header.id,\n\t\tcreatedAt: header.timestamp,\n\t\tcwd: header.cwd,\n\t\tpath,\n\t\tparentSessionPath: header.parentSession,\n\t};\n}\n\nexport async function loadJsonlSessionMetadata(filePath: string): Promise<JsonlSessionMetadata> {\n\tconst stream = createReadStream(filePath, { encoding: \"utf8\" });\n\tconst lines = createInterface({ input: stream, crlfDelay: Infinity });\n\ttry {\n\t\tfor await (const line of lines) {\n\t\t\tif (!line.trim()) break;\n\t\t\ttry {\n\t\t\t\tconst header = JSON.parse(line) as SessionHeader;\n\t\t\t\treturn headerToSessionMetadata(header, resolve(filePath));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(`Invalid JSONL session file ${filePath}: first line is not a valid session header`);\n\t\t\t}\n\t\t}\n\t\tthrow new Error(`Invalid JSONL session file ${filePath}: missing session header`);\n\t} finally {\n\t\tlines.close();\n\t\tstream.destroy();\n\t}\n}\n\nasync function loadJsonlStorage(filePath: string): Promise<{\n\theader: SessionHeader;\n\tentries: SessionTreeEntry[];\n\tleafId: string | null;\n}> {\n\tconst content = await readFile(filePath, \"utf8\");\n\tconst lines = content.split(\"\\n\").filter((line) => line.trim());\n\tif (lines.length === 0) {\n\t\tthrow new Error(`Invalid JSONL session file ${filePath}: missing session header`);\n\t}\n\n\tlet header: SessionHeader;\n\ttry {\n\t\theader = JSON.parse(lines[0]!) as SessionHeader;\n\t} catch {\n\t\tthrow new Error(`Invalid JSONL session file ${filePath}: first line is not a valid session header`);\n\t}\n\n\tconst entries: SessionTreeEntry[] = [];\n\tlet leafId: string | null = null;\n\tfor (const line of lines.slice(1)) {\n\t\ttry {\n\t\t\tconst entry = JSON.parse(line) as SessionTreeEntry;\n\t\t\tentries.push(entry);\n\t\t\tleafId = entry.id;\n\t\t} catch {\n\t\t\t// ignore malformed entry lines\n\t\t}\n\t}\n\treturn { header, entries, leafId };\n}\n\nexport class JsonlSessionStorage implements SessionStorage<JsonlSessionMetadata> {\n\tprivate readonly filePath: string;\n\tprivate readonly metadata: JsonlSessionMetadata;\n\tprivate entries: SessionTreeEntry[];\n\tprivate byId: Map<string, SessionTreeEntry>;\n\tprivate labelsById: Map<string, string>;\n\tprivate currentLeafId: string | null;\n\n\tprivate constructor(filePath: string, header: SessionHeader, entries: SessionTreeEntry[], leafId: string | null) {\n\t\tthis.filePath = resolve(filePath);\n\t\tthis.metadata = headerToSessionMetadata(header, this.filePath);\n\t\tthis.entries = entries;\n\t\tthis.byId = new Map(entries.map((entry) => [entry.id, entry]));\n\t\tthis.labelsById = buildLabelsById(entries);\n\t\tthis.currentLeafId = leafId;\n\t}\n\n\tstatic async open(filePath: string): Promise<JsonlSessionStorage> {\n\t\tconst resolvedPath = resolve(filePath);\n\t\tconst loaded = await loadJsonlStorage(resolvedPath);\n\t\treturn new JsonlSessionStorage(resolvedPath, loaded.header, loaded.entries, loaded.leafId);\n\t}\n\n\tstatic async create(\n\t\tfilePath: string,\n\t\toptions: {\n\t\t\tcwd: string;\n\t\t\tsessionId: string;\n\t\t\tparentSessionPath?: string;\n\t\t},\n\t): Promise<JsonlSessionStorage> {\n\t\tconst resolvedPath = resolve(filePath);\n\t\tconst header: SessionHeader = {\n\t\t\ttype: \"session\",\n\t\t\tversion: 3,\n\t\t\tid: options.sessionId,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tcwd: options.cwd,\n\t\t\tparentSession: options.parentSessionPath,\n\t\t};\n\t\tawait mkdir(dirname(resolvedPath), { recursive: true });\n\t\tawait writeFile(resolvedPath, `${JSON.stringify(header)}\\n`);\n\t\treturn new JsonlSessionStorage(resolvedPath, header, [], null);\n\t}\n\n\tasync getMetadata(): Promise<JsonlSessionMetadata> {\n\t\treturn this.metadata;\n\t}\n\n\tasync getLeafId(): Promise<string | null> {\n\t\treturn this.currentLeafId;\n\t}\n\n\tasync setLeafId(leafId: string | null): Promise<void> {\n\t\tif (leafId !== null && !this.byId.has(leafId)) {\n\t\t\tthrow new Error(`Entry ${leafId} not found`);\n\t\t}\n\t\tthis.currentLeafId = leafId;\n\t}\n\n\tasync createEntryId(): Promise<string> {\n\t\treturn generateEntryId(this.byId);\n\t}\n\n\tasync appendEntry(entry: SessionTreeEntry): Promise<void> {\n\t\tawait appendFile(this.filePath, `${JSON.stringify(entry)}\\n`);\n\t\tthis.entries.push(entry);\n\t\tthis.byId.set(entry.id, entry);\n\t\tupdateLabelCache(this.labelsById, entry);\n\t\tthis.currentLeafId = entry.id;\n\t}\n\n\tasync getEntry(id: string): Promise<SessionTreeEntry | undefined> {\n\t\treturn this.byId.get(id);\n\t}\n\n\tasync findEntries<TType extends SessionTreeEntry[\"type\"]>(\n\t\ttype: TType,\n\t): Promise<Array<Extract<SessionTreeEntry, { type: TType }>>> {\n\t\treturn this.entries.filter((entry): entry is Extract<SessionTreeEntry, { type: TType }> => entry.type === type);\n\t}\n\n\tasync getLabel(id: string): Promise<string | undefined> {\n\t\treturn this.labelsById.get(id);\n\t}\n\n\tasync getPathToRoot(leafId: string | null): Promise<SessionTreeEntry[]> {\n\t\tif (leafId === null) return [];\n\t\tconst path: SessionTreeEntry[] = [];\n\t\tlet current = this.byId.get(leafId);\n\t\twhile (current) {\n\t\t\tpath.unshift(current);\n\t\t\tcurrent = current.parentId ? this.byId.get(current.parentId) : undefined;\n\t\t}\n\t\treturn path;\n\t}\n\n\tasync getEntries(): Promise<SessionTreeEntry[]> {\n\t\treturn [...this.entries];\n\t}\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { SessionMetadata, SessionStorage, SessionTreeEntry } from "../../types.js";
|
|
2
|
-
export declare class InMemorySessionStorage implements SessionStorage {
|
|
3
|
-
private readonly metadata;
|
|
4
|
-
private entries;
|
|
5
|
-
private byId;
|
|
6
|
-
private labelsById;
|
|
7
|
-
private leafId;
|
|
8
|
-
constructor(options?: {
|
|
9
|
-
entries?: SessionTreeEntry[];
|
|
10
|
-
leafId?: string | null;
|
|
11
|
-
metadata?: SessionMetadata;
|
|
12
|
-
});
|
|
13
|
-
getMetadata(): Promise<SessionMetadata>;
|
|
14
|
-
getLeafId(): Promise<string | null>;
|
|
15
|
-
setLeafId(leafId: string | null): Promise<void>;
|
|
16
|
-
createEntryId(): Promise<string>;
|
|
17
|
-
appendEntry(entry: SessionTreeEntry): Promise<void>;
|
|
18
|
-
getEntry(id: string): Promise<SessionTreeEntry | undefined>;
|
|
19
|
-
findEntries<TType extends SessionTreeEntry["type"]>(type: TType): Promise<Array<Extract<SessionTreeEntry, {
|
|
20
|
-
type: TType;
|
|
21
|
-
}>>>;
|
|
22
|
-
getLabel(id: string): Promise<string | undefined>;
|
|
23
|
-
getPathToRoot(leafId: string | null): Promise<SessionTreeEntry[]>;
|
|
24
|
-
getEntries(): Promise<SessionTreeEntry[]>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=memory.d.ts.map
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/storage/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA6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Content":["import { randomUUID } from \"node:crypto\";\nimport type { SessionMetadata, SessionStorage, SessionTreeEntry } from \"../../types.js\";\nimport { uuidv7 } from \"../uuid.js\";\n\nfunction updateLabelCache(labelsById: Map<string, string>, entry: SessionTreeEntry): void {\n\tif (entry.type !== \"label\") return;\n\tconst label = entry.label?.trim();\n\tif (label) {\n\t\tlabelsById.set(entry.targetId, label);\n\t} else {\n\t\tlabelsById.delete(entry.targetId);\n\t}\n}\n\nfunction buildLabelsById(entries: SessionTreeEntry[]): Map<string, string> {\n\tconst labelsById = new Map<string, string>();\n\tfor (const entry of entries) {\n\t\tupdateLabelCache(labelsById, entry);\n\t}\n\treturn labelsById;\n}\n\nfunction generateEntryId(byId: { has(id: string): boolean }): string {\n\tfor (let i = 0; i < 100; i++) {\n\t\tconst id = randomUUID().slice(0, 8);\n\t\tif (!byId.has(id)) return id;\n\t}\n\treturn randomUUID();\n}\n\nexport class InMemorySessionStorage implements SessionStorage {\n\tprivate readonly metadata: SessionMetadata;\n\tprivate entries: SessionTreeEntry[];\n\tprivate byId: Map<string, SessionTreeEntry>;\n\tprivate labelsById: Map<string, string>;\n\tprivate leafId: string | null;\n\n\tconstructor(options?: { entries?: SessionTreeEntry[]; leafId?: string | null; metadata?: SessionMetadata }) {\n\t\tthis.entries = options?.entries ? [...options.entries] : [];\n\t\tthis.byId = new Map(this.entries.map((entry) => [entry.id, entry]));\n\t\tthis.labelsById = buildLabelsById(this.entries);\n\t\tthis.leafId = options?.leafId ?? this.entries[this.entries.length - 1]?.id ?? null;\n\t\tif (this.leafId !== null && !this.byId.has(this.leafId)) {\n\t\t\tthrow new Error(`Entry ${this.leafId} not found`);\n\t\t}\n\t\tthis.metadata = options?.metadata ?? { id: uuidv7(), createdAt: new Date().toISOString() };\n\t}\n\n\tasync getMetadata(): Promise<SessionMetadata> {\n\t\treturn this.metadata;\n\t}\n\n\tasync getLeafId(): Promise<string | null> {\n\t\treturn this.leafId;\n\t}\n\n\tasync setLeafId(leafId: string | null): Promise<void> {\n\t\tif (leafId !== null && !this.byId.has(leafId)) {\n\t\t\tthrow new Error(`Entry ${leafId} not found`);\n\t\t}\n\t\tthis.leafId = leafId;\n\t}\n\n\tasync createEntryId(): Promise<string> {\n\t\treturn generateEntryId(this.byId);\n\t}\n\n\tasync appendEntry(entry: SessionTreeEntry): Promise<void> {\n\t\tthis.entries.push(entry);\n\t\tthis.byId.set(entry.id, entry);\n\t\tupdateLabelCache(this.labelsById, entry);\n\t\tthis.leafId = entry.id;\n\t}\n\n\tasync getEntry(id: string): Promise<SessionTreeEntry | undefined> {\n\t\treturn this.byId.get(id);\n\t}\n\n\tasync findEntries<TType extends SessionTreeEntry[\"type\"]>(\n\t\ttype: TType,\n\t): Promise<Array<Extract<SessionTreeEntry, { type: TType }>>> {\n\t\treturn this.entries.filter((entry): entry is Extract<SessionTreeEntry, { type: TType }> => entry.type === type);\n\t}\n\n\tasync getLabel(id: string): Promise<string | undefined> {\n\t\treturn this.labelsById.get(id);\n\t}\n\n\tasync getPathToRoot(leafId: string | null): Promise<SessionTreeEntry[]> {\n\t\tif (leafId === null) return [];\n\t\tconst path: SessionTreeEntry[] = [];\n\t\tlet current = this.byId.get(leafId);\n\t\twhile (current) {\n\t\t\tpath.unshift(current);\n\t\t\tcurrent = current.parentId ? this.byId.get(current.parentId) : undefined;\n\t\t}\n\t\treturn path;\n\t}\n\n\tasync getEntries(): Promise<SessionTreeEntry[]> {\n\t\treturn [...this.entries];\n\t}\n}\n"]}
|