@posthog/agent 1.24.0 → 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/LICENSE +33 -0
- 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 +12 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- 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 +15 -25
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +118 -156
- package/dist/src/agent.js.map +1 -1
- package/dist/src/file-manager.d.ts +2 -2
- package/dist/src/file-manager.d.ts.map +1 -1
- package/dist/src/file-manager.js +13 -5
- package/dist/src/file-manager.js.map +1 -1
- package/dist/src/git-manager.d.ts +1 -0
- package/dist/src/git-manager.d.ts.map +1 -1
- package/dist/src/git-manager.js +18 -0
- package/dist/src/git-manager.js.map +1 -1
- package/dist/src/posthog-api.d.ts +8 -13
- package/dist/src/posthog-api.d.ts.map +1 -1
- package/dist/src/posthog-api.js +14 -2
- package/dist/src/posthog-api.js.map +1 -1
- package/dist/src/prompt-builder.d.ts +2 -2
- package/dist/src/prompt-builder.d.ts.map +1 -1
- package/dist/src/prompt-builder.js +7 -7
- 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 +3 -3
- package/dist/src/task-manager.d.ts.map +1 -1
- package/dist/src/task-manager.js.map +1 -1
- package/dist/src/template-manager.d.ts.map +1 -1
- package/dist/src/template-manager.js +6 -6
- package/dist/src/template-manager.js.map +1 -1
- package/dist/src/todo-manager.d.ts +2 -2
- package/dist/src/todo-manager.d.ts.map +1 -1
- package/dist/src/todo-manager.js +5 -1
- package/dist/src/todo-manager.js.map +1 -1
- package/dist/src/types.d.ts +54 -159
- 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 +10 -2
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/logger.js +35 -20
- 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/steps/build.d.ts.map +1 -1
- package/dist/src/workflow/steps/build.js +15 -9
- package/dist/src/workflow/steps/build.js.map +1 -1
- package/dist/src/workflow/steps/finalize.d.ts.map +1 -1
- package/dist/src/workflow/steps/finalize.js +4 -4
- package/dist/src/workflow/steps/finalize.js.map +1 -1
- package/dist/src/workflow/steps/plan.d.ts.map +1 -1
- package/dist/src/workflow/steps/plan.js +22 -12
- package/dist/src/workflow/steps/plan.js.map +1 -1
- package/dist/src/workflow/steps/research.d.ts.map +1 -1
- package/dist/src/workflow/steps/research.js +33 -26
- package/dist/src/workflow/steps/research.js.map +1 -1
- package/dist/src/workflow/types.d.ts +10 -5
- package/dist/src/workflow/types.d.ts.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 +19 -15
- 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 +151 -222
- package/src/file-manager.ts +16 -7
- package/src/git-manager.ts +20 -0
- package/src/posthog-api.ts +38 -17
- package/src/prompt-builder.ts +23 -15
- package/src/schemas.ts +241 -0
- package/src/session-store.ts +244 -0
- package/src/task-manager.ts +3 -3
- package/src/template-manager.ts +8 -8
- package/src/todo-manager.ts +9 -3
- package/src/types.ts +79 -210
- package/src/utils/logger.ts +47 -22
- package/src/utils/tapped-stream.ts +60 -0
- package/src/workflow/steps/build.ts +16 -11
- package/src/workflow/steps/finalize.ts +4 -11
- package/src/workflow/steps/plan.ts +24 -19
- package/src/workflow/steps/research.ts +34 -33
- package/src/workflow/types.ts +14 -5
- 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 -356
- 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 -42
- package/dist/src/task-progress-reporter.d.ts.map +0 -1
- package/dist/src/task-progress-reporter.js +0 -398
- package/dist/src/task-progress-reporter.js.map +0 -1
- package/src/adapters/claude/claude-adapter.ts +0 -390
- package/src/adapters/claude/tool-mapper.ts +0 -46
- package/src/adapters/types.ts +0 -37
- package/src/task-progress-reporter.ts +0 -454
package/dist/src/agent.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { POSTHOG_NOTIFICATIONS } from './acp-extensions.js';
|
|
2
|
+
import { createAcpConnection } from './adapters/claude/claude.js';
|
|
3
3
|
import { PostHogFileManager } from './file-manager.js';
|
|
4
4
|
import { GitManager } from './git-manager.js';
|
|
5
5
|
import { PostHogAPIClient } from './posthog-api.js';
|
|
6
6
|
import { PromptBuilder } from './prompt-builder.js';
|
|
7
|
+
import { SessionStore } from './session-store.js';
|
|
7
8
|
import { TaskManager } from './task-manager.js';
|
|
8
|
-
import { TaskProgressReporter } from './task-progress-reporter.js';
|
|
9
9
|
import { TemplateManager } from './template-manager.js';
|
|
10
10
|
import { Logger } from './utils/logger.js';
|
|
11
11
|
import { TASK_WORKFLOW } from './workflow/config.js';
|
|
@@ -13,22 +13,21 @@ export { PermissionMode } from './types.js';
|
|
|
13
13
|
|
|
14
14
|
class Agent {
|
|
15
15
|
workingDirectory;
|
|
16
|
-
onEvent;
|
|
17
16
|
taskManager;
|
|
18
17
|
posthogAPI;
|
|
19
18
|
fileManager;
|
|
20
19
|
gitManager;
|
|
21
20
|
templateManager;
|
|
22
|
-
adapter;
|
|
23
21
|
logger;
|
|
24
|
-
|
|
22
|
+
acpConnection;
|
|
25
23
|
promptBuilder;
|
|
26
24
|
mcpServers;
|
|
27
25
|
canUseTool;
|
|
26
|
+
currentRunId;
|
|
27
|
+
sessionStore;
|
|
28
28
|
debug;
|
|
29
29
|
constructor(config) {
|
|
30
30
|
this.workingDirectory = config.workingDirectory || process.cwd();
|
|
31
|
-
this.onEvent = config.onEvent;
|
|
32
31
|
this.canUseTool = config.canUseTool;
|
|
33
32
|
this.debug = config.debug || false;
|
|
34
33
|
// Build default PostHog MCP server configuration
|
|
@@ -52,23 +51,28 @@ class Agent {
|
|
|
52
51
|
...defaultMcpServers,
|
|
53
52
|
...config.mcpServers,
|
|
54
53
|
};
|
|
55
|
-
this.logger = new Logger({
|
|
54
|
+
this.logger = new Logger({
|
|
55
|
+
debug: this.debug,
|
|
56
|
+
prefix: "[PostHog Agent]",
|
|
57
|
+
onLog: config.onLog,
|
|
58
|
+
});
|
|
56
59
|
this.taskManager = new TaskManager();
|
|
57
|
-
// Hardcode Claude adapter for now - extensible for other providers later
|
|
58
|
-
this.adapter = new ClaudeAdapter();
|
|
59
60
|
this.fileManager = new PostHogFileManager(this.workingDirectory, this.logger.child("FileManager"));
|
|
60
61
|
this.gitManager = new GitManager({
|
|
61
62
|
repositoryPath: this.workingDirectory,
|
|
62
63
|
logger: this.logger.child("GitManager"),
|
|
63
|
-
// TODO: Add author config from environment or config
|
|
64
64
|
});
|
|
65
65
|
this.templateManager = new TemplateManager();
|
|
66
|
-
if (config.posthogApiUrl &&
|
|
66
|
+
if (config.posthogApiUrl &&
|
|
67
|
+
config.posthogApiKey &&
|
|
68
|
+
config.posthogProjectId) {
|
|
67
69
|
this.posthogAPI = new PostHogAPIClient({
|
|
68
70
|
apiUrl: config.posthogApiUrl,
|
|
69
71
|
apiKey: config.posthogApiKey,
|
|
70
72
|
projectId: config.posthogProjectId,
|
|
71
73
|
});
|
|
74
|
+
// Create SessionStore from the API client for ACP connection
|
|
75
|
+
this.sessionStore = new SessionStore(this.posthogAPI, this.logger.child("SessionStore"));
|
|
72
76
|
}
|
|
73
77
|
this.promptBuilder = new PromptBuilder({
|
|
74
78
|
getTaskFiles: (taskId) => this.getTaskFiles(taskId),
|
|
@@ -76,7 +80,6 @@ class Agent {
|
|
|
76
80
|
posthogClient: this.posthogAPI,
|
|
77
81
|
logger: this.logger.child("PromptBuilder"),
|
|
78
82
|
});
|
|
79
|
-
this.progressReporter = new TaskProgressReporter(this.posthogAPI, this.logger);
|
|
80
83
|
}
|
|
81
84
|
/**
|
|
82
85
|
* Enable or disable debug logging
|
|
@@ -98,38 +101,52 @@ class Agent {
|
|
|
98
101
|
process.env.ANTHROPIC_BASE_URL = gatewayUrl;
|
|
99
102
|
process.env.ANTHROPIC_AUTH_TOKEN = apiKey;
|
|
100
103
|
this.ensureOpenAIGatewayEnv(gatewayUrl, apiKey);
|
|
101
|
-
this.logger.debug("Configured LLM gateway", { gatewayUrl });
|
|
102
104
|
}
|
|
103
105
|
catch (error) {
|
|
104
106
|
this.logger.error("Failed to configure LLM gateway", error);
|
|
105
107
|
throw error;
|
|
106
108
|
}
|
|
107
109
|
}
|
|
110
|
+
getOrCreateConnection() {
|
|
111
|
+
if (!this.acpConnection) {
|
|
112
|
+
this.acpConnection = createAcpConnection({
|
|
113
|
+
sessionStore: this.sessionStore,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return this.acpConnection;
|
|
117
|
+
}
|
|
108
118
|
// Adaptive task execution orchestrated via workflow steps
|
|
109
|
-
async runTask(
|
|
110
|
-
await this._configureLlmGateway();
|
|
111
|
-
const task =
|
|
119
|
+
async runTask(taskId, taskRunId, options = {}) {
|
|
120
|
+
// await this._configureLlmGateway();
|
|
121
|
+
const task = await this.fetchTask(taskId);
|
|
112
122
|
const cwd = options.repositoryPath || this.workingDirectory;
|
|
113
123
|
const isCloudMode = options.isCloudMode ?? false;
|
|
114
124
|
const taskSlug = task.slug || task.id;
|
|
125
|
+
// Use taskRunId as sessionId - they are the same identifier
|
|
126
|
+
this.currentRunId = taskRunId;
|
|
115
127
|
this.logger.info("Starting adaptive task execution", {
|
|
116
128
|
taskId: task.id,
|
|
117
129
|
taskSlug,
|
|
130
|
+
taskRunId,
|
|
118
131
|
isCloudMode,
|
|
119
132
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
133
|
+
const connection = this.getOrCreateConnection();
|
|
134
|
+
// Create sendNotification using ACP connection's extNotification
|
|
135
|
+
const sendNotification = async (method, params) => {
|
|
136
|
+
this.logger.debug(`Notification: ${method}`, params);
|
|
137
|
+
await connection.agentConnection.extNotification?.(method, params);
|
|
138
|
+
};
|
|
139
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {
|
|
140
|
+
sessionId: taskRunId,
|
|
141
|
+
runId: taskRunId,
|
|
123
142
|
});
|
|
124
|
-
this.
|
|
125
|
-
runId: this.progressReporter.runId,
|
|
126
|
-
}));
|
|
127
|
-
await this.prepareTaskBranch(taskSlug, isCloudMode);
|
|
143
|
+
await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);
|
|
128
144
|
let taskError;
|
|
129
145
|
try {
|
|
130
146
|
const workflowContext = {
|
|
131
147
|
task,
|
|
132
148
|
taskSlug,
|
|
149
|
+
runId: taskRunId,
|
|
133
150
|
cwd,
|
|
134
151
|
isCloudMode,
|
|
135
152
|
options,
|
|
@@ -137,11 +154,11 @@ class Agent {
|
|
|
137
154
|
fileManager: this.fileManager,
|
|
138
155
|
gitManager: this.gitManager,
|
|
139
156
|
promptBuilder: this.promptBuilder,
|
|
140
|
-
|
|
141
|
-
|
|
157
|
+
connection: connection.agentConnection,
|
|
158
|
+
sessionId: taskRunId,
|
|
159
|
+
sendNotification,
|
|
142
160
|
mcpServers: this.mcpServers,
|
|
143
161
|
posthogAPI: this.posthogAPI,
|
|
144
|
-
emitEvent: (event) => this.emitEvent(event),
|
|
145
162
|
stepResults: {},
|
|
146
163
|
};
|
|
147
164
|
for (const step of TASK_WORKFLOW) {
|
|
@@ -152,10 +169,13 @@ class Agent {
|
|
|
152
169
|
}
|
|
153
170
|
const shouldCreatePR = options.createPR ?? isCloudMode;
|
|
154
171
|
if (shouldCreatePR) {
|
|
155
|
-
await this.ensurePullRequest(task, workflowContext.stepResults);
|
|
172
|
+
await this.ensurePullRequest(task, workflowContext.stepResults, sendNotification);
|
|
156
173
|
}
|
|
157
174
|
this.logger.info("Task execution complete", { taskId: task.id });
|
|
158
|
-
|
|
175
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.TASK_COMPLETE, {
|
|
176
|
+
sessionId: taskRunId,
|
|
177
|
+
taskId: task.id,
|
|
178
|
+
});
|
|
159
179
|
}
|
|
160
180
|
catch (error) {
|
|
161
181
|
taskError = error instanceof Error ? error : new Error(String(error));
|
|
@@ -163,59 +183,61 @@ class Agent {
|
|
|
163
183
|
taskId: task.id,
|
|
164
184
|
error: taskError.message,
|
|
165
185
|
});
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
throw taskError;
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
await this.progressReporter.complete();
|
|
175
|
-
}
|
|
186
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {
|
|
187
|
+
sessionId: taskRunId,
|
|
188
|
+
message: taskError.message,
|
|
189
|
+
});
|
|
190
|
+
throw taskError;
|
|
176
191
|
}
|
|
177
192
|
}
|
|
178
|
-
|
|
179
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Creates an in-process ACP connection for client communication.
|
|
195
|
+
* Sets up git branch for the task, configures LLM gateway.
|
|
196
|
+
* The client handles all prompting/querying via the returned streams.
|
|
197
|
+
*
|
|
198
|
+
* @returns InProcessAcpConnection with clientStreams for the client to use
|
|
199
|
+
*/
|
|
200
|
+
async runTaskV2(taskId, taskRunId, options = {}) {
|
|
180
201
|
await this._configureLlmGateway();
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
202
|
+
const task = await this.fetchTask(taskId);
|
|
203
|
+
const taskSlug = task.slug || task.id;
|
|
204
|
+
const isCloudMode = options.isCloudMode ?? false;
|
|
205
|
+
options.repositoryPath || this.workingDirectory;
|
|
206
|
+
// Use taskRunId as sessionId - they are the same identifier
|
|
207
|
+
this.currentRunId = taskRunId;
|
|
208
|
+
this.acpConnection = createAcpConnection({
|
|
209
|
+
sessionStore: this.sessionStore,
|
|
210
|
+
sessionId: taskRunId,
|
|
211
|
+
taskId: task.id,
|
|
212
|
+
});
|
|
213
|
+
const sendNotification = async (method, params) => {
|
|
214
|
+
this.logger.debug(`Notification: ${method}`, params);
|
|
215
|
+
await this.acpConnection?.agentConnection.extNotification?.(method, params);
|
|
187
216
|
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
baseOptions.canUseTool = canUseTool;
|
|
192
|
-
}
|
|
193
|
-
const response = query({
|
|
194
|
-
prompt,
|
|
195
|
-
options: { ...baseOptions, ...(options.queryOverrides || {}) },
|
|
217
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {
|
|
218
|
+
sessionId: taskRunId,
|
|
219
|
+
runId: taskRunId,
|
|
196
220
|
});
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
221
|
+
if (!options.skipGitBranch) {
|
|
222
|
+
try {
|
|
223
|
+
await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
227
|
+
this.logger.error("Failed to prepare task branch", {
|
|
228
|
+
error: errorMessage,
|
|
229
|
+
});
|
|
230
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {
|
|
231
|
+
sessionId: taskRunId,
|
|
232
|
+
message: errorMessage,
|
|
233
|
+
});
|
|
234
|
+
throw error;
|
|
208
235
|
}
|
|
209
236
|
}
|
|
210
|
-
|
|
211
|
-
this.logger.error("Error during direct run", error);
|
|
212
|
-
throw error;
|
|
213
|
-
}
|
|
214
|
-
return { results };
|
|
237
|
+
return this.acpConnection;
|
|
215
238
|
}
|
|
216
239
|
// PostHog task operations
|
|
217
240
|
async fetchTask(taskId) {
|
|
218
|
-
this.logger.debug("Fetching task from PostHog", { taskId });
|
|
219
241
|
if (!this.posthogAPI) {
|
|
220
242
|
const error = new Error("PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.");
|
|
221
243
|
this.logger.error("PostHog API not configured", error);
|
|
@@ -226,72 +248,12 @@ class Agent {
|
|
|
226
248
|
getPostHogClient() {
|
|
227
249
|
return this.posthogAPI;
|
|
228
250
|
}
|
|
229
|
-
async listTasks(filters) {
|
|
230
|
-
if (!this.posthogAPI) {
|
|
231
|
-
throw new Error("PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.");
|
|
232
|
-
}
|
|
233
|
-
return this.posthogAPI.listTasks(filters);
|
|
234
|
-
}
|
|
235
|
-
// File system operations for task artifacts
|
|
236
|
-
async writeTaskFile(taskId, fileName, content, type = "reference") {
|
|
237
|
-
this.logger.debug("Writing task file", {
|
|
238
|
-
taskId,
|
|
239
|
-
fileName,
|
|
240
|
-
type,
|
|
241
|
-
contentLength: content.length,
|
|
242
|
-
});
|
|
243
|
-
await this.fileManager.writeTaskFile(taskId, {
|
|
244
|
-
name: fileName,
|
|
245
|
-
content,
|
|
246
|
-
type,
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
async readTaskFile(taskId, fileName) {
|
|
250
|
-
this.logger.debug("Reading task file", { taskId, fileName });
|
|
251
|
-
return await this.fileManager.readTaskFile(taskId, fileName);
|
|
252
|
-
}
|
|
253
251
|
async getTaskFiles(taskId) {
|
|
254
252
|
this.logger.debug("Getting task files", { taskId });
|
|
255
253
|
const files = await this.fileManager.getTaskFiles(taskId);
|
|
256
254
|
this.logger.debug("Found task files", { taskId, fileCount: files.length });
|
|
257
255
|
return files;
|
|
258
256
|
}
|
|
259
|
-
async writePlan(taskId, plan) {
|
|
260
|
-
this.logger.info("Writing plan", { taskId, planLength: plan.length });
|
|
261
|
-
await this.fileManager.writePlan(taskId, plan);
|
|
262
|
-
}
|
|
263
|
-
async readPlan(taskId) {
|
|
264
|
-
this.logger.debug("Reading plan", { taskId });
|
|
265
|
-
return await this.fileManager.readPlan(taskId);
|
|
266
|
-
}
|
|
267
|
-
// Git operations for task execution
|
|
268
|
-
async createPlanningBranch(taskId) {
|
|
269
|
-
this.logger.info("Creating planning branch", { taskId });
|
|
270
|
-
const branchName = await this.gitManager.createTaskPlanningBranch(taskId);
|
|
271
|
-
this.logger.debug("Planning branch created", { taskId, branchName });
|
|
272
|
-
return branchName;
|
|
273
|
-
}
|
|
274
|
-
async commitPlan(taskId, taskTitle) {
|
|
275
|
-
this.logger.info("Committing plan", { taskId, taskTitle });
|
|
276
|
-
const commitHash = await this.gitManager.commitPlan(taskId, taskTitle);
|
|
277
|
-
this.logger.debug("Plan committed", { taskId, commitHash });
|
|
278
|
-
return commitHash;
|
|
279
|
-
}
|
|
280
|
-
async createImplementationBranch(taskId, planningBranchName) {
|
|
281
|
-
this.logger.info("Creating implementation branch", {
|
|
282
|
-
taskId,
|
|
283
|
-
fromBranch: planningBranchName,
|
|
284
|
-
});
|
|
285
|
-
const branchName = await this.gitManager.createTaskImplementationBranch(taskId, planningBranchName);
|
|
286
|
-
this.logger.debug("Implementation branch created", { taskId, branchName });
|
|
287
|
-
return branchName;
|
|
288
|
-
}
|
|
289
|
-
async commitImplementation(taskId, taskTitle, planSummary) {
|
|
290
|
-
this.logger.info("Committing implementation", { taskId, taskTitle });
|
|
291
|
-
const commitHash = await this.gitManager.commitImplementation(taskId, taskTitle, planSummary);
|
|
292
|
-
this.logger.debug("Implementation committed", { taskId, commitHash });
|
|
293
|
-
return commitHash;
|
|
294
|
-
}
|
|
295
257
|
async createPullRequest(taskId, branchName, taskTitle, taskDescription, customBody) {
|
|
296
258
|
this.logger.info("Creating pull request", {
|
|
297
259
|
taskId,
|
|
@@ -313,7 +275,7 @@ Generated by PostHog Agent`;
|
|
|
313
275
|
}
|
|
314
276
|
async attachPullRequestToTask(taskId, prUrl, branchName) {
|
|
315
277
|
this.logger.info("Attaching PR to task run", { taskId, prUrl, branchName });
|
|
316
|
-
if (!this.posthogAPI || !this.
|
|
278
|
+
if (!this.posthogAPI || !this.currentRunId) {
|
|
317
279
|
const error = new Error("PostHog API not configured or no active run. Cannot attach PR to task.");
|
|
318
280
|
this.logger.error("PostHog API not configured", error);
|
|
319
281
|
throw error;
|
|
@@ -324,26 +286,26 @@ Generated by PostHog Agent`;
|
|
|
324
286
|
if (branchName) {
|
|
325
287
|
updates.branch = branchName;
|
|
326
288
|
}
|
|
327
|
-
await this.posthogAPI.updateTaskRun(taskId, this.
|
|
289
|
+
await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, updates);
|
|
328
290
|
this.logger.debug("PR attached to task run", {
|
|
329
291
|
taskId,
|
|
330
|
-
runId: this.
|
|
292
|
+
runId: this.currentRunId,
|
|
331
293
|
prUrl,
|
|
332
294
|
});
|
|
333
295
|
}
|
|
334
296
|
async updateTaskBranch(taskId, branchName) {
|
|
335
297
|
this.logger.info("Updating task run branch", { taskId, branchName });
|
|
336
|
-
if (!this.posthogAPI || !this.
|
|
298
|
+
if (!this.posthogAPI || !this.currentRunId) {
|
|
337
299
|
const error = new Error("PostHog API not configured or no active run. Cannot update branch.");
|
|
338
300
|
this.logger.error("PostHog API not configured", error);
|
|
339
301
|
throw error;
|
|
340
302
|
}
|
|
341
|
-
await this.posthogAPI.updateTaskRun(taskId, this.
|
|
303
|
+
await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, {
|
|
342
304
|
branch: branchName,
|
|
343
305
|
});
|
|
344
306
|
this.logger.debug("Task run branch updated", {
|
|
345
307
|
taskId,
|
|
346
|
-
runId: this.
|
|
308
|
+
runId: this.currentRunId,
|
|
347
309
|
branchName,
|
|
348
310
|
});
|
|
349
311
|
}
|
|
@@ -366,17 +328,30 @@ Generated by PostHog Agent`;
|
|
|
366
328
|
}
|
|
367
329
|
return null;
|
|
368
330
|
}
|
|
369
|
-
async prepareTaskBranch(taskSlug, isCloudMode) {
|
|
331
|
+
async prepareTaskBranch(taskSlug, isCloudMode, sendNotification) {
|
|
370
332
|
if (await this.gitManager.hasChanges()) {
|
|
371
333
|
throw new Error("Cannot start task with uncommitted changes. Please commit or stash your changes first.");
|
|
372
334
|
}
|
|
335
|
+
// If we're running in a worktree, we're already on the correct branch
|
|
336
|
+
// (the worktree was created with its own branch). Skip branch creation.
|
|
337
|
+
const isWorktree = await this.gitManager.isWorktree();
|
|
338
|
+
if (isWorktree) {
|
|
339
|
+
const currentBranch = await this.gitManager.getCurrentBranch();
|
|
340
|
+
this.logger.info("Running in worktree, using existing branch", {
|
|
341
|
+
branch: currentBranch,
|
|
342
|
+
});
|
|
343
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {
|
|
344
|
+
branch: currentBranch,
|
|
345
|
+
});
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
373
348
|
await this.gitManager.resetToDefaultBranchIfNeeded();
|
|
374
349
|
const existingBranch = await this.gitManager.getTaskBranch(taskSlug);
|
|
375
350
|
if (!existingBranch) {
|
|
376
351
|
const branchName = await this.gitManager.createTaskBranch(taskSlug);
|
|
377
|
-
|
|
352
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {
|
|
378
353
|
branch: branchName,
|
|
379
|
-
})
|
|
354
|
+
});
|
|
380
355
|
await this.gitManager.addAllPostHogFiles();
|
|
381
356
|
// Only commit if there are changes or we're in cloud mode
|
|
382
357
|
if (isCloudMode) {
|
|
@@ -409,7 +384,7 @@ Generated by PostHog Agent`;
|
|
|
409
384
|
process.env.OPENAI_API_KEY = resolvedToken;
|
|
410
385
|
}
|
|
411
386
|
}
|
|
412
|
-
async ensurePullRequest(task, stepResults) {
|
|
387
|
+
async ensurePullRequest(task, stepResults, sendNotification) {
|
|
413
388
|
const latestRun = task.latest_run;
|
|
414
389
|
const existingPr = latestRun?.output && typeof latestRun.output === "object"
|
|
415
390
|
? latestRun.output.pr_url
|
|
@@ -430,7 +405,7 @@ Generated by PostHog Agent`;
|
|
|
430
405
|
const finalizeResult = stepResults.finalize;
|
|
431
406
|
const prBody = finalizeResult?.prBody;
|
|
432
407
|
const prUrl = await this.createPullRequest(task.id, branchName, task.title, task.description ?? "", prBody);
|
|
433
|
-
|
|
408
|
+
await sendNotification(POSTHOG_NOTIFICATIONS.PR_CREATED, { prUrl });
|
|
434
409
|
try {
|
|
435
410
|
await this.attachPullRequestToTask(task.id, prUrl, branchName);
|
|
436
411
|
this.logger.info("PR attached to task successfully", {
|
|
@@ -444,19 +419,6 @@ Generated by PostHog Agent`;
|
|
|
444
419
|
});
|
|
445
420
|
}
|
|
446
421
|
}
|
|
447
|
-
emitEvent(event) {
|
|
448
|
-
if (this.debug && event.type !== "token") {
|
|
449
|
-
// Log all events except tokens (too verbose)
|
|
450
|
-
this.logger.debug("Emitting event", { type: event.type, ts: event.ts });
|
|
451
|
-
}
|
|
452
|
-
const persistPromise = this.progressReporter.recordEvent(event);
|
|
453
|
-
if (persistPromise && typeof persistPromise.then === "function") {
|
|
454
|
-
persistPromise.catch((error) => this.logger.debug("Failed to persist agent event", {
|
|
455
|
-
message: error.message,
|
|
456
|
-
}));
|
|
457
|
-
}
|
|
458
|
-
this.onEvent?.(event);
|
|
459
|
-
}
|
|
460
422
|
}
|
|
461
423
|
|
|
462
424
|
export { Agent };
|
package/dist/src/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sources":["../../src/agent.ts"],"sourcesContent":["import { query } from \"@anthropic-ai/claude-agent-sdk\";\nimport { ClaudeAdapter } from \"./adapters/claude/claude-adapter.js\";\nimport type { ProviderAdapter } from \"./adapters/types.js\";\nimport { PostHogFileManager } from \"./file-manager.js\";\nimport { GitManager } from \"./git-manager.js\";\nimport { PostHogAPIClient } from \"./posthog-api.js\";\nimport { PromptBuilder } from \"./prompt-builder.js\";\nimport { TaskManager } from \"./task-manager.js\";\nimport { TaskProgressReporter } from \"./task-progress-reporter.js\";\nimport { TemplateManager } from \"./template-manager.js\";\nimport type {\n AgentConfig,\n CanUseTool,\n ExecutionResult,\n Task,\n} from \"./types.js\";\nimport { Logger } from \"./utils/logger.js\";\nimport { TASK_WORKFLOW } from \"./workflow/config.js\";\nimport type { WorkflowRuntime } from \"./workflow/types.js\";\n\nexport class Agent {\n private workingDirectory: string;\n private onEvent?: (event: any) => void;\n private taskManager: TaskManager;\n private posthogAPI?: PostHogAPIClient;\n private fileManager: PostHogFileManager;\n private gitManager: GitManager;\n private templateManager: TemplateManager;\n private adapter: ProviderAdapter;\n private logger: Logger;\n private progressReporter: TaskProgressReporter;\n private promptBuilder: PromptBuilder;\n private mcpServers?: Record<string, any>;\n private canUseTool?: CanUseTool;\n public debug: boolean;\n\n constructor(config: AgentConfig) {\n this.workingDirectory = config.workingDirectory || process.cwd();\n this.onEvent = config.onEvent;\n this.canUseTool = config.canUseTool;\n this.debug = config.debug || false;\n\n // Build default PostHog MCP server configuration\n const posthogMcpUrl =\n config.posthogMcpUrl ||\n process.env.POSTHOG_MCP_URL ||\n \"https://mcp.posthog.com/mcp\";\n\n // Add auth if API key provided\n const headers: Record<string, string> = {};\n if (config.posthogApiKey) {\n headers.Authorization = `Bearer ${config.posthogApiKey}`;\n }\n\n const defaultMcpServers = {\n posthog: {\n type: \"http\" as const,\n url: posthogMcpUrl,\n ...(Object.keys(headers).length > 0 ? { headers } : {}),\n },\n };\n\n // Merge default PostHog MCP with user-provided servers (user config takes precedence)\n this.mcpServers = {\n ...defaultMcpServers,\n ...config.mcpServers,\n };\n this.logger = new Logger({ debug: this.debug, prefix: \"[PostHog Agent]\" });\n this.taskManager = new TaskManager();\n // Hardcode Claude adapter for now - extensible for other providers later\n this.adapter = new ClaudeAdapter();\n\n this.fileManager = new PostHogFileManager(\n this.workingDirectory,\n this.logger.child(\"FileManager\"),\n );\n this.gitManager = new GitManager({\n repositoryPath: this.workingDirectory,\n logger: this.logger.child(\"GitManager\"),\n // TODO: Add author config from environment or config\n });\n this.templateManager = new TemplateManager();\n\n if (config.posthogApiUrl && config.posthogApiKey) {\n this.posthogAPI = new PostHogAPIClient({\n apiUrl: config.posthogApiUrl,\n apiKey: config.posthogApiKey,\n projectId: config.posthogProjectId,\n });\n }\n\n this.promptBuilder = new PromptBuilder({\n getTaskFiles: (taskId: string) => this.getTaskFiles(taskId),\n generatePlanTemplate: (vars) => this.templateManager.generatePlan(vars),\n posthogClient: this.posthogAPI,\n logger: this.logger.child(\"PromptBuilder\"),\n });\n this.progressReporter = new TaskProgressReporter(\n this.posthogAPI,\n this.logger,\n );\n }\n\n /**\n * Enable or disable debug logging\n */\n setDebug(enabled: boolean) {\n this.debug = enabled;\n this.logger.setDebug(enabled);\n }\n\n /**\n * Configure LLM gateway environment variables for Claude Code CLI\n */\n private async _configureLlmGateway(): Promise<void> {\n if (!this.posthogAPI) {\n return;\n }\n\n try {\n const gatewayUrl = this.posthogAPI.getLlmGatewayUrl();\n const apiKey = this.posthogAPI.getApiKey();\n\n process.env.ANTHROPIC_BASE_URL = gatewayUrl;\n process.env.ANTHROPIC_AUTH_TOKEN = apiKey;\n this.ensureOpenAIGatewayEnv(gatewayUrl, apiKey);\n\n this.logger.debug(\"Configured LLM gateway\", { gatewayUrl });\n } catch (error) {\n this.logger.error(\"Failed to configure LLM gateway\", error);\n throw error;\n }\n }\n\n // Adaptive task execution orchestrated via workflow steps\n async runTask(\n taskOrId: Task | string,\n options: import(\"./types.js\").TaskExecutionOptions = {},\n ): Promise<void> {\n await this._configureLlmGateway();\n\n const task =\n typeof taskOrId === \"string\" ? await this.fetchTask(taskOrId) : taskOrId;\n const cwd = options.repositoryPath || this.workingDirectory;\n const isCloudMode = options.isCloudMode ?? false;\n const taskSlug = (task as any).slug || task.id;\n\n this.logger.info(\"Starting adaptive task execution\", {\n taskId: task.id,\n taskSlug,\n isCloudMode,\n });\n\n // Initialize progress reporter for task run tracking (needed for PR attachment)\n await this.progressReporter.start(task.id, {\n totalSteps: TASK_WORKFLOW.length,\n });\n this.emitEvent(\n this.adapter.createStatusEvent(\"run_started\", {\n runId: this.progressReporter.runId,\n }),\n );\n\n await this.prepareTaskBranch(taskSlug, isCloudMode);\n\n let taskError: Error | undefined;\n try {\n const workflowContext: WorkflowRuntime = {\n task,\n taskSlug,\n cwd,\n isCloudMode,\n options,\n logger: this.logger,\n fileManager: this.fileManager,\n gitManager: this.gitManager,\n promptBuilder: this.promptBuilder,\n progressReporter: this.progressReporter,\n adapter: this.adapter,\n mcpServers: this.mcpServers,\n posthogAPI: this.posthogAPI,\n emitEvent: (event: any) => this.emitEvent(event),\n stepResults: {},\n };\n\n for (const step of TASK_WORKFLOW) {\n const result = await step.run({ step, context: workflowContext });\n if (result.halt) {\n return;\n }\n }\n\n const shouldCreatePR = options.createPR ?? isCloudMode;\n if (shouldCreatePR) {\n await this.ensurePullRequest(task, workflowContext.stepResults);\n }\n\n this.logger.info(\"Task execution complete\", { taskId: task.id });\n this.emitEvent(\n this.adapter.createStatusEvent(\"task_complete\", { taskId: task.id }),\n );\n } catch (error) {\n taskError = error instanceof Error ? error : new Error(String(error));\n this.logger.error(\"Task execution failed\", {\n taskId: task.id,\n error: taskError.message,\n });\n } finally {\n if (taskError) {\n await this.progressReporter.fail(taskError);\n // biome-ignore lint/correctness/noUnsafeFinally: we actually want to throw the error\n throw taskError;\n } else {\n await this.progressReporter.complete();\n }\n }\n }\n\n // Direct prompt execution - still supported for low-level usage\n async run(\n prompt: string,\n options: {\n repositoryPath?: string;\n permissionMode?: import(\"./types.js\").PermissionMode;\n queryOverrides?: Record<string, any>;\n canUseTool?: CanUseTool;\n } = {},\n ): Promise<ExecutionResult> {\n await this._configureLlmGateway();\n const baseOptions: Record<string, any> = {\n model: \"claude-sonnet-4-5-20250929\",\n cwd: options.repositoryPath || this.workingDirectory,\n permissionMode: (options.permissionMode as any) || \"default\",\n settingSources: [\"local\"],\n mcpServers: this.mcpServers,\n };\n\n // Add canUseTool hook if provided (options take precedence over instance config)\n const canUseTool = options.canUseTool || this.canUseTool;\n if (canUseTool) {\n baseOptions.canUseTool = canUseTool;\n }\n\n const response = query({\n prompt,\n options: { ...baseOptions, ...(options.queryOverrides || {}) },\n });\n\n const results = [];\n try {\n for await (const message of response) {\n this.logger.debug(\"Received message in direct run\", message);\n // Emit raw SDK event\n this.emitEvent(this.adapter.createRawSDKEvent(message));\n const transformedEvents = this.adapter.transform(message);\n for (const event of transformedEvents) {\n this.emitEvent(event);\n }\n results.push(message);\n }\n } catch (error) {\n this.logger.error(\"Error during direct run\", error);\n throw error;\n }\n\n return { results };\n }\n\n // PostHog task operations\n async fetchTask(taskId: string): Promise<Task> {\n this.logger.debug(\"Fetching task from PostHog\", { taskId });\n if (!this.posthogAPI) {\n const error = new Error(\n \"PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n return this.posthogAPI.fetchTask(taskId);\n }\n\n getPostHogClient(): PostHogAPIClient | undefined {\n return this.posthogAPI;\n }\n\n async listTasks(filters?: {\n repository?: string;\n organization?: string;\n origin_product?: string;\n }): Promise<Task[]> {\n if (!this.posthogAPI) {\n throw new Error(\n \"PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.\",\n );\n }\n return this.posthogAPI.listTasks(filters);\n }\n\n // File system operations for task artifacts\n async writeTaskFile(\n taskId: string,\n fileName: string,\n content: string,\n type: \"plan\" | \"context\" | \"reference\" | \"output\" = \"reference\",\n ): Promise<void> {\n this.logger.debug(\"Writing task file\", {\n taskId,\n fileName,\n type,\n contentLength: content.length,\n });\n await this.fileManager.writeTaskFile(taskId, {\n name: fileName,\n content,\n type,\n });\n }\n\n async readTaskFile(taskId: string, fileName: string): Promise<string | null> {\n this.logger.debug(\"Reading task file\", { taskId, fileName });\n return await this.fileManager.readTaskFile(taskId, fileName);\n }\n\n async getTaskFiles(taskId: string): Promise<any[]> {\n this.logger.debug(\"Getting task files\", { taskId });\n const files = await this.fileManager.getTaskFiles(taskId);\n this.logger.debug(\"Found task files\", { taskId, fileCount: files.length });\n return files;\n }\n\n async writePlan(taskId: string, plan: string): Promise<void> {\n this.logger.info(\"Writing plan\", { taskId, planLength: plan.length });\n await this.fileManager.writePlan(taskId, plan);\n }\n\n async readPlan(taskId: string): Promise<string | null> {\n this.logger.debug(\"Reading plan\", { taskId });\n return await this.fileManager.readPlan(taskId);\n }\n\n // Git operations for task execution\n async createPlanningBranch(taskId: string): Promise<string> {\n this.logger.info(\"Creating planning branch\", { taskId });\n const branchName = await this.gitManager.createTaskPlanningBranch(taskId);\n this.logger.debug(\"Planning branch created\", { taskId, branchName });\n return branchName;\n }\n\n async commitPlan(taskId: string, taskTitle: string): Promise<string> {\n this.logger.info(\"Committing plan\", { taskId, taskTitle });\n const commitHash = await this.gitManager.commitPlan(taskId, taskTitle);\n this.logger.debug(\"Plan committed\", { taskId, commitHash });\n return commitHash;\n }\n\n async createImplementationBranch(\n taskId: string,\n planningBranchName?: string,\n ): Promise<string> {\n this.logger.info(\"Creating implementation branch\", {\n taskId,\n fromBranch: planningBranchName,\n });\n const branchName = await this.gitManager.createTaskImplementationBranch(\n taskId,\n planningBranchName,\n );\n this.logger.debug(\"Implementation branch created\", { taskId, branchName });\n return branchName;\n }\n\n async commitImplementation(\n taskId: string,\n taskTitle: string,\n planSummary?: string,\n ): Promise<string> {\n this.logger.info(\"Committing implementation\", { taskId, taskTitle });\n const commitHash = await this.gitManager.commitImplementation(\n taskId,\n taskTitle,\n planSummary,\n );\n this.logger.debug(\"Implementation committed\", { taskId, commitHash });\n return commitHash;\n }\n\n async createPullRequest(\n taskId: string,\n branchName: string,\n taskTitle: string,\n taskDescription: string,\n customBody?: string,\n ): Promise<string> {\n this.logger.info(\"Creating pull request\", {\n taskId,\n branchName,\n taskTitle,\n });\n\n const defaultBody = `## Task Details\n**Task ID**: ${taskId}\n**Description**: ${taskDescription}\n\n## Changes\nThis PR implements the changes described in the task.\n\nGenerated by PostHog Agent`;\n const prBody = customBody || defaultBody;\n\n const prUrl = await this.gitManager.createPullRequest(\n branchName,\n taskTitle,\n prBody,\n );\n\n this.logger.info(\"Pull request created\", { taskId, prUrl });\n return prUrl;\n }\n\n async attachPullRequestToTask(\n taskId: string,\n prUrl: string,\n branchName?: string,\n ): Promise<void> {\n this.logger.info(\"Attaching PR to task run\", { taskId, prUrl, branchName });\n\n if (!this.posthogAPI || !this.progressReporter.runId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot attach PR to task.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n const updates: any = {\n output: { pr_url: prUrl },\n };\n if (branchName) {\n updates.branch = branchName;\n }\n\n await this.posthogAPI.updateTaskRun(\n taskId,\n this.progressReporter.runId,\n updates,\n );\n this.logger.debug(\"PR attached to task run\", {\n taskId,\n runId: this.progressReporter.runId,\n prUrl,\n });\n }\n\n async updateTaskBranch(taskId: string, branchName: string): Promise<void> {\n this.logger.info(\"Updating task run branch\", { taskId, branchName });\n\n if (!this.posthogAPI || !this.progressReporter.runId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot update branch.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n await this.posthogAPI.updateTaskRun(taskId, this.progressReporter.runId, {\n branch: branchName,\n });\n this.logger.debug(\"Task run branch updated\", {\n taskId,\n runId: this.progressReporter.runId,\n branchName,\n });\n }\n\n // Execution management\n cancelTask(taskId: string): void {\n // Find the execution for this task and cancel it\n for (const [executionId, execution] of this.taskManager.executionStates) {\n if (execution.taskId === taskId && execution.status === \"running\") {\n this.taskManager.cancelExecution(executionId);\n break;\n }\n }\n }\n\n getTaskExecutionStatus(taskId: string): string | null {\n // Find the execution for this task\n for (const execution of this.taskManager.executionStates.values()) {\n if (execution.taskId === taskId) {\n return execution.status;\n }\n }\n return null;\n }\n\n private async prepareTaskBranch(\n taskSlug: string,\n isCloudMode: boolean,\n ): Promise<void> {\n if (await this.gitManager.hasChanges()) {\n throw new Error(\n \"Cannot start task with uncommitted changes. Please commit or stash your changes first.\",\n );\n }\n\n await this.gitManager.resetToDefaultBranchIfNeeded();\n\n const existingBranch = await this.gitManager.getTaskBranch(taskSlug);\n if (!existingBranch) {\n const branchName = await this.gitManager.createTaskBranch(taskSlug);\n this.emitEvent(\n this.adapter.createStatusEvent(\"branch_created\", {\n branch: branchName,\n }),\n );\n\n await this.gitManager.addAllPostHogFiles();\n\n // Only commit if there are changes or we're in cloud mode\n if (isCloudMode) {\n await this.gitManager.commitAndPush(`Initialize task ${taskSlug}`, {\n allowEmpty: true,\n });\n } else {\n // Check if there are any changes before committing\n const hasChanges = await this.gitManager.hasStagedChanges();\n if (hasChanges) {\n await this.gitManager.commitChanges(`Initialize task ${taskSlug}`);\n }\n }\n } else {\n this.logger.info(\"Switching to existing task branch\", {\n branch: existingBranch,\n });\n await this.gitManager.switchToBranch(existingBranch);\n }\n }\n\n private ensureOpenAIGatewayEnv(gatewayUrl?: string, token?: string): void {\n const resolvedGatewayUrl = gatewayUrl || process.env.ANTHROPIC_BASE_URL;\n const resolvedToken = token || process.env.ANTHROPIC_AUTH_TOKEN;\n\n if (resolvedGatewayUrl) {\n process.env.OPENAI_BASE_URL = resolvedGatewayUrl;\n }\n\n if (resolvedToken) {\n process.env.OPENAI_API_KEY = resolvedToken;\n }\n }\n\n private async ensurePullRequest(\n task: Task,\n stepResults: Record<string, any>,\n ): Promise<void> {\n const latestRun = task.latest_run;\n const existingPr =\n latestRun?.output && typeof latestRun.output === \"object\"\n ? (latestRun.output as any).pr_url\n : null;\n\n if (existingPr) {\n this.logger.info(\"PR already exists, skipping creation\", {\n taskId: task.id,\n prUrl: existingPr,\n });\n return;\n }\n\n const buildResult = stepResults.build;\n if (!buildResult?.commitCreated) {\n this.logger.warn(\n \"Build step did not produce a commit; skipping PR creation\",\n { taskId: task.id },\n );\n return;\n }\n\n const branchName = await this.gitManager.getCurrentBranch();\n const finalizeResult = stepResults.finalize;\n const prBody = finalizeResult?.prBody;\n\n const prUrl = await this.createPullRequest(\n task.id,\n branchName,\n task.title,\n task.description ?? \"\",\n prBody,\n );\n\n this.emitEvent(this.adapter.createStatusEvent(\"pr_created\", { prUrl }));\n\n try {\n await this.attachPullRequestToTask(task.id, prUrl, branchName);\n this.logger.info(\"PR attached to task successfully\", {\n taskId: task.id,\n prUrl,\n });\n } catch (error) {\n this.logger.warn(\"Could not attach PR to task\", {\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n private emitEvent(event: any): void {\n if (this.debug && event.type !== \"token\") {\n // Log all events except tokens (too verbose)\n this.logger.debug(\"Emitting event\", { type: event.type, ts: event.ts });\n }\n const persistPromise = this.progressReporter.recordEvent(event);\n if (persistPromise && typeof persistPromise.then === \"function\") {\n persistPromise.catch((error: Error) =>\n this.logger.debug(\"Failed to persist agent event\", {\n message: error.message,\n }),\n );\n }\n this.onEvent?.(event);\n }\n}\n\nexport type {\n AgentConfig,\n ExecutionResult,\n SupportingFile,\n Task,\n} from \"./types.js\";\nexport { PermissionMode } from \"./types.js\";\n"],"names":[],"mappings":";;;;;;;;;;;;;MAoBa,KAAK,CAAA;AACR,IAAA,gBAAgB;AAChB,IAAA,OAAO;AACP,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,eAAe;AACf,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,gBAAgB;AAChB,IAAA,aAAa;AACb,IAAA,UAAU;AACV,IAAA,UAAU;AACX,IAAA,KAAK;AAEZ,IAAA,WAAA,CAAY,MAAmB,EAAA;QAC7B,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,EAAE;AAChE,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,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OAAO,KAAK,EAAE;AACd,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE;AAC9C,gBAAA,KAAK,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9D,aAAA,CAAC;QACJ;IACF;AAEQ,IAAA,SAAS,CAAC,KAAU,EAAA;QAC1B,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;;YAExC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACzE;QACA,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC;QAC/D,IAAI,cAAc,IAAI,OAAO,cAAc,CAAC,IAAI,KAAK,UAAU,EAAE;AAC/D,YAAA,cAAc,CAAC,KAAK,CAAC,CAAC,KAAY,KAChC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE;gBACjD,OAAO,EAAE,KAAK,CAAC,OAAO;AACvB,aAAA,CAAC,CACH;QACH;AACA,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"agent.js","sources":["../../src/agent.ts"],"sourcesContent":["import { POSTHOG_NOTIFICATIONS } from \"./acp-extensions.js\";\nimport {\n createAcpConnection,\n type InProcessAcpConnection,\n} from \"./adapters/claude/claude.js\";\nimport { PostHogFileManager } from \"./file-manager.js\";\nimport { GitManager } from \"./git-manager.js\";\nimport { PostHogAPIClient } from \"./posthog-api.js\";\nimport { PromptBuilder } from \"./prompt-builder.js\";\nimport { SessionStore } from \"./session-store.js\";\nimport { TaskManager } from \"./task-manager.js\";\nimport { TemplateManager } from \"./template-manager.js\";\nimport type { AgentConfig, CanUseTool, Task } from \"./types.js\";\nimport { Logger } from \"./utils/logger.js\";\nimport { TASK_WORKFLOW } from \"./workflow/config.js\";\nimport type { SendNotification, WorkflowRuntime } from \"./workflow/types.js\";\n\nexport class Agent {\n private workingDirectory: string;\n private taskManager: TaskManager;\n private posthogAPI?: PostHogAPIClient;\n private fileManager: PostHogFileManager;\n private gitManager: GitManager;\n private templateManager: TemplateManager;\n private logger: Logger;\n private acpConnection?: InProcessAcpConnection;\n private promptBuilder: PromptBuilder;\n private mcpServers?: Record<string, any>;\n private canUseTool?: CanUseTool;\n private currentRunId?: string;\n private sessionStore?: SessionStore;\n public debug: boolean;\n\n constructor(config: AgentConfig) {\n this.workingDirectory = config.workingDirectory || process.cwd();\n this.canUseTool = config.canUseTool;\n this.debug = config.debug || false;\n\n // Build default PostHog MCP server configuration\n const posthogMcpUrl =\n config.posthogMcpUrl ||\n process.env.POSTHOG_MCP_URL ||\n \"https://mcp.posthog.com/mcp\";\n\n // Add auth if API key provided\n const headers: Record<string, string> = {};\n if (config.posthogApiKey) {\n headers.Authorization = `Bearer ${config.posthogApiKey}`;\n }\n\n const defaultMcpServers = {\n posthog: {\n type: \"http\" as const,\n url: posthogMcpUrl,\n ...(Object.keys(headers).length > 0 ? { headers } : {}),\n },\n };\n\n // Merge default PostHog MCP with user-provided servers (user config takes precedence)\n this.mcpServers = {\n ...defaultMcpServers,\n ...config.mcpServers,\n };\n this.logger = new Logger({\n debug: this.debug,\n prefix: \"[PostHog Agent]\",\n onLog: config.onLog,\n });\n this.taskManager = new TaskManager();\n\n this.fileManager = new PostHogFileManager(\n this.workingDirectory,\n this.logger.child(\"FileManager\"),\n );\n this.gitManager = new GitManager({\n repositoryPath: this.workingDirectory,\n logger: this.logger.child(\"GitManager\"),\n });\n this.templateManager = new TemplateManager();\n\n if (\n config.posthogApiUrl &&\n config.posthogApiKey &&\n config.posthogProjectId\n ) {\n this.posthogAPI = new PostHogAPIClient({\n apiUrl: config.posthogApiUrl,\n apiKey: config.posthogApiKey,\n projectId: config.posthogProjectId,\n });\n\n // Create SessionStore from the API client for ACP connection\n this.sessionStore = new SessionStore(\n this.posthogAPI,\n this.logger.child(\"SessionStore\"),\n );\n }\n\n this.promptBuilder = new PromptBuilder({\n getTaskFiles: (taskId: string) => this.getTaskFiles(taskId),\n generatePlanTemplate: (vars) => this.templateManager.generatePlan(vars),\n posthogClient: this.posthogAPI,\n logger: this.logger.child(\"PromptBuilder\"),\n });\n }\n\n /**\n * Enable or disable debug logging\n */\n setDebug(enabled: boolean) {\n this.debug = enabled;\n this.logger.setDebug(enabled);\n }\n\n /**\n * Configure LLM gateway environment variables for Claude Code CLI\n */\n private async _configureLlmGateway(): Promise<void> {\n if (!this.posthogAPI) {\n return;\n }\n\n try {\n const gatewayUrl = this.posthogAPI.getLlmGatewayUrl();\n const apiKey = this.posthogAPI.getApiKey();\n process.env.ANTHROPIC_BASE_URL = gatewayUrl;\n process.env.ANTHROPIC_AUTH_TOKEN = apiKey;\n this.ensureOpenAIGatewayEnv(gatewayUrl, apiKey);\n } catch (error) {\n this.logger.error(\"Failed to configure LLM gateway\", error);\n throw error;\n }\n }\n\n private getOrCreateConnection(): InProcessAcpConnection {\n if (!this.acpConnection) {\n this.acpConnection = createAcpConnection({\n sessionStore: this.sessionStore,\n });\n }\n return this.acpConnection;\n }\n\n // Adaptive task execution orchestrated via workflow steps\n async runTask(\n taskId: string,\n taskRunId: string,\n options: import(\"./types.js\").TaskExecutionOptions = {},\n ): Promise<void> {\n // await this._configureLlmGateway();\n\n const task = await this.fetchTask(taskId);\n const cwd = options.repositoryPath || this.workingDirectory;\n const isCloudMode = options.isCloudMode ?? false;\n const taskSlug = (task as any).slug || task.id;\n\n // Use taskRunId as sessionId - they are the same identifier\n this.currentRunId = taskRunId;\n\n this.logger.info(\"Starting adaptive task execution\", {\n taskId: task.id,\n taskSlug,\n taskRunId,\n isCloudMode,\n });\n\n const connection = this.getOrCreateConnection();\n\n // Create sendNotification using ACP connection's extNotification\n const sendNotification: SendNotification = async (method, params) => {\n this.logger.debug(`Notification: ${method}`, params);\n await connection.agentConnection.extNotification?.(method, params);\n };\n\n await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {\n sessionId: taskRunId,\n runId: taskRunId,\n });\n\n await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);\n\n let taskError: Error | undefined;\n try {\n const workflowContext: WorkflowRuntime = {\n task,\n taskSlug,\n runId: taskRunId,\n cwd,\n isCloudMode,\n options,\n logger: this.logger,\n fileManager: this.fileManager,\n gitManager: this.gitManager,\n promptBuilder: this.promptBuilder,\n connection: connection.agentConnection,\n sessionId: taskRunId,\n sendNotification,\n mcpServers: this.mcpServers,\n posthogAPI: this.posthogAPI,\n stepResults: {},\n };\n\n for (const step of TASK_WORKFLOW) {\n const result = await step.run({ step, context: workflowContext });\n if (result.halt) {\n return;\n }\n }\n\n const shouldCreatePR = options.createPR ?? isCloudMode;\n if (shouldCreatePR) {\n await this.ensurePullRequest(\n task,\n workflowContext.stepResults,\n sendNotification,\n );\n }\n\n this.logger.info(\"Task execution complete\", { taskId: task.id });\n await sendNotification(POSTHOG_NOTIFICATIONS.TASK_COMPLETE, {\n sessionId: taskRunId,\n taskId: task.id,\n });\n } catch (error) {\n taskError = error instanceof Error ? error : new Error(String(error));\n this.logger.error(\"Task execution failed\", {\n taskId: task.id,\n error: taskError.message,\n });\n await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {\n sessionId: taskRunId,\n message: taskError.message,\n });\n throw taskError;\n }\n }\n\n /**\n * Creates an in-process ACP connection for client communication.\n * Sets up git branch for the task, configures LLM gateway.\n * The client handles all prompting/querying via the returned streams.\n *\n * @returns InProcessAcpConnection with clientStreams for the client to use\n */\n async runTaskV2(\n taskId: string,\n taskRunId: string,\n options: import(\"./types.js\").TaskExecutionOptions = {},\n ): Promise<InProcessAcpConnection> {\n await this._configureLlmGateway();\n\n const task = await this.fetchTask(taskId);\n const taskSlug = (task as any).slug || task.id;\n const isCloudMode = options.isCloudMode ?? false;\n const _cwd = options.repositoryPath || this.workingDirectory;\n\n // Use taskRunId as sessionId - they are the same identifier\n this.currentRunId = taskRunId;\n\n this.acpConnection = createAcpConnection({\n sessionStore: this.sessionStore,\n sessionId: taskRunId,\n taskId: task.id,\n });\n\n const sendNotification: SendNotification = async (method, params) => {\n this.logger.debug(`Notification: ${method}`, params);\n await this.acpConnection?.agentConnection.extNotification?.(\n method,\n params,\n );\n };\n\n await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {\n sessionId: taskRunId,\n runId: taskRunId,\n });\n\n if (!options.skipGitBranch) {\n try {\n await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n this.logger.error(\"Failed to prepare task branch\", {\n error: errorMessage,\n });\n await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {\n sessionId: taskRunId,\n message: errorMessage,\n });\n throw error;\n }\n }\n\n return this.acpConnection;\n }\n\n // PostHog task operations\n async fetchTask(taskId: string): Promise<Task> {\n if (!this.posthogAPI) {\n const error = new Error(\n \"PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n return this.posthogAPI.fetchTask(taskId);\n }\n\n getPostHogClient(): PostHogAPIClient | undefined {\n return this.posthogAPI;\n }\n\n async getTaskFiles(taskId: string): Promise<any[]> {\n this.logger.debug(\"Getting task files\", { taskId });\n const files = await this.fileManager.getTaskFiles(taskId);\n this.logger.debug(\"Found task files\", { taskId, fileCount: files.length });\n return files;\n }\n\n async createPullRequest(\n taskId: string,\n branchName: string,\n taskTitle: string,\n taskDescription: string,\n customBody?: string,\n ): Promise<string> {\n this.logger.info(\"Creating pull request\", {\n taskId,\n branchName,\n taskTitle,\n });\n\n const defaultBody = `## Task Details\n**Task ID**: ${taskId}\n**Description**: ${taskDescription}\n\n## Changes\nThis PR implements the changes described in the task.\n\nGenerated by PostHog Agent`;\n const prBody = customBody || defaultBody;\n\n const prUrl = await this.gitManager.createPullRequest(\n branchName,\n taskTitle,\n prBody,\n );\n\n this.logger.info(\"Pull request created\", { taskId, prUrl });\n return prUrl;\n }\n\n async attachPullRequestToTask(\n taskId: string,\n prUrl: string,\n branchName?: string,\n ): Promise<void> {\n this.logger.info(\"Attaching PR to task run\", { taskId, prUrl, branchName });\n\n if (!this.posthogAPI || !this.currentRunId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot attach PR to task.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n const updates: any = {\n output: { pr_url: prUrl },\n };\n if (branchName) {\n updates.branch = branchName;\n }\n\n await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, updates);\n this.logger.debug(\"PR attached to task run\", {\n taskId,\n runId: this.currentRunId,\n prUrl,\n });\n }\n\n async updateTaskBranch(taskId: string, branchName: string): Promise<void> {\n this.logger.info(\"Updating task run branch\", { taskId, branchName });\n\n if (!this.posthogAPI || !this.currentRunId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot update branch.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, {\n branch: branchName,\n });\n this.logger.debug(\"Task run branch updated\", {\n taskId,\n runId: this.currentRunId,\n branchName,\n });\n }\n\n // Execution management\n cancelTask(taskId: string): void {\n // Find the execution for this task and cancel it\n for (const [executionId, execution] of this.taskManager.executionStates) {\n if (execution.taskId === taskId && execution.status === \"running\") {\n this.taskManager.cancelExecution(executionId);\n break;\n }\n }\n }\n\n getTaskExecutionStatus(taskId: string): string | null {\n // Find the execution for this task\n for (const execution of this.taskManager.executionStates.values()) {\n if (execution.taskId === taskId) {\n return execution.status;\n }\n }\n return null;\n }\n\n private async prepareTaskBranch(\n taskSlug: string,\n isCloudMode: boolean,\n sendNotification: SendNotification,\n ): Promise<void> {\n if (await this.gitManager.hasChanges()) {\n throw new Error(\n \"Cannot start task with uncommitted changes. Please commit or stash your changes first.\",\n );\n }\n\n // If we're running in a worktree, we're already on the correct branch\n // (the worktree was created with its own branch). Skip branch creation.\n const isWorktree = await this.gitManager.isWorktree();\n if (isWorktree) {\n const currentBranch = await this.gitManager.getCurrentBranch();\n this.logger.info(\"Running in worktree, using existing branch\", {\n branch: currentBranch,\n });\n await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {\n branch: currentBranch,\n });\n return;\n }\n\n await this.gitManager.resetToDefaultBranchIfNeeded();\n\n const existingBranch = await this.gitManager.getTaskBranch(taskSlug);\n if (!existingBranch) {\n const branchName = await this.gitManager.createTaskBranch(taskSlug);\n await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {\n branch: branchName,\n });\n\n await this.gitManager.addAllPostHogFiles();\n\n // Only commit if there are changes or we're in cloud mode\n if (isCloudMode) {\n await this.gitManager.commitAndPush(`Initialize task ${taskSlug}`, {\n allowEmpty: true,\n });\n } else {\n // Check if there are any changes before committing\n const hasChanges = await this.gitManager.hasStagedChanges();\n if (hasChanges) {\n await this.gitManager.commitChanges(`Initialize task ${taskSlug}`);\n }\n }\n } else {\n this.logger.info(\"Switching to existing task branch\", {\n branch: existingBranch,\n });\n await this.gitManager.switchToBranch(existingBranch);\n }\n }\n\n private ensureOpenAIGatewayEnv(gatewayUrl?: string, token?: string): void {\n const resolvedGatewayUrl = gatewayUrl || process.env.ANTHROPIC_BASE_URL;\n const resolvedToken = token || process.env.ANTHROPIC_AUTH_TOKEN;\n\n if (resolvedGatewayUrl) {\n process.env.OPENAI_BASE_URL = resolvedGatewayUrl;\n }\n\n if (resolvedToken) {\n process.env.OPENAI_API_KEY = resolvedToken;\n }\n }\n\n private async ensurePullRequest(\n task: Task,\n stepResults: Record<string, any>,\n sendNotification: SendNotification,\n ): Promise<void> {\n const latestRun = task.latest_run;\n const existingPr =\n latestRun?.output && typeof latestRun.output === \"object\"\n ? (latestRun.output as any).pr_url\n : null;\n\n if (existingPr) {\n this.logger.info(\"PR already exists, skipping creation\", {\n taskId: task.id,\n prUrl: existingPr,\n });\n return;\n }\n\n const buildResult = stepResults.build;\n if (!buildResult?.commitCreated) {\n this.logger.warn(\n \"Build step did not produce a commit; skipping PR creation\",\n { taskId: task.id },\n );\n return;\n }\n\n const branchName = await this.gitManager.getCurrentBranch();\n const finalizeResult = stepResults.finalize;\n const prBody = finalizeResult?.prBody;\n\n const prUrl = await this.createPullRequest(\n task.id,\n branchName,\n task.title,\n task.description ?? \"\",\n prBody,\n );\n\n await sendNotification(POSTHOG_NOTIFICATIONS.PR_CREATED, { prUrl });\n\n try {\n await this.attachPullRequestToTask(task.id, prUrl, branchName);\n this.logger.info(\"PR attached to task successfully\", {\n taskId: task.id,\n prUrl,\n });\n } catch (error) {\n this.logger.warn(\"Could not attach PR to task\", {\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n}\n\nexport type {\n AgentConfig,\n ExecutionResult,\n SupportingFile,\n Task,\n} from \"./types.js\";\nexport { PermissionMode } from \"./types.js\";\n"],"names":[],"mappings":";;;;;;;;;;;;;MAiBa,KAAK,CAAA;AACR,IAAA,gBAAgB;AAChB,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,eAAe;AACf,IAAA,MAAM;AACN,IAAA,aAAa;AACb,IAAA,aAAa;AACb,IAAA,UAAU;AACV,IAAA,UAAU;AACV,IAAA,YAAY;AACZ,IAAA,YAAY;AACb,IAAA,KAAK;AAEZ,IAAA,WAAA,CAAY,MAAmB,EAAA;QAC7B,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,EAAE;AAChE,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;QACnC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,KAAK;;AAGlC,QAAA,MAAM,aAAa,GACjB,MAAM,CAAC,aAAa;YACpB,OA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,EAAE,UAAU,CAAC;AAC9D,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;gBACnD,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,KAAK;AACN,aAAA,CAAC;QACJ;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE;AAC9C,gBAAA,KAAK,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9D,aAAA,CAAC;QACJ;IACF;AACD;;;;"}
|
|
@@ -33,8 +33,8 @@ export declare class PostHogFileManager {
|
|
|
33
33
|
readRequirements(taskId: string): Promise<string | null>;
|
|
34
34
|
writeResearch(taskId: string, data: ResearchEvaluation): Promise<void>;
|
|
35
35
|
readResearch(taskId: string): Promise<ResearchEvaluation | null>;
|
|
36
|
-
writeTodos(taskId: string, data:
|
|
37
|
-
readTodos(taskId: string): Promise<
|
|
36
|
+
writeTodos(taskId: string, data: unknown): Promise<void>;
|
|
37
|
+
readTodos(taskId: string): Promise<unknown | null>;
|
|
38
38
|
getTaskFiles(taskId: string): Promise<SupportingFile[]>;
|
|
39
39
|
collectTaskArtifacts(taskId: string): Promise<LocalArtifact[]>;
|
|
40
40
|
private resolveFileType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-manager.d.ts","sourceRoot":"","sources":["../../src/file-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-manager.d.ts","sourceRoot":"","sources":["../../src/file-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE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