@posthog/agent 1.24.2 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/additionalItems.js +4 -0
- package/dist/_virtual/additionalItems.js.map +1 -0
- package/dist/_virtual/additionalProperties.js +4 -0
- package/dist/_virtual/additionalProperties.js.map +1 -0
- package/dist/_virtual/ajv.js +4 -0
- package/dist/_virtual/ajv.js.map +1 -0
- package/dist/_virtual/allOf.js +4 -0
- package/dist/_virtual/allOf.js.map +1 -0
- package/dist/_virtual/anyOf.js +4 -0
- package/dist/_virtual/anyOf.js.map +1 -0
- package/dist/_virtual/applicability.js +4 -0
- package/dist/_virtual/applicability.js.map +1 -0
- package/dist/_virtual/boolSchema.js +4 -0
- package/dist/_virtual/boolSchema.js.map +1 -0
- package/dist/_virtual/code.js +4 -0
- package/dist/_virtual/code.js.map +1 -0
- package/dist/_virtual/code2.js +4 -0
- package/dist/_virtual/code2.js.map +1 -0
- package/dist/_virtual/const.js +4 -0
- package/dist/_virtual/const.js.map +1 -0
- package/dist/_virtual/contains.js +4 -0
- package/dist/_virtual/contains.js.map +1 -0
- package/dist/_virtual/core.js +4 -0
- package/dist/_virtual/core.js.map +1 -0
- package/dist/_virtual/dataType.js +4 -0
- package/dist/_virtual/dataType.js.map +1 -0
- package/dist/_virtual/defaults.js +4 -0
- package/dist/_virtual/defaults.js.map +1 -0
- package/dist/_virtual/dependencies.js +4 -0
- package/dist/_virtual/dependencies.js.map +1 -0
- package/dist/_virtual/draft7.js +4 -0
- package/dist/_virtual/draft7.js.map +1 -0
- package/dist/_virtual/enum.js +4 -0
- package/dist/_virtual/enum.js.map +1 -0
- package/dist/_virtual/equal.js +4 -0
- package/dist/_virtual/equal.js.map +1 -0
- package/dist/_virtual/errors.js +4 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/format.js +4 -0
- package/dist/_virtual/format.js.map +1 -0
- package/dist/_virtual/formats.js +4 -0
- package/dist/_virtual/formats.js.map +1 -0
- package/dist/_virtual/id.js +4 -0
- package/dist/_virtual/id.js.map +1 -0
- package/dist/_virtual/if.js +4 -0
- package/dist/_virtual/if.js.map +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index10.js +4 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +4 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.js +4 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +4 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +4 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +4 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +4 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +4 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +4 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/items.js +4 -0
- package/dist/_virtual/items.js.map +1 -0
- package/dist/_virtual/items2020.js +4 -0
- package/dist/_virtual/items2020.js.map +1 -0
- package/dist/_virtual/keyword.js +4 -0
- package/dist/_virtual/keyword.js.map +1 -0
- package/dist/_virtual/limit.js +4 -0
- package/dist/_virtual/limit.js.map +1 -0
- package/dist/_virtual/limitItems.js +4 -0
- package/dist/_virtual/limitItems.js.map +1 -0
- package/dist/_virtual/limitLength.js +4 -0
- package/dist/_virtual/limitLength.js.map +1 -0
- package/dist/_virtual/limitNumber.js +4 -0
- package/dist/_virtual/limitNumber.js.map +1 -0
- package/dist/_virtual/limitProperties.js +4 -0
- package/dist/_virtual/limitProperties.js.map +1 -0
- package/dist/_virtual/metadata.js +4 -0
- package/dist/_virtual/metadata.js.map +1 -0
- package/dist/_virtual/multipleOf.js +4 -0
- package/dist/_virtual/multipleOf.js.map +1 -0
- package/dist/_virtual/names.js +4 -0
- package/dist/_virtual/names.js.map +1 -0
- package/dist/_virtual/not.js +4 -0
- package/dist/_virtual/not.js.map +1 -0
- package/dist/_virtual/oneOf.js +4 -0
- package/dist/_virtual/oneOf.js.map +1 -0
- package/dist/_virtual/pattern.js +4 -0
- package/dist/_virtual/pattern.js.map +1 -0
- package/dist/_virtual/patternProperties.js +4 -0
- package/dist/_virtual/patternProperties.js.map +1 -0
- package/dist/_virtual/prefixItems.js +4 -0
- package/dist/_virtual/prefixItems.js.map +1 -0
- package/dist/_virtual/properties.js +4 -0
- package/dist/_virtual/properties.js.map +1 -0
- package/dist/_virtual/propertyNames.js +4 -0
- package/dist/_virtual/propertyNames.js.map +1 -0
- package/dist/_virtual/ref.js +4 -0
- package/dist/_virtual/ref.js.map +1 -0
- package/dist/_virtual/ref_error.js +4 -0
- package/dist/_virtual/ref_error.js.map +1 -0
- package/dist/_virtual/required.js +4 -0
- package/dist/_virtual/required.js.map +1 -0
- package/dist/_virtual/resolve.js +4 -0
- package/dist/_virtual/resolve.js.map +1 -0
- package/dist/_virtual/rules.js +4 -0
- package/dist/_virtual/rules.js.map +1 -0
- package/dist/_virtual/scope.js +4 -0
- package/dist/_virtual/scope.js.map +1 -0
- package/dist/_virtual/subschema.js +4 -0
- package/dist/_virtual/subschema.js.map +1 -0
- package/dist/_virtual/thenElse.js +4 -0
- package/dist/_virtual/thenElse.js.map +1 -0
- package/dist/_virtual/types.js +4 -0
- package/dist/_virtual/types.js.map +1 -0
- package/dist/_virtual/ucs2length.js +4 -0
- package/dist/_virtual/ucs2length.js.map +1 -0
- package/dist/_virtual/uniqueItems.js +4 -0
- package/dist/_virtual/uniqueItems.js.map +1 -0
- package/dist/_virtual/uri.js +4 -0
- package/dist/_virtual/uri.js.map +1 -0
- package/dist/_virtual/util.js +4 -0
- package/dist/_virtual/util.js.map +1 -0
- package/dist/_virtual/validation_error.js +4 -0
- package/dist/_virtual/validation_error.js.map +1 -0
- package/dist/claude-cli/cli.js +2294 -2146
- package/dist/example-client.d.ts +3 -0
- package/dist/example-client.d.ts.map +1 -0
- package/dist/index.d.ts +19 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js +610 -0
- package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
- package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js +875 -0
- package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js.map +1 -0
- package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js +66 -0
- package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +23 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +331 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +717 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +221 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +56 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +440 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +94 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1610 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +91 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js +133 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js +9 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js +9 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js +112 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js +136 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js +112 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js +3297 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js +44 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js +36 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js +10 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js +657 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js +449 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js +413 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js +57 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js +38 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js +86 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js +61 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js +80 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js +52 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js +1307 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js +842 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js +335 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js +8 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js +51 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js.map +1 -0
- package/dist/node_modules/ajv/dist/ajv.js +69 -0
- package/dist/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js +169 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js +712 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/errors.js +140 -0
- package/dist/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/index.js +253 -0
- package/dist/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/names.js +40 -0
- package/dist/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js +25 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js +162 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/rules.js +29 -0
- package/dist/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/util.js +183 -0
- package/dist/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js +213 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js +49 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js +544 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js +95 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/ajv/dist/core.js +639 -0
- package/dist/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js +31 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +254 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js +9 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js +25 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js +8 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js +22 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +53 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +112 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +26 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +14 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +99 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +93 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +70 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +77 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +57 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +37 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +29 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +64 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +80 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +15 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +61 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +42 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +16 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js +146 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js +11 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +21 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +131 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +113 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +12 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js +28 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js +94 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +9 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js +21 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +31 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +54 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +26 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +33 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +29 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +26 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +28 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +27 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +84 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +72 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/formats.js +212 -0
- package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/index.js +52 -0
- package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/limit.js +75 -0
- package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/dist/node_modules/diff/libesm/diff/base.js +256 -0
- package/dist/node_modules/diff/libesm/diff/base.js.map +1 -0
- package/dist/node_modules/diff/libesm/diff/line.js +64 -0
- package/dist/node_modules/diff/libesm/diff/line.js.map +1 -0
- package/dist/node_modules/diff/libesm/patch/create.js +185 -0
- package/dist/node_modules/diff/libesm/patch/create.js.map +1 -0
- package/dist/node_modules/fast-deep-equal/index.js +47 -0
- package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
- package/dist/node_modules/fast-uri/index.js +347 -0
- package/dist/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/schemes.js +255 -0
- package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/utils.js +334 -0
- package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/json-schema-traverse/index.js +98 -0
- package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/rng.js +14 -0
- package/dist/node_modules/uuid/dist/rng.js.map +1 -0
- package/dist/node_modules/uuid/dist/stringify.js +29 -0
- package/dist/node_modules/uuid/dist/stringify.js.map +1 -0
- package/dist/node_modules/uuid/dist/v7.js +65 -0
- package/dist/node_modules/uuid/dist/v7.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +37 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +26 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +17 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +11 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +66 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +21 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +30 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +53 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +50 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +11 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +11 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +9 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +56 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +24 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +30 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +19 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +15 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +13 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +37 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +56 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +76 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +25 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +24 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +65 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +24 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +350 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +36 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +10 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +84 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +109 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +90 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js +42 -0
- package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js.map +1 -0
- package/dist/package.json.js +8 -0
- package/dist/package.json.js.map +1 -0
- package/dist/src/acp-extensions.d.ts +91 -0
- package/dist/src/acp-extensions.d.ts.map +1 -0
- package/dist/src/acp-extensions.js +38 -0
- package/dist/src/acp-extensions.js.map +1 -0
- package/dist/src/adapters/claude/claude.d.ts +136 -0
- package/dist/src/adapters/claude/claude.d.ts.map +1 -0
- package/dist/src/adapters/claude/claude.js +1112 -0
- package/dist/src/adapters/claude/claude.js.map +1 -0
- package/dist/src/adapters/claude/mcp-server.d.ts +30 -0
- package/dist/src/adapters/claude/mcp-server.d.ts.map +1 -0
- package/dist/src/adapters/claude/mcp-server.js +655 -0
- package/dist/src/adapters/claude/mcp-server.js.map +1 -0
- package/dist/src/adapters/claude/tools.d.ts +35 -0
- package/dist/src/adapters/claude/tools.d.ts.map +1 -0
- package/dist/src/adapters/claude/tools.js +466 -0
- package/dist/src/adapters/claude/tools.js.map +1 -0
- package/dist/src/adapters/claude/utils.d.ts +48 -0
- package/dist/src/adapters/claude/utils.d.ts.map +1 -0
- package/dist/src/adapters/claude/utils.js +158 -0
- package/dist/src/adapters/claude/utils.js.map +1 -0
- package/dist/src/agent.d.ts +18 -28
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +195 -175
- package/dist/src/agent.js.map +1 -1
- package/dist/src/agents/execution.js.map +1 -1
- package/dist/src/agents/planning.js.map +1 -1
- package/dist/src/agents/research.js.map +1 -1
- package/dist/src/file-manager.d.ts +6 -6
- package/dist/src/file-manager.d.ts.map +1 -1
- package/dist/src/file-manager.js +72 -63
- package/dist/src/file-manager.js.map +1 -1
- package/dist/src/git-manager.d.ts +2 -1
- package/dist/src/git-manager.d.ts.map +1 -1
- package/dist/src/git-manager.js +105 -70
- package/dist/src/git-manager.js.map +1 -1
- package/dist/src/posthog-api.d.ts +8 -14
- package/dist/src/posthog-api.d.ts.map +1 -1
- package/dist/src/posthog-api.js +35 -23
- package/dist/src/posthog-api.js.map +1 -1
- package/dist/src/prompt-builder.d.ts +4 -4
- package/dist/src/prompt-builder.d.ts.map +1 -1
- package/dist/src/prompt-builder.js +129 -99
- package/dist/src/prompt-builder.js.map +1 -1
- package/dist/src/schemas.d.ts +980 -0
- package/dist/src/schemas.d.ts.map +1 -0
- package/dist/src/schemas.js +196 -0
- package/dist/src/schemas.js.map +1 -0
- package/dist/src/session-store.d.ts +53 -0
- package/dist/src/session-store.d.ts.map +1 -0
- package/dist/src/session-store.js +195 -0
- package/dist/src/session-store.js.map +1 -0
- package/dist/src/task-manager.d.ts +7 -7
- package/dist/src/task-manager.d.ts.map +1 -1
- package/dist/src/task-manager.js +19 -18
- package/dist/src/task-manager.js.map +1 -1
- package/dist/src/template-manager.d.ts +1 -1
- package/dist/src/template-manager.d.ts.map +1 -1
- package/dist/src/template-manager.js +30 -28
- package/dist/src/template-manager.js.map +1 -1
- package/dist/src/todo-manager.d.ts +5 -5
- package/dist/src/todo-manager.d.ts.map +1 -1
- package/dist/src/todo-manager.js +33 -24
- package/dist/src/todo-manager.js.map +1 -1
- package/dist/src/tools/registry.d.ts +1 -1
- package/dist/src/tools/registry.js +60 -60
- package/dist/src/tools/registry.js.map +1 -1
- package/dist/src/tools/types.d.ts +31 -31
- package/dist/src/types.d.ts +62 -167
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +1 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/logger.d.ts +14 -6
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/logger.js +37 -22
- package/dist/src/utils/logger.js.map +1 -1
- package/dist/src/utils/tapped-stream.d.ts +17 -0
- package/dist/src/utils/tapped-stream.d.ts.map +1 -0
- package/dist/src/utils/tapped-stream.js +45 -0
- package/dist/src/utils/tapped-stream.js.map +1 -0
- package/dist/src/workflow/config.d.ts +1 -1
- package/dist/src/workflow/config.d.ts.map +1 -1
- package/dist/src/workflow/config.js +18 -18
- package/dist/src/workflow/config.js.map +1 -1
- package/dist/src/workflow/steps/build.d.ts +1 -1
- package/dist/src/workflow/steps/build.d.ts.map +1 -1
- package/dist/src/workflow/steps/build.js +53 -39
- package/dist/src/workflow/steps/build.js.map +1 -1
- package/dist/src/workflow/steps/finalize.d.ts +1 -1
- package/dist/src/workflow/steps/finalize.d.ts.map +1 -1
- package/dist/src/workflow/steps/finalize.js +58 -52
- package/dist/src/workflow/steps/finalize.js.map +1 -1
- package/dist/src/workflow/steps/plan.d.ts +1 -1
- package/dist/src/workflow/steps/plan.d.ts.map +1 -1
- package/dist/src/workflow/steps/plan.js +69 -47
- package/dist/src/workflow/steps/plan.js.map +1 -1
- package/dist/src/workflow/steps/research.d.ts +1 -1
- package/dist/src/workflow/steps/research.d.ts.map +1 -1
- package/dist/src/workflow/steps/research.js +86 -67
- package/dist/src/workflow/steps/research.js.map +1 -1
- package/dist/src/workflow/types.d.ts +19 -14
- package/dist/src/workflow/types.d.ts.map +1 -1
- package/dist/src/workflow/utils.d.ts +1 -1
- package/dist/src/workflow/utils.d.ts.map +1 -1
- package/dist/src/workflow/utils.js +7 -4
- package/dist/src/workflow/utils.js.map +1 -1
- package/dist/src/worktree-manager.d.ts +39 -0
- package/dist/src/worktree-manager.d.ts.map +1 -0
- package/dist/src/worktree-manager.js +810 -0
- package/dist/src/worktree-manager.js.map +1 -0
- package/package.json +20 -16
- package/src/acp-extensions.ts +117 -0
- package/src/adapters/claude/claude.ts +1498 -0
- package/src/adapters/claude/mcp-server.ts +810 -0
- package/src/adapters/claude/tools.ts +609 -0
- package/src/adapters/claude/utils.ts +267 -0
- package/src/agent.ts +511 -447
- package/src/agents/execution.ts +1 -1
- package/src/agents/planning.ts +1 -1
- package/src/agents/research.ts +0 -1
- package/src/file-manager.ts +80 -70
- package/src/git-manager.ts +164 -88
- package/src/posthog-api.ts +155 -94
- package/src/prompt-builder.ts +196 -143
- package/src/schemas.ts +241 -0
- package/src/session-store.ts +244 -0
- package/src/task-manager.ts +41 -33
- package/src/template-manager.ts +98 -45
- package/src/todo-manager.ts +43 -32
- package/src/tools/registry.ts +62 -62
- package/src/tools/types.ts +36 -36
- package/src/types.ts +130 -239
- package/src/utils/logger.ts +89 -58
- package/src/utils/tapped-stream.ts +60 -0
- package/src/workflow/config.ts +48 -48
- package/src/workflow/steps/build.ts +127 -113
- package/src/workflow/steps/finalize.ts +207 -182
- package/src/workflow/steps/plan.ts +155 -130
- package/src/workflow/steps/research.ts +207 -187
- package/src/workflow/types.ts +47 -36
- package/src/workflow/utils.ts +37 -34
- package/src/worktree-manager.ts +884 -0
- package/dist/src/adapters/claude/claude-adapter.d.ts +0 -18
- package/dist/src/adapters/claude/claude-adapter.d.ts.map +0 -1
- package/dist/src/adapters/claude/claude-adapter.js +0 -311
- package/dist/src/adapters/claude/claude-adapter.js.map +0 -1
- package/dist/src/adapters/claude/tool-mapper.d.ts +0 -19
- package/dist/src/adapters/claude/tool-mapper.d.ts.map +0 -1
- package/dist/src/adapters/claude/tool-mapper.js +0 -44
- package/dist/src/adapters/claude/tool-mapper.js.map +0 -1
- package/dist/src/adapters/types.d.ts +0 -33
- package/dist/src/adapters/types.d.ts.map +0 -1
- package/dist/src/task-progress-reporter.d.ts +0 -43
- package/dist/src/task-progress-reporter.d.ts.map +0 -1
- package/dist/src/task-progress-reporter.js +0 -393
- package/dist/src/task-progress-reporter.js.map +0 -1
- package/src/adapters/claude/claude-adapter.ts +0 -338
- package/src/adapters/claude/tool-mapper.ts +0 -46
- package/src/adapters/types.ts +0 -37
- package/src/task-progress-reporter.ts +0 -443
package/src/git-manager.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { exec } from
|
|
2
|
-
import { promisify } from
|
|
3
|
-
import { Logger } from
|
|
1
|
+
import { exec } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { Logger } from "./utils/logger.js";
|
|
4
4
|
|
|
5
5
|
const execAsync = promisify(exec);
|
|
6
6
|
|
|
@@ -27,20 +27,23 @@ export class GitManager {
|
|
|
27
27
|
this.repositoryPath = config.repositoryPath;
|
|
28
28
|
this.authorName = config.authorName;
|
|
29
29
|
this.authorEmail = config.authorEmail;
|
|
30
|
-
this.logger =
|
|
30
|
+
this.logger =
|
|
31
|
+
config.logger || new Logger({ debug: false, prefix: "[GitManager]" });
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
private escapeShellArg(str: string): string {
|
|
34
35
|
return str
|
|
35
|
-
.replace(/\\/g,
|
|
36
|
+
.replace(/\\/g, "\\\\")
|
|
36
37
|
.replace(/"/g, '\\"')
|
|
37
|
-
.replace(/`/g,
|
|
38
|
-
.replace(/\$/g,
|
|
38
|
+
.replace(/`/g, "\\`")
|
|
39
|
+
.replace(/\$/g, "\\$");
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
private async runGitCommand(command: string): Promise<string> {
|
|
42
43
|
try {
|
|
43
|
-
const { stdout } = await execAsync(
|
|
44
|
+
const { stdout } = await execAsync(
|
|
45
|
+
`cd "${this.repositoryPath}" && git ${command}`,
|
|
46
|
+
);
|
|
44
47
|
return stdout.trim();
|
|
45
48
|
} catch (error) {
|
|
46
49
|
throw new Error(`Git command failed: ${command}\n${error}`);
|
|
@@ -49,7 +52,9 @@ export class GitManager {
|
|
|
49
52
|
|
|
50
53
|
private async runCommand(command: string): Promise<string> {
|
|
51
54
|
try {
|
|
52
|
-
const { stdout } = await execAsync(
|
|
55
|
+
const { stdout } = await execAsync(
|
|
56
|
+
`cd "${this.repositoryPath}" && ${command}`,
|
|
57
|
+
);
|
|
53
58
|
return stdout.trim();
|
|
54
59
|
} catch (error) {
|
|
55
60
|
throw new Error(`Command failed: ${command}\n${error}`);
|
|
@@ -58,7 +63,7 @@ export class GitManager {
|
|
|
58
63
|
|
|
59
64
|
async isGitRepository(): Promise<boolean> {
|
|
60
65
|
try {
|
|
61
|
-
await this.runGitCommand(
|
|
66
|
+
await this.runGitCommand("rev-parse --git-dir");
|
|
62
67
|
return true;
|
|
63
68
|
} catch {
|
|
64
69
|
return false;
|
|
@@ -66,22 +71,26 @@ export class GitManager {
|
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
async getCurrentBranch(): Promise<string> {
|
|
69
|
-
return await this.runGitCommand(
|
|
74
|
+
return await this.runGitCommand("branch --show-current");
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
async getDefaultBranch(): Promise<string> {
|
|
73
78
|
try {
|
|
74
79
|
// Try to get the default branch from remote
|
|
75
|
-
const remoteBranch = await this.runGitCommand(
|
|
76
|
-
|
|
80
|
+
const remoteBranch = await this.runGitCommand(
|
|
81
|
+
"symbolic-ref refs/remotes/origin/HEAD",
|
|
82
|
+
);
|
|
83
|
+
return remoteBranch.replace("refs/remotes/origin/", "");
|
|
77
84
|
} catch {
|
|
78
85
|
// Fallback: check if main exists, otherwise use master
|
|
79
|
-
if (await this.branchExists(
|
|
80
|
-
return
|
|
81
|
-
} else if (await this.branchExists(
|
|
82
|
-
return
|
|
86
|
+
if (await this.branchExists("main")) {
|
|
87
|
+
return "main";
|
|
88
|
+
} else if (await this.branchExists("master")) {
|
|
89
|
+
return "master";
|
|
83
90
|
} else {
|
|
84
|
-
throw new Error(
|
|
91
|
+
throw new Error(
|
|
92
|
+
"Cannot determine default branch. No main or master branch found.",
|
|
93
|
+
);
|
|
85
94
|
}
|
|
86
95
|
}
|
|
87
96
|
}
|
|
@@ -96,7 +105,7 @@ export class GitManager {
|
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
async createBranch(branchName: string, baseBranch?: string): Promise<void> {
|
|
99
|
-
const base = baseBranch || await this.getCurrentBranch();
|
|
108
|
+
const base = baseBranch || (await this.getCurrentBranch());
|
|
100
109
|
await this.runGitCommand(`checkout -b ${branchName} ${base}`);
|
|
101
110
|
}
|
|
102
111
|
|
|
@@ -109,25 +118,31 @@ export class GitManager {
|
|
|
109
118
|
const defaultBranch = await this.getDefaultBranch();
|
|
110
119
|
|
|
111
120
|
if (currentBranch === defaultBranch) {
|
|
112
|
-
this.logger.debug(
|
|
121
|
+
this.logger.debug("Already on default branch", { branch: defaultBranch });
|
|
113
122
|
return true;
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
if (await this.hasChanges()) {
|
|
117
|
-
this.logger.warn(
|
|
126
|
+
this.logger.warn("Skipping branch reset - uncommitted changes present", {
|
|
118
127
|
currentBranch,
|
|
119
|
-
defaultBranch
|
|
128
|
+
defaultBranch,
|
|
120
129
|
});
|
|
121
130
|
return false;
|
|
122
131
|
}
|
|
123
132
|
|
|
124
133
|
await this.switchToBranch(defaultBranch);
|
|
125
|
-
this.logger.info(
|
|
134
|
+
this.logger.info("Reset to default branch", {
|
|
135
|
+
from: currentBranch,
|
|
136
|
+
to: defaultBranch,
|
|
137
|
+
});
|
|
126
138
|
return true;
|
|
127
139
|
}
|
|
128
140
|
|
|
129
|
-
async createOrSwitchToBranch(
|
|
130
|
-
|
|
141
|
+
async createOrSwitchToBranch(
|
|
142
|
+
branchName: string,
|
|
143
|
+
baseBranch?: string,
|
|
144
|
+
): Promise<void> {
|
|
145
|
+
await this.ensureCleanWorkingDirectory("switching branches");
|
|
131
146
|
|
|
132
147
|
const exists = await this.branchExists(branchName);
|
|
133
148
|
if (exists) {
|
|
@@ -138,38 +153,41 @@ export class GitManager {
|
|
|
138
153
|
}
|
|
139
154
|
|
|
140
155
|
async addFiles(paths: string[]): Promise<void> {
|
|
141
|
-
const pathList = paths.map(p => `"${this.escapeShellArg(p)}"`).join(
|
|
156
|
+
const pathList = paths.map((p) => `"${this.escapeShellArg(p)}"`).join(" ");
|
|
142
157
|
await this.runGitCommand(`add ${pathList}`);
|
|
143
158
|
}
|
|
144
159
|
|
|
145
160
|
async addAllPostHogFiles(): Promise<void> {
|
|
146
161
|
try {
|
|
147
162
|
// Use -A flag to add all changes (including new files) and ignore errors if directory is empty
|
|
148
|
-
await this.runGitCommand(
|
|
163
|
+
await this.runGitCommand("add -A .posthog/");
|
|
149
164
|
} catch (error) {
|
|
150
165
|
// If the directory doesn't exist or has no files, that's fine - just log and continue
|
|
151
|
-
this.logger.debug(
|
|
166
|
+
this.logger.debug("No PostHog files to add", { error });
|
|
152
167
|
}
|
|
153
168
|
}
|
|
154
169
|
|
|
155
|
-
async commitChanges(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
170
|
+
async commitChanges(
|
|
171
|
+
message: string,
|
|
172
|
+
options?: {
|
|
173
|
+
authorName?: string;
|
|
174
|
+
authorEmail?: string;
|
|
175
|
+
},
|
|
176
|
+
): Promise<string> {
|
|
159
177
|
const command = this.buildCommitCommand(message, options);
|
|
160
178
|
return await this.runGitCommand(command);
|
|
161
179
|
}
|
|
162
180
|
|
|
163
181
|
async hasChanges(): Promise<boolean> {
|
|
164
182
|
try {
|
|
165
|
-
const status = await this.runGitCommand(
|
|
183
|
+
const status = await this.runGitCommand("status --porcelain");
|
|
166
184
|
if (!status || status.trim().length === 0) {
|
|
167
185
|
return false;
|
|
168
186
|
}
|
|
169
187
|
|
|
170
|
-
const lines = status.split(
|
|
188
|
+
const lines = status.split("\n").filter((line) => {
|
|
171
189
|
const trimmed = line.trim();
|
|
172
|
-
return trimmed.length > 0 && !trimmed.includes(
|
|
190
|
+
return trimmed.length > 0 && !trimmed.includes(".posthog/");
|
|
173
191
|
});
|
|
174
192
|
|
|
175
193
|
return lines.length > 0;
|
|
@@ -180,7 +198,7 @@ export class GitManager {
|
|
|
180
198
|
|
|
181
199
|
async hasStagedChanges(): Promise<boolean> {
|
|
182
200
|
try {
|
|
183
|
-
const status = await this.runGitCommand(
|
|
201
|
+
const status = await this.runGitCommand("diff --cached --name-only");
|
|
184
202
|
return status.length > 0;
|
|
185
203
|
} catch {
|
|
186
204
|
return false;
|
|
@@ -190,12 +208,14 @@ export class GitManager {
|
|
|
190
208
|
// Helper: Centralized safety check for uncommitted changes
|
|
191
209
|
private async ensureCleanWorkingDirectory(operation: string): Promise<void> {
|
|
192
210
|
if (await this.hasChanges()) {
|
|
193
|
-
throw new Error(
|
|
211
|
+
throw new Error(
|
|
212
|
+
`Uncommitted changes detected. Please commit or stash changes before ${operation}.`,
|
|
213
|
+
);
|
|
194
214
|
}
|
|
195
215
|
}
|
|
196
216
|
|
|
197
217
|
private async generateUniqueBranchName(baseName: string): Promise<string> {
|
|
198
|
-
if (!await this.branchExists(baseName)) {
|
|
218
|
+
if (!(await this.branchExists(baseName))) {
|
|
199
219
|
return baseName;
|
|
200
220
|
}
|
|
201
221
|
|
|
@@ -213,18 +233,25 @@ export class GitManager {
|
|
|
213
233
|
const currentBranch = await this.getCurrentBranch();
|
|
214
234
|
|
|
215
235
|
if (currentBranch !== defaultBranch) {
|
|
216
|
-
await this.ensureCleanWorkingDirectory(
|
|
236
|
+
await this.ensureCleanWorkingDirectory("switching to default branch");
|
|
217
237
|
await this.switchToBranch(defaultBranch);
|
|
218
238
|
}
|
|
219
239
|
|
|
220
240
|
return defaultBranch;
|
|
221
241
|
}
|
|
222
242
|
|
|
223
|
-
private buildCommitCommand(
|
|
243
|
+
private buildCommitCommand(
|
|
244
|
+
message: string,
|
|
245
|
+
options?: {
|
|
246
|
+
allowEmpty?: boolean;
|
|
247
|
+
authorName?: string;
|
|
248
|
+
authorEmail?: string;
|
|
249
|
+
},
|
|
250
|
+
): string {
|
|
224
251
|
let command = `commit -m "${this.escapeShellArg(message)}"`;
|
|
225
252
|
|
|
226
253
|
if (options?.allowEmpty) {
|
|
227
|
-
command +=
|
|
254
|
+
command += " --allow-empty";
|
|
228
255
|
}
|
|
229
256
|
|
|
230
257
|
const authorName = options?.authorName || this.authorName;
|
|
@@ -239,14 +266,14 @@ export class GitManager {
|
|
|
239
266
|
|
|
240
267
|
async getRemoteUrl(): Promise<string | null> {
|
|
241
268
|
try {
|
|
242
|
-
return await this.runGitCommand(
|
|
269
|
+
return await this.runGitCommand("remote get-url origin");
|
|
243
270
|
} catch {
|
|
244
271
|
return null;
|
|
245
272
|
}
|
|
246
273
|
}
|
|
247
274
|
|
|
248
275
|
async pushBranch(branchName: string, force: boolean = false): Promise<void> {
|
|
249
|
-
const forceFlag = force ?
|
|
276
|
+
const forceFlag = force ? "--force" : "";
|
|
250
277
|
await this.runGitCommand(`push ${forceFlag} -u origin ${branchName}`);
|
|
251
278
|
}
|
|
252
279
|
|
|
@@ -265,11 +292,11 @@ export class GitManager {
|
|
|
265
292
|
push?: boolean;
|
|
266
293
|
}) => Promise<{ commitCreated: boolean; pushedBranch: boolean }>;
|
|
267
294
|
}> {
|
|
268
|
-
const initialSha = await this.getCommitSha(
|
|
295
|
+
const initialSha = await this.getCommitSha("HEAD");
|
|
269
296
|
|
|
270
297
|
return {
|
|
271
298
|
finalize: async (options) => {
|
|
272
|
-
const currentSha = await this.getCommitSha(
|
|
299
|
+
const currentSha = await this.getCommitSha("HEAD");
|
|
273
300
|
const externalCommitsCreated = initialSha !== currentSha;
|
|
274
301
|
const hasUncommittedChanges = await this.hasChanges();
|
|
275
302
|
|
|
@@ -282,7 +309,7 @@ export class GitManager {
|
|
|
282
309
|
|
|
283
310
|
// Commit any remaining uncommitted changes
|
|
284
311
|
if (hasUncommittedChanges) {
|
|
285
|
-
await this.runGitCommand(
|
|
312
|
+
await this.runGitCommand("add .");
|
|
286
313
|
const hasStagedChanges = await this.hasStagedChanges();
|
|
287
314
|
|
|
288
315
|
if (hasStagedChanges) {
|
|
@@ -297,11 +324,13 @@ export class GitManager {
|
|
|
297
324
|
const currentBranch = await this.getCurrentBranch();
|
|
298
325
|
await this.pushBranch(currentBranch);
|
|
299
326
|
pushedBranch = true;
|
|
300
|
-
this.logger.info(
|
|
327
|
+
this.logger.info("Pushed branch after operation", {
|
|
328
|
+
branch: currentBranch,
|
|
329
|
+
});
|
|
301
330
|
}
|
|
302
331
|
|
|
303
332
|
return { commitCreated, pushedBranch };
|
|
304
|
-
}
|
|
333
|
+
},
|
|
305
334
|
};
|
|
306
335
|
}
|
|
307
336
|
|
|
@@ -311,10 +340,10 @@ export class GitManager {
|
|
|
311
340
|
// Ensure we're on default branch before creating task branch
|
|
312
341
|
const defaultBranch = await this.ensureOnDefaultBranch();
|
|
313
342
|
|
|
314
|
-
this.logger.info(
|
|
343
|
+
this.logger.info("Creating task branch from default branch", {
|
|
315
344
|
branchName,
|
|
316
345
|
taskSlug,
|
|
317
|
-
baseBranch: defaultBranch
|
|
346
|
+
baseBranch: defaultBranch,
|
|
318
347
|
});
|
|
319
348
|
|
|
320
349
|
await this.createOrSwitchToBranch(branchName, defaultBranch);
|
|
@@ -322,26 +351,35 @@ export class GitManager {
|
|
|
322
351
|
return branchName;
|
|
323
352
|
}
|
|
324
353
|
|
|
325
|
-
async createTaskPlanningBranch(
|
|
354
|
+
async createTaskPlanningBranch(
|
|
355
|
+
taskId: string,
|
|
356
|
+
baseBranch?: string,
|
|
357
|
+
): Promise<string> {
|
|
326
358
|
const baseName = `posthog/task-${taskId}-planning`;
|
|
327
359
|
const branchName = await this.generateUniqueBranchName(baseName);
|
|
328
360
|
|
|
329
|
-
this.logger.debug(
|
|
361
|
+
this.logger.debug("Creating unique planning branch", {
|
|
362
|
+
branchName,
|
|
363
|
+
taskId,
|
|
364
|
+
});
|
|
330
365
|
|
|
331
|
-
const base = baseBranch || await this.ensureOnDefaultBranch();
|
|
366
|
+
const base = baseBranch || (await this.ensureOnDefaultBranch());
|
|
332
367
|
await this.createBranch(branchName, base);
|
|
333
368
|
|
|
334
369
|
return branchName;
|
|
335
370
|
}
|
|
336
371
|
|
|
337
|
-
async createTaskImplementationBranch(
|
|
372
|
+
async createTaskImplementationBranch(
|
|
373
|
+
taskId: string,
|
|
374
|
+
planningBranchName?: string,
|
|
375
|
+
): Promise<string> {
|
|
338
376
|
const baseName = `posthog/task-${taskId}-implementation`;
|
|
339
377
|
const branchName = await this.generateUniqueBranchName(baseName);
|
|
340
378
|
|
|
341
|
-
this.logger.debug(
|
|
379
|
+
this.logger.debug("Creating unique implementation branch", {
|
|
342
380
|
branchName,
|
|
343
381
|
taskId,
|
|
344
|
-
currentBranch: await this.getCurrentBranch()
|
|
382
|
+
currentBranch: await this.getCurrentBranch(),
|
|
345
383
|
});
|
|
346
384
|
|
|
347
385
|
// Determine base branch: explicit param > current planning branch > default
|
|
@@ -349,21 +387,24 @@ export class GitManager {
|
|
|
349
387
|
|
|
350
388
|
if (!baseBranch) {
|
|
351
389
|
const currentBranch = await this.getCurrentBranch();
|
|
352
|
-
if (currentBranch.includes(
|
|
390
|
+
if (currentBranch.includes("-planning")) {
|
|
353
391
|
baseBranch = currentBranch;
|
|
354
|
-
this.logger.debug(
|
|
392
|
+
this.logger.debug("Using current planning branch", { baseBranch });
|
|
355
393
|
} else {
|
|
356
394
|
baseBranch = await this.ensureOnDefaultBranch();
|
|
357
|
-
this.logger.debug(
|
|
395
|
+
this.logger.debug("Using default branch", { baseBranch });
|
|
358
396
|
}
|
|
359
397
|
}
|
|
360
398
|
|
|
361
|
-
this.logger.debug(
|
|
399
|
+
this.logger.debug("Creating implementation branch from base", {
|
|
400
|
+
baseBranch,
|
|
401
|
+
branchName,
|
|
402
|
+
});
|
|
362
403
|
await this.createBranch(branchName, baseBranch);
|
|
363
404
|
|
|
364
|
-
this.logger.info(
|
|
405
|
+
this.logger.info("Implementation branch created", {
|
|
365
406
|
branchName,
|
|
366
|
-
currentBranch: await this.getCurrentBranch()
|
|
407
|
+
currentBranch: await this.getCurrentBranch(),
|
|
367
408
|
});
|
|
368
409
|
|
|
369
410
|
return branchName;
|
|
@@ -371,16 +412,16 @@ export class GitManager {
|
|
|
371
412
|
|
|
372
413
|
async commitPlan(taskId: string, taskTitle: string): Promise<string> {
|
|
373
414
|
const currentBranch = await this.getCurrentBranch();
|
|
374
|
-
this.logger.debug(
|
|
415
|
+
this.logger.debug("Committing plan", { taskId, currentBranch });
|
|
375
416
|
|
|
376
417
|
await this.addAllPostHogFiles();
|
|
377
418
|
|
|
378
419
|
const hasChanges = await this.hasStagedChanges();
|
|
379
|
-
this.logger.debug(
|
|
420
|
+
this.logger.debug("Checking for staged changes", { hasChanges });
|
|
380
421
|
|
|
381
422
|
if (!hasChanges) {
|
|
382
|
-
this.logger.info(
|
|
383
|
-
return
|
|
423
|
+
this.logger.info("No plan changes to commit", { taskId });
|
|
424
|
+
return "No changes to commit";
|
|
384
425
|
}
|
|
385
426
|
|
|
386
427
|
const message = `📋 Add plan for task: ${taskTitle}
|
|
@@ -392,17 +433,21 @@ This commit contains the implementation plan and supporting documentation
|
|
|
392
433
|
for the task. Review the plan before proceeding with implementation.`;
|
|
393
434
|
|
|
394
435
|
const result = await this.commitChanges(message);
|
|
395
|
-
this.logger.info(
|
|
436
|
+
this.logger.info("Plan committed", { taskId, taskTitle });
|
|
396
437
|
return result;
|
|
397
438
|
}
|
|
398
439
|
|
|
399
|
-
async commitImplementation(
|
|
400
|
-
|
|
440
|
+
async commitImplementation(
|
|
441
|
+
taskId: string,
|
|
442
|
+
taskTitle: string,
|
|
443
|
+
planSummary?: string,
|
|
444
|
+
): Promise<string> {
|
|
445
|
+
await this.runGitCommand("add .");
|
|
401
446
|
|
|
402
447
|
const hasChanges = await this.hasStagedChanges();
|
|
403
448
|
if (!hasChanges) {
|
|
404
|
-
this.logger.warn(
|
|
405
|
-
return
|
|
449
|
+
this.logger.warn("No implementation changes to commit", { taskId });
|
|
450
|
+
return "No changes to commit";
|
|
406
451
|
}
|
|
407
452
|
|
|
408
453
|
let message = `✨ Implement task: ${taskTitle}
|
|
@@ -417,12 +462,15 @@ Generated by PostHog Agent`;
|
|
|
417
462
|
message += `\n\nThis commit implements the changes described in the task plan.`;
|
|
418
463
|
|
|
419
464
|
const result = await this.commitChanges(message);
|
|
420
|
-
this.logger.info(
|
|
465
|
+
this.logger.info("Implementation committed", { taskId, taskTitle });
|
|
421
466
|
return result;
|
|
422
467
|
}
|
|
423
468
|
|
|
424
|
-
async deleteBranch(
|
|
425
|
-
|
|
469
|
+
async deleteBranch(
|
|
470
|
+
branchName: string,
|
|
471
|
+
force: boolean = false,
|
|
472
|
+
): Promise<void> {
|
|
473
|
+
const forceFlag = force ? "-D" : "-d";
|
|
426
474
|
await this.runGitCommand(`branch ${forceFlag} ${branchName}`);
|
|
427
475
|
}
|
|
428
476
|
|
|
@@ -437,15 +485,15 @@ Generated by PostHog Agent`;
|
|
|
437
485
|
return {
|
|
438
486
|
name: branchName,
|
|
439
487
|
exists,
|
|
440
|
-
isCurrentBranch: branchName === currentBranch
|
|
488
|
+
isCurrentBranch: branchName === currentBranch,
|
|
441
489
|
};
|
|
442
490
|
}
|
|
443
491
|
|
|
444
|
-
async getCommitSha(ref: string =
|
|
492
|
+
async getCommitSha(ref: string = "HEAD"): Promise<string> {
|
|
445
493
|
return await this.runGitCommand(`rev-parse ${ref}`);
|
|
446
494
|
}
|
|
447
495
|
|
|
448
|
-
async getCommitMessage(ref: string =
|
|
496
|
+
async getCommitMessage(ref: string = "HEAD"): Promise<string> {
|
|
449
497
|
return await this.runGitCommand(`log -1 --pretty=%B ${ref}`);
|
|
450
498
|
}
|
|
451
499
|
|
|
@@ -453,11 +501,11 @@ Generated by PostHog Agent`;
|
|
|
453
501
|
branchName: string,
|
|
454
502
|
title: string,
|
|
455
503
|
body: string,
|
|
456
|
-
baseBranch?: string
|
|
504
|
+
baseBranch?: string,
|
|
457
505
|
): Promise<string> {
|
|
458
506
|
const currentBranch = await this.getCurrentBranch();
|
|
459
507
|
if (currentBranch !== branchName) {
|
|
460
|
-
await this.ensureCleanWorkingDirectory(
|
|
508
|
+
await this.ensureCleanWorkingDirectory("creating PR");
|
|
461
509
|
await this.switchToBranch(branchName);
|
|
462
510
|
}
|
|
463
511
|
|
|
@@ -480,30 +528,35 @@ Generated by PostHog Agent`;
|
|
|
480
528
|
async getTaskBranch(taskSlug: string): Promise<string | null> {
|
|
481
529
|
try {
|
|
482
530
|
// Get all branches matching the task slug pattern
|
|
483
|
-
const branches = await this.runGitCommand(
|
|
531
|
+
const branches = await this.runGitCommand("branch --list --all");
|
|
484
532
|
const branchPattern = `posthog/task-${taskSlug}`;
|
|
485
|
-
|
|
533
|
+
|
|
486
534
|
// Look for exact match or with counter suffix
|
|
487
|
-
const lines = branches
|
|
535
|
+
const lines = branches
|
|
536
|
+
.split("\n")
|
|
537
|
+
.map((l) => l.trim().replace(/^\*\s+/, ""));
|
|
488
538
|
for (const line of lines) {
|
|
489
|
-
const cleanBranch = line.replace(
|
|
539
|
+
const cleanBranch = line.replace("remotes/origin/", "");
|
|
490
540
|
if (cleanBranch.startsWith(branchPattern)) {
|
|
491
541
|
return cleanBranch;
|
|
492
542
|
}
|
|
493
543
|
}
|
|
494
|
-
|
|
544
|
+
|
|
495
545
|
return null;
|
|
496
546
|
} catch (error) {
|
|
497
|
-
this.logger.debug(
|
|
547
|
+
this.logger.debug("Failed to get task branch", { taskSlug, error });
|
|
498
548
|
return null;
|
|
499
549
|
}
|
|
500
550
|
}
|
|
501
551
|
|
|
502
|
-
async commitAndPush(
|
|
552
|
+
async commitAndPush(
|
|
553
|
+
message: string,
|
|
554
|
+
options?: { allowEmpty?: boolean },
|
|
555
|
+
): Promise<void> {
|
|
503
556
|
const hasChanges = await this.hasStagedChanges();
|
|
504
557
|
|
|
505
558
|
if (!hasChanges && !options?.allowEmpty) {
|
|
506
|
-
this.logger.debug(
|
|
559
|
+
this.logger.debug("No changes to commit, skipping");
|
|
507
560
|
return;
|
|
508
561
|
}
|
|
509
562
|
|
|
@@ -514,6 +567,29 @@ Generated by PostHog Agent`;
|
|
|
514
567
|
const currentBranch = await this.getCurrentBranch();
|
|
515
568
|
await this.pushBranch(currentBranch);
|
|
516
569
|
|
|
517
|
-
this.logger.info(
|
|
570
|
+
this.logger.info("Committed and pushed changes", {
|
|
571
|
+
branch: currentBranch,
|
|
572
|
+
message,
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
async isWorktree(): Promise<boolean> {
|
|
577
|
+
try {
|
|
578
|
+
// In a worktree, .git is a file pointing to the main repo's .git/worktrees/{name}
|
|
579
|
+
// In a normal repo, .git is a directory
|
|
580
|
+
const result = await this.runGitCommand(
|
|
581
|
+
"rev-parse --git-common-dir --git-dir",
|
|
582
|
+
);
|
|
583
|
+
const lines = result.split("\n");
|
|
584
|
+
if (lines.length >= 2) {
|
|
585
|
+
const commonDir = lines[0].trim();
|
|
586
|
+
const gitDir = lines[1].trim();
|
|
587
|
+
// If they're different, we're in a worktree
|
|
588
|
+
return commonDir !== gitDir;
|
|
589
|
+
}
|
|
590
|
+
return false;
|
|
591
|
+
} catch {
|
|
592
|
+
return false;
|
|
593
|
+
}
|
|
518
594
|
}
|
|
519
595
|
}
|