@posthog/agent 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1274 -20
- package/dist/index.js +7296 -11
- package/dist/index.js.map +1 -1
- package/package.json +6 -12
- package/src/agent.ts +42 -5
- package/src/types.ts +1 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -6
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/_tslib.js +0 -74
- package/dist/_virtual/_tslib.js.map +0 -1
- package/dist/_virtual/additionalItems.js +0 -4
- package/dist/_virtual/additionalItems.js.map +0 -1
- package/dist/_virtual/additionalProperties.js +0 -4
- package/dist/_virtual/additionalProperties.js.map +0 -1
- package/dist/_virtual/ajv.js +0 -4
- package/dist/_virtual/ajv.js.map +0 -1
- package/dist/_virtual/allOf.js +0 -4
- package/dist/_virtual/allOf.js.map +0 -1
- package/dist/_virtual/anyOf.js +0 -4
- package/dist/_virtual/anyOf.js.map +0 -1
- package/dist/_virtual/applicability.js +0 -4
- package/dist/_virtual/applicability.js.map +0 -1
- package/dist/_virtual/boolSchema.js +0 -4
- package/dist/_virtual/boolSchema.js.map +0 -1
- package/dist/_virtual/code.js +0 -4
- package/dist/_virtual/code.js.map +0 -1
- package/dist/_virtual/code2.js +0 -4
- package/dist/_virtual/code2.js.map +0 -1
- package/dist/_virtual/const.js +0 -4
- package/dist/_virtual/const.js.map +0 -1
- package/dist/_virtual/contains.js +0 -4
- package/dist/_virtual/contains.js.map +0 -1
- package/dist/_virtual/core.js +0 -4
- package/dist/_virtual/core.js.map +0 -1
- package/dist/_virtual/dataType.js +0 -4
- package/dist/_virtual/dataType.js.map +0 -1
- package/dist/_virtual/defaults.js +0 -4
- package/dist/_virtual/defaults.js.map +0 -1
- package/dist/_virtual/dependencies.js +0 -4
- package/dist/_virtual/dependencies.js.map +0 -1
- package/dist/_virtual/draft7.js +0 -4
- package/dist/_virtual/draft7.js.map +0 -1
- package/dist/_virtual/enum.js +0 -4
- package/dist/_virtual/enum.js.map +0 -1
- package/dist/_virtual/equal.js +0 -4
- package/dist/_virtual/equal.js.map +0 -1
- package/dist/_virtual/errors.js +0 -4
- package/dist/_virtual/errors.js.map +0 -1
- package/dist/_virtual/format.js +0 -4
- package/dist/_virtual/format.js.map +0 -1
- package/dist/_virtual/formats.js +0 -4
- package/dist/_virtual/formats.js.map +0 -1
- package/dist/_virtual/id.js +0 -4
- package/dist/_virtual/id.js.map +0 -1
- package/dist/_virtual/if.js +0 -4
- package/dist/_virtual/if.js.map +0 -1
- package/dist/_virtual/index.js +0 -4
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/index10.js +0 -4
- package/dist/_virtual/index10.js.map +0 -1
- package/dist/_virtual/index11.js +0 -4
- package/dist/_virtual/index11.js.map +0 -1
- package/dist/_virtual/index2.js +0 -4
- package/dist/_virtual/index2.js.map +0 -1
- package/dist/_virtual/index3.js +0 -4
- package/dist/_virtual/index3.js.map +0 -1
- package/dist/_virtual/index4.js +0 -4
- package/dist/_virtual/index4.js.map +0 -1
- package/dist/_virtual/index5.js +0 -4
- package/dist/_virtual/index5.js.map +0 -1
- package/dist/_virtual/index6.js +0 -4
- package/dist/_virtual/index6.js.map +0 -1
- package/dist/_virtual/index7.js +0 -4
- package/dist/_virtual/index7.js.map +0 -1
- package/dist/_virtual/index8.js +0 -4
- package/dist/_virtual/index8.js.map +0 -1
- package/dist/_virtual/index9.js +0 -4
- package/dist/_virtual/index9.js.map +0 -1
- package/dist/_virtual/items.js +0 -4
- package/dist/_virtual/items.js.map +0 -1
- package/dist/_virtual/items2020.js +0 -4
- package/dist/_virtual/items2020.js.map +0 -1
- package/dist/_virtual/keyword.js +0 -4
- package/dist/_virtual/keyword.js.map +0 -1
- package/dist/_virtual/limit.js +0 -4
- package/dist/_virtual/limit.js.map +0 -1
- package/dist/_virtual/limitItems.js +0 -4
- package/dist/_virtual/limitItems.js.map +0 -1
- package/dist/_virtual/limitLength.js +0 -4
- package/dist/_virtual/limitLength.js.map +0 -1
- package/dist/_virtual/limitNumber.js +0 -4
- package/dist/_virtual/limitNumber.js.map +0 -1
- package/dist/_virtual/limitProperties.js +0 -4
- package/dist/_virtual/limitProperties.js.map +0 -1
- package/dist/_virtual/metadata.js +0 -4
- package/dist/_virtual/metadata.js.map +0 -1
- package/dist/_virtual/multipleOf.js +0 -4
- package/dist/_virtual/multipleOf.js.map +0 -1
- package/dist/_virtual/names.js +0 -4
- package/dist/_virtual/names.js.map +0 -1
- package/dist/_virtual/not.js +0 -4
- package/dist/_virtual/not.js.map +0 -1
- package/dist/_virtual/oneOf.js +0 -4
- package/dist/_virtual/oneOf.js.map +0 -1
- package/dist/_virtual/pattern.js +0 -4
- package/dist/_virtual/pattern.js.map +0 -1
- package/dist/_virtual/patternProperties.js +0 -4
- package/dist/_virtual/patternProperties.js.map +0 -1
- package/dist/_virtual/prefixItems.js +0 -4
- package/dist/_virtual/prefixItems.js.map +0 -1
- package/dist/_virtual/properties.js +0 -4
- package/dist/_virtual/properties.js.map +0 -1
- package/dist/_virtual/propertyNames.js +0 -4
- package/dist/_virtual/propertyNames.js.map +0 -1
- package/dist/_virtual/ref.js +0 -4
- package/dist/_virtual/ref.js.map +0 -1
- package/dist/_virtual/ref_error.js +0 -4
- package/dist/_virtual/ref_error.js.map +0 -1
- package/dist/_virtual/required.js +0 -4
- package/dist/_virtual/required.js.map +0 -1
- package/dist/_virtual/resolve.js +0 -4
- package/dist/_virtual/resolve.js.map +0 -1
- package/dist/_virtual/rules.js +0 -4
- package/dist/_virtual/rules.js.map +0 -1
- package/dist/_virtual/scope.js +0 -4
- package/dist/_virtual/scope.js.map +0 -1
- package/dist/_virtual/subschema.js +0 -4
- package/dist/_virtual/subschema.js.map +0 -1
- package/dist/_virtual/thenElse.js +0 -4
- package/dist/_virtual/thenElse.js.map +0 -1
- package/dist/_virtual/types.js +0 -4
- package/dist/_virtual/types.js.map +0 -1
- package/dist/_virtual/ucs2length.js +0 -4
- package/dist/_virtual/ucs2length.js.map +0 -1
- package/dist/_virtual/uniqueItems.js +0 -4
- package/dist/_virtual/uniqueItems.js.map +0 -1
- package/dist/_virtual/uri.js +0 -4
- package/dist/_virtual/uri.js.map +0 -1
- package/dist/_virtual/util.js +0 -4
- package/dist/_virtual/util.js.map +0 -1
- package/dist/_virtual/validation_error.js +0 -4
- package/dist/_virtual/validation_error.js.map +0 -1
- package/dist/example-client.d.ts +0 -3
- package/dist/example-client.d.ts.map +0 -1
- package/dist/example.d.ts +0 -3
- package/dist/example.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js +0 -891
- package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +0 -1
- package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js +0 -876
- package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js.map +0 -1
- package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js +0 -66
- package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +0 -23
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +0 -331
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +0 -717
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +0 -221
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +0 -56
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +0 -440
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +0 -94
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +0 -1610
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +0 -91
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js +0 -133
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js +0 -9
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js +0 -9
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js +0 -112
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js +0 -136
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js +0 -112
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js +0 -3297
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js +0 -44
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js +0 -36
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js +0 -10
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js +0 -657
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js +0 -449
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js +0 -413
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js +0 -57
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js +0 -86
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js +0 -61
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js +0 -80
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js +0 -1307
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js +0 -842
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js +0 -335
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js +0 -8
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js +0 -51
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js.map +0 -1
- package/dist/node_modules/ajv/dist/ajv.js +0 -69
- package/dist/node_modules/ajv/dist/ajv.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/codegen/code.js +0 -169
- package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/codegen/index.js +0 -712
- package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js +0 -157
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/errors.js +0 -140
- package/dist/node_modules/ajv/dist/compile/errors.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/index.js +0 -253
- package/dist/node_modules/ajv/dist/compile/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/names.js +0 -40
- package/dist/node_modules/ajv/dist/compile/names.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/ref_error.js +0 -25
- package/dist/node_modules/ajv/dist/compile/ref_error.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/resolve.js +0 -162
- package/dist/node_modules/ajv/dist/compile/resolve.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/rules.js +0 -29
- package/dist/node_modules/ajv/dist/compile/rules.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/util.js +0 -183
- package/dist/node_modules/ajv/dist/compile/util.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js +0 -30
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -64
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js +0 -213
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js +0 -49
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/index.js +0 -544
- package/dist/node_modules/ajv/dist/compile/validate/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js +0 -139
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +0 -1
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js +0 -95
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +0 -1
- package/dist/node_modules/ajv/dist/core.js +0 -639
- package/dist/node_modules/ajv/dist/core.js.map +0 -1
- package/dist/node_modules/ajv/dist/refs/data.json.js +0 -31
- package/dist/node_modules/ajv/dist/refs/data.json.js.map +0 -1
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +0 -254
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/equal.js +0 -9
- package/dist/node_modules/ajv/dist/runtime/equal.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js +0 -25
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/uri.js +0 -8
- package/dist/node_modules/ajv/dist/runtime/uri.js.map +0 -1
- package/dist/node_modules/ajv/dist/runtime/validation_error.js +0 -22
- package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -53
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -112
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -26
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -14
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -99
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -93
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -70
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -77
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -57
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -37
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -29
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -64
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -80
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -15
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -61
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -42
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -16
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/code.js +0 -146
- package/dist/node_modules/ajv/dist/vocabularies/code.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js +0 -11
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +0 -21
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +0 -131
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -113
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -12
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js +0 -28
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js +0 -94
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +0 -9
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js +0 -21
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +0 -31
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -54
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +0 -54
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -26
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -33
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -29
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -26
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -28
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -27
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +0 -84
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +0 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -72
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +0 -1
- package/dist/node_modules/ajv-formats/dist/formats.js +0 -212
- package/dist/node_modules/ajv-formats/dist/formats.js.map +0 -1
- package/dist/node_modules/ajv-formats/dist/index.js +0 -52
- package/dist/node_modules/ajv-formats/dist/index.js.map +0 -1
- package/dist/node_modules/ajv-formats/dist/limit.js +0 -75
- package/dist/node_modules/ajv-formats/dist/limit.js.map +0 -1
- package/dist/node_modules/diff/libesm/diff/base.js +0 -256
- package/dist/node_modules/diff/libesm/diff/base.js.map +0 -1
- package/dist/node_modules/diff/libesm/diff/line.js +0 -64
- package/dist/node_modules/diff/libesm/diff/line.js.map +0 -1
- package/dist/node_modules/diff/libesm/patch/create.js +0 -185
- package/dist/node_modules/diff/libesm/patch/create.js.map +0 -1
- package/dist/node_modules/fast-deep-equal/index.js +0 -47
- package/dist/node_modules/fast-deep-equal/index.js.map +0 -1
- package/dist/node_modules/fast-uri/index.js +0 -347
- package/dist/node_modules/fast-uri/index.js.map +0 -1
- package/dist/node_modules/fast-uri/lib/schemes.js +0 -255
- package/dist/node_modules/fast-uri/lib/schemes.js.map +0 -1
- package/dist/node_modules/fast-uri/lib/utils.js +0 -334
- package/dist/node_modules/fast-uri/lib/utils.js.map +0 -1
- package/dist/node_modules/json-schema-traverse/index.js +0 -98
- package/dist/node_modules/json-schema-traverse/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/rng.js +0 -14
- package/dist/node_modules/uuid/dist/rng.js.map +0 -1
- package/dist/node_modules/uuid/dist/stringify.js +0 -29
- package/dist/node_modules/uuid/dist/stringify.js.map +0 -1
- package/dist/node_modules/uuid/dist/v7.js +0 -65
- package/dist/node_modules/uuid/dist/v7.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -37
- package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -26
- package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +0 -17
- package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -11
- package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +0 -66
- package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +0 -21
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +0 -30
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +0 -53
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +0 -8
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +0 -8
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +0 -8
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +0 -50
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +0 -11
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +0 -11
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +0 -9
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +0 -56
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +0 -24
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +0 -30
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +0 -19
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +0 -15
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +0 -13
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +0 -37
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +0 -56
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +0 -76
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +0 -25
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +0 -24
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +0 -8
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +0 -8
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +0 -65
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +0 -24
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -350
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +0 -36
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +0 -10
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +0 -84
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +0 -8
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +0 -109
- package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +0 -90
- package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +0 -1
- package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js +0 -42
- package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js.map +0 -1
- package/dist/package.json.js +0 -8
- package/dist/package.json.js.map +0 -1
- package/dist/src/acp-extensions.d.ts +0 -91
- package/dist/src/acp-extensions.d.ts.map +0 -1
- package/dist/src/acp-extensions.js +0 -38
- package/dist/src/acp-extensions.js.map +0 -1
- package/dist/src/adapters/claude/claude.d.ts +0 -136
- package/dist/src/adapters/claude/claude.d.ts.map +0 -1
- package/dist/src/adapters/claude/claude.js +0 -1128
- package/dist/src/adapters/claude/claude.js.map +0 -1
- package/dist/src/adapters/claude/mcp-server.d.ts +0 -30
- package/dist/src/adapters/claude/mcp-server.d.ts.map +0 -1
- package/dist/src/adapters/claude/mcp-server.js +0 -668
- package/dist/src/adapters/claude/mcp-server.js.map +0 -1
- package/dist/src/adapters/claude/tools.d.ts +0 -35
- package/dist/src/adapters/claude/tools.d.ts.map +0 -1
- package/dist/src/adapters/claude/tools.js +0 -473
- package/dist/src/adapters/claude/tools.js.map +0 -1
- package/dist/src/adapters/claude/utils.d.ts +0 -48
- package/dist/src/adapters/claude/utils.d.ts.map +0 -1
- package/dist/src/adapters/claude/utils.js +0 -158
- package/dist/src/adapters/claude/utils.js.map +0 -1
- package/dist/src/agent.d.ts +0 -58
- package/dist/src/agent.d.ts.map +0 -1
- package/dist/src/agent.js +0 -576
- package/dist/src/agent.js.map +0 -1
- package/dist/src/agents/execution.d.ts +0 -2
- package/dist/src/agents/execution.d.ts.map +0 -1
- package/dist/src/agents/execution.js +0 -40
- package/dist/src/agents/execution.js.map +0 -1
- package/dist/src/agents/planning.d.ts +0 -2
- package/dist/src/agents/planning.d.ts.map +0 -1
- package/dist/src/agents/planning.js +0 -63
- package/dist/src/agents/planning.js.map +0 -1
- package/dist/src/agents/research.d.ts +0 -2
- package/dist/src/agents/research.d.ts.map +0 -1
- package/dist/src/agents/research.js +0 -163
- package/dist/src/agents/research.js.map +0 -1
- package/dist/src/file-manager.d.ts +0 -43
- package/dist/src/file-manager.d.ts.map +0 -1
- package/dist/src/file-manager.js +0 -266
- package/dist/src/file-manager.js.map +0 -1
- package/dist/src/git-manager.d.ts +0 -79
- package/dist/src/git-manager.d.ts.map +0 -1
- package/dist/src/git-manager.js +0 -454
- package/dist/src/git-manager.js.map +0 -1
- package/dist/src/posthog-api.d.ts +0 -48
- package/dist/src/posthog-api.d.ts.map +0 -1
- package/dist/src/posthog-api.js +0 -260
- package/dist/src/posthog-api.js.map +0 -1
- package/dist/src/prompt-builder.d.ts +0 -49
- package/dist/src/prompt-builder.d.ts.map +0 -1
- package/dist/src/prompt-builder.js +0 -397
- package/dist/src/prompt-builder.js.map +0 -1
- package/dist/src/schemas.d.ts +0 -980
- package/dist/src/schemas.d.ts.map +0 -1
- package/dist/src/schemas.js +0 -196
- package/dist/src/schemas.js.map +0 -1
- package/dist/src/session-store.d.ts +0 -58
- package/dist/src/session-store.d.ts.map +0 -1
- package/dist/src/session-store.js +0 -206
- package/dist/src/session-store.js.map +0 -1
- package/dist/src/task-manager.d.ts +0 -25
- package/dist/src/task-manager.d.ts.map +0 -1
- package/dist/src/task-manager.js +0 -123
- package/dist/src/task-manager.js.map +0 -1
- package/dist/src/template-manager.d.ts +0 -30
- package/dist/src/template-manager.d.ts.map +0 -1
- package/dist/src/template-manager.js +0 -152
- package/dist/src/template-manager.js.map +0 -1
- package/dist/src/todo-manager.d.ts +0 -29
- package/dist/src/todo-manager.d.ts.map +0 -1
- package/dist/src/todo-manager.js +0 -135
- package/dist/src/todo-manager.js.map +0 -1
- package/dist/src/tools/registry.d.ts +0 -25
- package/dist/src/tools/registry.d.ts.map +0 -1
- package/dist/src/tools/registry.js +0 -120
- package/dist/src/tools/registry.js.map +0 -1
- package/dist/src/tools/types.d.ts +0 -80
- package/dist/src/tools/types.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -193
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -11
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils/logger.d.ts +0 -37
- package/dist/src/utils/logger.d.ts.map +0 -1
- package/dist/src/utils/logger.js +0 -83
- package/dist/src/utils/logger.js.map +0 -1
- package/dist/src/utils/tapped-stream.d.ts +0 -17
- package/dist/src/utils/tapped-stream.d.ts.map +0 -1
- package/dist/src/utils/tapped-stream.js +0 -45
- package/dist/src/utils/tapped-stream.js.map +0 -1
- package/dist/src/workflow/config.d.ts +0 -3
- package/dist/src/workflow/config.d.ts.map +0 -1
- package/dist/src/workflow/config.js +0 -54
- package/dist/src/workflow/config.js.map +0 -1
- package/dist/src/workflow/steps/build.d.ts +0 -3
- package/dist/src/workflow/steps/build.d.ts.map +0 -1
- package/dist/src/workflow/steps/build.js +0 -108
- package/dist/src/workflow/steps/build.js.map +0 -1
- package/dist/src/workflow/steps/finalize.d.ts +0 -3
- package/dist/src/workflow/steps/finalize.d.ts.map +0 -1
- package/dist/src/workflow/steps/finalize.js +0 -188
- package/dist/src/workflow/steps/finalize.js.map +0 -1
- package/dist/src/workflow/steps/plan.d.ts +0 -3
- package/dist/src/workflow/steps/plan.d.ts.map +0 -1
- package/dist/src/workflow/steps/plan.js +0 -136
- package/dist/src/workflow/steps/plan.js.map +0 -1
- package/dist/src/workflow/steps/research.d.ts +0 -3
- package/dist/src/workflow/steps/research.d.ts.map +0 -1
- package/dist/src/workflow/steps/research.js +0 -189
- package/dist/src/workflow/steps/research.js.map +0 -1
- package/dist/src/workflow/types.d.ts +0 -51
- package/dist/src/workflow/types.d.ts.map +0 -1
- package/dist/src/workflow/utils.d.ts +0 -12
- package/dist/src/workflow/utils.d.ts.map +0 -1
- package/dist/src/workflow/utils.js +0 -41
- package/dist/src/workflow/utils.js.map +0 -1
- package/dist/src/worktree-manager.d.ts +0 -39
- package/dist/src/worktree-manager.d.ts.map +0 -1
- package/dist/src/worktree-manager.js +0 -808
- package/dist/src/worktree-manager.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,1274 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { AgentSideConnection } from '@agentclientprotocol/sdk';
|
|
2
|
+
export { SessionNotification } from '@agentclientprotocol/sdk';
|
|
3
|
+
import { CanUseTool } from '@anthropic-ai/claude-agent-sdk';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* PostHog-specific ACP extensions.
|
|
8
|
+
*
|
|
9
|
+
* These follow the ACP extensibility model:
|
|
10
|
+
* - Custom notification methods are prefixed with `_posthog/`
|
|
11
|
+
* - Custom data can be attached via `_meta` fields
|
|
12
|
+
*
|
|
13
|
+
* See: https://agentclientprotocol.com/docs/extensibility
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Custom notification methods for PostHog-specific events.
|
|
17
|
+
* Used with AgentSideConnection.extNotification() or Client.extNotification()
|
|
18
|
+
*/
|
|
19
|
+
declare const POSTHOG_NOTIFICATIONS: {
|
|
20
|
+
/** Artifact produced during task execution (research, plan, etc.) */
|
|
21
|
+
readonly ARTIFACT: "_posthog/artifact";
|
|
22
|
+
/** Phase has started (research, plan, build, etc.) */
|
|
23
|
+
readonly PHASE_START: "_posthog/phase_start";
|
|
24
|
+
/** Phase has completed */
|
|
25
|
+
readonly PHASE_COMPLETE: "_posthog/phase_complete";
|
|
26
|
+
/** Git branch was created */
|
|
27
|
+
readonly BRANCH_CREATED: "_posthog/branch_created";
|
|
28
|
+
/** Pull request was created */
|
|
29
|
+
readonly PR_CREATED: "_posthog/pr_created";
|
|
30
|
+
/** Task run has started */
|
|
31
|
+
readonly RUN_STARTED: "_posthog/run_started";
|
|
32
|
+
/** Task has completed */
|
|
33
|
+
readonly TASK_COMPLETE: "_posthog/task_complete";
|
|
34
|
+
/** Error occurred during task execution */
|
|
35
|
+
readonly ERROR: "_posthog/error";
|
|
36
|
+
/** Console/log output */
|
|
37
|
+
readonly CONSOLE: "_posthog/console";
|
|
38
|
+
/** SDK session ID notification (for resumption) */
|
|
39
|
+
readonly SDK_SESSION: "_posthog/sdk_session";
|
|
40
|
+
};
|
|
41
|
+
type PostHogNotificationType = (typeof POSTHOG_NOTIFICATIONS)[keyof typeof POSTHOG_NOTIFICATIONS];
|
|
42
|
+
interface ArtifactNotificationPayload {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
kind: "research_evaluation" | "research_questions" | "plan" | "pr_body" | string;
|
|
45
|
+
content: unknown;
|
|
46
|
+
}
|
|
47
|
+
interface PhaseNotificationPayload {
|
|
48
|
+
sessionId: string;
|
|
49
|
+
phase: "research" | "plan" | "build" | "finalize" | string;
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
interface BranchCreatedPayload {
|
|
53
|
+
sessionId: string;
|
|
54
|
+
branch: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Payload for PR created notification
|
|
58
|
+
*/
|
|
59
|
+
interface PrCreatedPayload {
|
|
60
|
+
sessionId: string;
|
|
61
|
+
prUrl: string;
|
|
62
|
+
}
|
|
63
|
+
interface RunStartedPayload {
|
|
64
|
+
sessionId: string;
|
|
65
|
+
runId: string;
|
|
66
|
+
taskId?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Payload for task complete notification
|
|
70
|
+
*/
|
|
71
|
+
interface TaskCompletePayload {
|
|
72
|
+
sessionId: string;
|
|
73
|
+
taskId: string;
|
|
74
|
+
}
|
|
75
|
+
interface ErrorNotificationPayload {
|
|
76
|
+
sessionId: string;
|
|
77
|
+
message: string;
|
|
78
|
+
error?: unknown;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Console output for a session
|
|
82
|
+
*/
|
|
83
|
+
interface ConsoleNotificationPayload {
|
|
84
|
+
sessionId: string;
|
|
85
|
+
level: "debug" | "info" | "warn" | "error";
|
|
86
|
+
message: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Maps a session ID to a SDKs session ID
|
|
90
|
+
*/
|
|
91
|
+
interface SdkSessionPayload {
|
|
92
|
+
sessionId: string;
|
|
93
|
+
sdkSessionId: string;
|
|
94
|
+
}
|
|
95
|
+
type PostHogNotificationPayload = ArtifactNotificationPayload | PhaseNotificationPayload | BranchCreatedPayload | PrCreatedPayload | RunStartedPayload | TaskCompletePayload | ErrorNotificationPayload | ConsoleNotificationPayload | SdkSessionPayload;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Stored custom notification following ACP extensibility model.
|
|
99
|
+
* Custom notifications use underscore-prefixed methods (e.g., `_posthog/phase_start`).
|
|
100
|
+
* See: https://agentclientprotocol.com/docs/extensibility
|
|
101
|
+
*/
|
|
102
|
+
interface StoredNotification {
|
|
103
|
+
type: "notification";
|
|
104
|
+
/** When this notification was stored */
|
|
105
|
+
timestamp: string;
|
|
106
|
+
/** JSON-RPC 2.0 notification (no id field = notification, not request) */
|
|
107
|
+
notification: {
|
|
108
|
+
jsonrpc: "2.0";
|
|
109
|
+
method: string;
|
|
110
|
+
params?: Record<string, unknown>;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Type alias for stored log entries.
|
|
115
|
+
*/
|
|
116
|
+
type StoredEntry = StoredNotification;
|
|
117
|
+
interface Task {
|
|
118
|
+
id: string;
|
|
119
|
+
task_number?: number;
|
|
120
|
+
slug?: string;
|
|
121
|
+
title: string;
|
|
122
|
+
description: string;
|
|
123
|
+
origin_product: "error_tracking" | "eval_clusters" | "user_created" | "support_queue" | "session_summaries";
|
|
124
|
+
github_integration?: number | null;
|
|
125
|
+
repository: string;
|
|
126
|
+
json_schema?: Record<string, unknown> | null;
|
|
127
|
+
created_at: string;
|
|
128
|
+
updated_at: string;
|
|
129
|
+
created_by?: {
|
|
130
|
+
id: number;
|
|
131
|
+
uuid: string;
|
|
132
|
+
distinct_id: string;
|
|
133
|
+
first_name: string;
|
|
134
|
+
email: string;
|
|
135
|
+
};
|
|
136
|
+
latest_run?: TaskRun;
|
|
137
|
+
}
|
|
138
|
+
type ArtifactType = "plan" | "context" | "reference" | "output" | "artifact";
|
|
139
|
+
interface TaskRunArtifact {
|
|
140
|
+
name: string;
|
|
141
|
+
type: ArtifactType;
|
|
142
|
+
size?: number;
|
|
143
|
+
content_type?: string;
|
|
144
|
+
storage_path?: string;
|
|
145
|
+
uploaded_at?: string;
|
|
146
|
+
}
|
|
147
|
+
type TaskRunStatus = "not_started" | "queued" | "in_progress" | "completed" | "failed" | "cancelled";
|
|
148
|
+
type TaskRunEnvironment = "local" | "cloud";
|
|
149
|
+
interface TaskRun {
|
|
150
|
+
id: string;
|
|
151
|
+
task: string;
|
|
152
|
+
team: number;
|
|
153
|
+
branch: string | null;
|
|
154
|
+
stage: string | null;
|
|
155
|
+
environment: TaskRunEnvironment;
|
|
156
|
+
status: TaskRunStatus;
|
|
157
|
+
log_url: string;
|
|
158
|
+
error_message: string | null;
|
|
159
|
+
output: Record<string, unknown> | null;
|
|
160
|
+
state: Record<string, unknown>;
|
|
161
|
+
artifacts?: TaskRunArtifact[];
|
|
162
|
+
created_at: string;
|
|
163
|
+
updated_at: string;
|
|
164
|
+
completed_at: string | null;
|
|
165
|
+
}
|
|
166
|
+
interface SupportingFile {
|
|
167
|
+
name: string;
|
|
168
|
+
content: string;
|
|
169
|
+
type: ArtifactType;
|
|
170
|
+
created_at: string;
|
|
171
|
+
}
|
|
172
|
+
interface TaskArtifactUploadPayload {
|
|
173
|
+
name: string;
|
|
174
|
+
type: ArtifactType;
|
|
175
|
+
content: string;
|
|
176
|
+
content_type?: string;
|
|
177
|
+
}
|
|
178
|
+
declare enum PermissionMode {
|
|
179
|
+
PLAN = "plan",
|
|
180
|
+
DEFAULT = "default",
|
|
181
|
+
ACCEPT_EDITS = "acceptEdits",
|
|
182
|
+
BYPASS = "bypassPermissions"
|
|
183
|
+
}
|
|
184
|
+
interface TaskExecutionOptions {
|
|
185
|
+
repositoryPath?: string;
|
|
186
|
+
permissionMode?: PermissionMode;
|
|
187
|
+
isCloudMode?: boolean;
|
|
188
|
+
createPR?: boolean;
|
|
189
|
+
autoProgress?: boolean;
|
|
190
|
+
queryOverrides?: Record<string, unknown>;
|
|
191
|
+
canUseTool?: CanUseTool;
|
|
192
|
+
skipGitBranch?: boolean;
|
|
193
|
+
}
|
|
194
|
+
interface ExecutionResult {
|
|
195
|
+
results: any[];
|
|
196
|
+
}
|
|
197
|
+
type McpServerConfig = {
|
|
198
|
+
type?: "stdio";
|
|
199
|
+
command: string;
|
|
200
|
+
args?: string[];
|
|
201
|
+
env?: Record<string, string>;
|
|
202
|
+
} | {
|
|
203
|
+
type: "sse";
|
|
204
|
+
url: string;
|
|
205
|
+
headers?: Record<string, string>;
|
|
206
|
+
} | {
|
|
207
|
+
type: "http";
|
|
208
|
+
url: string;
|
|
209
|
+
headers?: Record<string, string>;
|
|
210
|
+
} | {
|
|
211
|
+
type: "sdk";
|
|
212
|
+
name: string;
|
|
213
|
+
instance?: any;
|
|
214
|
+
};
|
|
215
|
+
type LogLevel$1 = "debug" | "info" | "warn" | "error";
|
|
216
|
+
type OnLogCallback = (level: LogLevel$1, scope: string, message: string, data?: unknown) => void;
|
|
217
|
+
interface AgentConfig {
|
|
218
|
+
workingDirectory?: string;
|
|
219
|
+
posthogApiUrl?: string;
|
|
220
|
+
posthogApiKey?: string;
|
|
221
|
+
posthogProjectId?: number;
|
|
222
|
+
posthogMcpUrl?: string;
|
|
223
|
+
mcpServers?: Record<string, McpServerConfig>;
|
|
224
|
+
debug?: boolean;
|
|
225
|
+
onLog?: OnLogCallback;
|
|
226
|
+
canUseTool?: CanUseTool;
|
|
227
|
+
}
|
|
228
|
+
interface PostHogAPIConfig {
|
|
229
|
+
apiUrl: string;
|
|
230
|
+
apiKey: string;
|
|
231
|
+
projectId: number;
|
|
232
|
+
}
|
|
233
|
+
type ResourceType = "error" | "experiment" | "insight" | "feature_flag" | "generic";
|
|
234
|
+
interface PostHogResource {
|
|
235
|
+
type: ResourceType;
|
|
236
|
+
id: string;
|
|
237
|
+
url: string;
|
|
238
|
+
title?: string;
|
|
239
|
+
content: string;
|
|
240
|
+
metadata?: Record<string, any>;
|
|
241
|
+
}
|
|
242
|
+
interface UrlMention {
|
|
243
|
+
url: string;
|
|
244
|
+
type: ResourceType;
|
|
245
|
+
id?: string;
|
|
246
|
+
label?: string;
|
|
247
|
+
}
|
|
248
|
+
interface ResearchQuestion {
|
|
249
|
+
id: string;
|
|
250
|
+
question: string;
|
|
251
|
+
options: string[];
|
|
252
|
+
}
|
|
253
|
+
interface ResearchAnswer {
|
|
254
|
+
questionId: string;
|
|
255
|
+
selectedOption: string;
|
|
256
|
+
customInput?: string;
|
|
257
|
+
}
|
|
258
|
+
interface ResearchEvaluation {
|
|
259
|
+
actionabilityScore: number;
|
|
260
|
+
context: string;
|
|
261
|
+
keyFiles: string[];
|
|
262
|
+
blockers?: string[];
|
|
263
|
+
questions?: ResearchQuestion[];
|
|
264
|
+
answered?: boolean;
|
|
265
|
+
answers?: ResearchAnswer[];
|
|
266
|
+
}
|
|
267
|
+
interface WorktreeInfo {
|
|
268
|
+
worktreePath: string;
|
|
269
|
+
worktreeName: string;
|
|
270
|
+
branchName: string;
|
|
271
|
+
baseBranch: string;
|
|
272
|
+
createdAt: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
type TaskRunUpdate = Partial<Pick<TaskRun, "status" | "branch" | "stage" | "error_message" | "output" | "state">>;
|
|
276
|
+
type TaskCreatePayload = Pick<Task, "description"> & Partial<Pick<Task, "title" | "repository" | "origin_product">>;
|
|
277
|
+
declare class PostHogAPIClient {
|
|
278
|
+
private config;
|
|
279
|
+
constructor(config: PostHogAPIConfig);
|
|
280
|
+
private get baseUrl();
|
|
281
|
+
private get headers();
|
|
282
|
+
private apiRequest;
|
|
283
|
+
getTeamId(): number;
|
|
284
|
+
getBaseUrl(): string;
|
|
285
|
+
getApiKey(): string;
|
|
286
|
+
getLlmGatewayUrl(): string;
|
|
287
|
+
fetchTask(taskId: string): Promise<Task>;
|
|
288
|
+
listTasks(filters?: {
|
|
289
|
+
repository?: string;
|
|
290
|
+
organization?: string;
|
|
291
|
+
origin_product?: string;
|
|
292
|
+
}): Promise<Task[]>;
|
|
293
|
+
updateTask(taskId: string, updates: Partial<Task>): Promise<Task>;
|
|
294
|
+
createTask(payload: TaskCreatePayload): Promise<Task>;
|
|
295
|
+
listTaskRuns(taskId: string): Promise<TaskRun[]>;
|
|
296
|
+
getTaskRun(taskId: string, runId: string): Promise<TaskRun>;
|
|
297
|
+
createTaskRun(taskId: string, payload?: Partial<Omit<TaskRun, "id" | "task" | "team" | "created_at" | "updated_at" | "completed_at" | "artifacts">>): Promise<TaskRun>;
|
|
298
|
+
updateTaskRun(taskId: string, runId: string, payload: TaskRunUpdate): Promise<TaskRun>;
|
|
299
|
+
setTaskRunOutput(taskId: string, runId: string, output: Record<string, unknown>): Promise<TaskRun>;
|
|
300
|
+
appendTaskRunLog(taskId: string, runId: string, entries: StoredEntry[]): Promise<TaskRun>;
|
|
301
|
+
uploadTaskArtifacts(taskId: string, runId: string, artifacts: TaskArtifactUploadPayload[]): Promise<TaskRunArtifact[]>;
|
|
302
|
+
/**
|
|
303
|
+
* Fetch logs from S3 using presigned URL from TaskRun
|
|
304
|
+
* @param taskRun - The task run containing the log_url
|
|
305
|
+
* @returns Array of stored entries, or empty array if no logs available
|
|
306
|
+
*/
|
|
307
|
+
fetchTaskRunLogs(taskRun: TaskRun): Promise<StoredEntry[]>;
|
|
308
|
+
/**
|
|
309
|
+
* Fetch error details from PostHog error tracking
|
|
310
|
+
*/
|
|
311
|
+
fetchErrorDetails(errorId: string, projectId?: string): Promise<PostHogResource>;
|
|
312
|
+
/**
|
|
313
|
+
* Generic resource fetcher by URL or ID
|
|
314
|
+
*/
|
|
315
|
+
fetchResourceByUrl(urlMention: UrlMention): Promise<PostHogResource>;
|
|
316
|
+
/**
|
|
317
|
+
* Format error data for agent consumption
|
|
318
|
+
*/
|
|
319
|
+
private formatErrorContent;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Simple logger utility with configurable debug mode and external log forwarding
|
|
324
|
+
*/
|
|
325
|
+
declare enum LogLevel {
|
|
326
|
+
ERROR = 0,
|
|
327
|
+
WARN = 1,
|
|
328
|
+
INFO = 2,
|
|
329
|
+
DEBUG = 3
|
|
330
|
+
}
|
|
331
|
+
interface LoggerConfig {
|
|
332
|
+
debug?: boolean;
|
|
333
|
+
prefix?: string;
|
|
334
|
+
scope?: string;
|
|
335
|
+
onLog?: OnLogCallback;
|
|
336
|
+
}
|
|
337
|
+
declare class Logger {
|
|
338
|
+
private debugEnabled;
|
|
339
|
+
private prefix;
|
|
340
|
+
private scope;
|
|
341
|
+
private onLog?;
|
|
342
|
+
constructor(config?: LoggerConfig);
|
|
343
|
+
setDebug(enabled: boolean): void;
|
|
344
|
+
setOnLog(onLog: OnLogCallback | undefined): void;
|
|
345
|
+
private formatMessage;
|
|
346
|
+
private emitLog;
|
|
347
|
+
error(message: string, error?: Error | unknown): void;
|
|
348
|
+
warn(message: string, data?: unknown): void;
|
|
349
|
+
info(message: string, data?: unknown): void;
|
|
350
|
+
debug(message: string, data?: unknown): void;
|
|
351
|
+
log(level: LogLevel$1, message: string, data?: unknown, scope?: string): void;
|
|
352
|
+
/**
|
|
353
|
+
* Create a child logger with additional prefix and scope
|
|
354
|
+
*/
|
|
355
|
+
child(childPrefix: string): Logger;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
interface SessionPersistenceConfig {
|
|
359
|
+
taskId: string;
|
|
360
|
+
runId: string;
|
|
361
|
+
logUrl: string;
|
|
362
|
+
sdkSessionId?: string;
|
|
363
|
+
}
|
|
364
|
+
declare class SessionStore {
|
|
365
|
+
private posthogAPI?;
|
|
366
|
+
private pendingEntries;
|
|
367
|
+
private flushTimeouts;
|
|
368
|
+
private configs;
|
|
369
|
+
private logger;
|
|
370
|
+
constructor(posthogAPI?: PostHogAPIClient, logger?: Logger);
|
|
371
|
+
/** Register a session for persistence */
|
|
372
|
+
register(sessionId: string, config: SessionPersistenceConfig): void;
|
|
373
|
+
/** Unregister and flush pending */
|
|
374
|
+
unregister(sessionId: string): Promise<void>;
|
|
375
|
+
/** Check if a session is registered for persistence */
|
|
376
|
+
isRegistered(sessionId: string): boolean;
|
|
377
|
+
/**
|
|
378
|
+
* Append a raw JSON-RPC line for persistence.
|
|
379
|
+
* Parses and wraps as StoredNotification for the API.
|
|
380
|
+
*/
|
|
381
|
+
appendRawLine(sessionId: string, line: string): void;
|
|
382
|
+
/** Load raw JSON-RPC messages from S3 */
|
|
383
|
+
load(logUrl: string): Promise<StoredNotification[]>;
|
|
384
|
+
/**
|
|
385
|
+
* Poll S3 for new entries since last check.
|
|
386
|
+
* Used for interrupt handling in cloud mode.
|
|
387
|
+
*/
|
|
388
|
+
pollForNewEntries(sessionId: string, lastKnownCount: number): Promise<StoredNotification[]>;
|
|
389
|
+
/** Force flush pending entries */
|
|
390
|
+
flush(sessionId: string): Promise<void>;
|
|
391
|
+
private scheduleFlush;
|
|
392
|
+
/** Get the persistence config for a session */
|
|
393
|
+
getConfig(sessionId: string): SessionPersistenceConfig | undefined;
|
|
394
|
+
/**
|
|
395
|
+
* Start a session for persistence.
|
|
396
|
+
* Loads the task run and updates status to "in_progress".
|
|
397
|
+
*/
|
|
398
|
+
start(sessionId: string, taskId: string, runId: string): Promise<TaskRun | undefined>;
|
|
399
|
+
/**
|
|
400
|
+
* Mark a session as completed.
|
|
401
|
+
*/
|
|
402
|
+
complete(sessionId: string): Promise<void>;
|
|
403
|
+
/**
|
|
404
|
+
* Mark a session as failed.
|
|
405
|
+
*/
|
|
406
|
+
fail(sessionId: string, error: Error | string): Promise<void>;
|
|
407
|
+
/**
|
|
408
|
+
* Update the task run associated with a session.
|
|
409
|
+
*/
|
|
410
|
+
updateTaskRun(sessionId: string, update: TaskRunUpdate): Promise<TaskRun | undefined>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
type StreamPair = {
|
|
414
|
+
readable: globalThis.ReadableStream<Uint8Array>;
|
|
415
|
+
writable: globalThis.WritableStream<Uint8Array>;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* The claude adapter has been based on the original claude-code-acp adapter,
|
|
420
|
+
* and could use some cleanup.
|
|
421
|
+
*
|
|
422
|
+
* https://github.com/zed-industries/claude-code-acp
|
|
423
|
+
*/
|
|
424
|
+
|
|
425
|
+
type AcpConnectionConfig = {
|
|
426
|
+
sessionStore?: SessionStore;
|
|
427
|
+
sessionId?: string;
|
|
428
|
+
taskId?: string;
|
|
429
|
+
};
|
|
430
|
+
type InProcessAcpConnection = {
|
|
431
|
+
agentConnection: AgentSideConnection;
|
|
432
|
+
clientStreams: StreamPair;
|
|
433
|
+
};
|
|
434
|
+
declare function createAcpConnection(config?: AcpConnectionConfig): InProcessAcpConnection;
|
|
435
|
+
|
|
436
|
+
declare class Agent {
|
|
437
|
+
private workingDirectory;
|
|
438
|
+
private taskManager;
|
|
439
|
+
private posthogAPI?;
|
|
440
|
+
private fileManager;
|
|
441
|
+
private gitManager;
|
|
442
|
+
private templateManager;
|
|
443
|
+
private logger;
|
|
444
|
+
private acpConnection?;
|
|
445
|
+
private promptBuilder;
|
|
446
|
+
private mcpServers?;
|
|
447
|
+
private canUseTool?;
|
|
448
|
+
private currentRunId?;
|
|
449
|
+
private sessionStore?;
|
|
450
|
+
debug: boolean;
|
|
451
|
+
constructor(config: AgentConfig);
|
|
452
|
+
/**
|
|
453
|
+
* Enable or disable debug logging
|
|
454
|
+
*/
|
|
455
|
+
setDebug(enabled: boolean): void;
|
|
456
|
+
/**
|
|
457
|
+
* Configure LLM gateway environment variables for Claude Code CLI
|
|
458
|
+
*/
|
|
459
|
+
private _configureLlmGateway;
|
|
460
|
+
private getOrCreateConnection;
|
|
461
|
+
runTask(taskId: string, taskRunId: string, options?: TaskExecutionOptions): Promise<void>;
|
|
462
|
+
/**
|
|
463
|
+
* Creates an in-process ACP connection for client communication.
|
|
464
|
+
* Sets up git branch for the task, configures LLM gateway.
|
|
465
|
+
* The client handles all prompting/querying via the returned streams.
|
|
466
|
+
*
|
|
467
|
+
* @returns InProcessAcpConnection with clientStreams for the client to use
|
|
468
|
+
*/
|
|
469
|
+
runTaskV2(taskId: string, taskRunId: string, options?: TaskExecutionOptions): Promise<InProcessAcpConnection>;
|
|
470
|
+
fetchTask(taskId: string): Promise<Task>;
|
|
471
|
+
getPostHogClient(): PostHogAPIClient | undefined;
|
|
472
|
+
/**
|
|
473
|
+
* Send a notification to a cloud task run's S3 log.
|
|
474
|
+
* The cloud runner will pick up new notifications via interrupt polling.
|
|
475
|
+
*/
|
|
476
|
+
sendNotification(taskId: string, runId: string, notification: StoredNotification): Promise<void>;
|
|
477
|
+
getTaskFiles(taskId: string): Promise<any[]>;
|
|
478
|
+
createPullRequest(taskId: string, branchName: string, taskTitle: string, taskDescription: string, customBody?: string): Promise<string>;
|
|
479
|
+
attachPullRequestToTask(taskId: string, prUrl: string, branchName?: string): Promise<void>;
|
|
480
|
+
updateTaskBranch(taskId: string, branchName: string): Promise<void>;
|
|
481
|
+
cancelTask(taskId: string): void;
|
|
482
|
+
getTaskExecutionStatus(taskId: string): string | null;
|
|
483
|
+
private prepareTaskBranch;
|
|
484
|
+
private ensureOpenAIGatewayEnv;
|
|
485
|
+
runTaskCloud(taskId: string, taskRunId: string, options?: TaskExecutionOptions): Promise<void>;
|
|
486
|
+
private ensurePullRequest;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
declare const TokenEventSchema: z.ZodObject<{
|
|
490
|
+
ts: z.ZodNumber;
|
|
491
|
+
} & {
|
|
492
|
+
type: z.ZodLiteral<"token">;
|
|
493
|
+
content: z.ZodString;
|
|
494
|
+
contentType: z.ZodOptional<z.ZodEnum<["text", "thinking", "tool_input"]>>;
|
|
495
|
+
}, "strip", z.ZodTypeAny, {
|
|
496
|
+
type: "token";
|
|
497
|
+
content: string;
|
|
498
|
+
ts: number;
|
|
499
|
+
contentType?: "text" | "thinking" | "tool_input" | undefined;
|
|
500
|
+
}, {
|
|
501
|
+
type: "token";
|
|
502
|
+
content: string;
|
|
503
|
+
ts: number;
|
|
504
|
+
contentType?: "text" | "thinking" | "tool_input" | undefined;
|
|
505
|
+
}>;
|
|
506
|
+
declare const StatusEventSchema: z.ZodObject<{
|
|
507
|
+
ts: z.ZodNumber;
|
|
508
|
+
} & {
|
|
509
|
+
type: z.ZodLiteral<"status">;
|
|
510
|
+
phase: z.ZodString;
|
|
511
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
512
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
513
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
514
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
515
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
516
|
+
model: z.ZodOptional<z.ZodString>;
|
|
517
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
518
|
+
ts: z.ZodNumber;
|
|
519
|
+
} & {
|
|
520
|
+
type: z.ZodLiteral<"status">;
|
|
521
|
+
phase: z.ZodString;
|
|
522
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
523
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
524
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
525
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
526
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
527
|
+
model: z.ZodOptional<z.ZodString>;
|
|
528
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
529
|
+
ts: z.ZodNumber;
|
|
530
|
+
} & {
|
|
531
|
+
type: z.ZodLiteral<"status">;
|
|
532
|
+
phase: z.ZodString;
|
|
533
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
534
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
535
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
536
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
537
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
538
|
+
model: z.ZodOptional<z.ZodString>;
|
|
539
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
540
|
+
declare const ConsoleEventSchema: z.ZodObject<{
|
|
541
|
+
ts: z.ZodNumber;
|
|
542
|
+
} & {
|
|
543
|
+
type: z.ZodLiteral<"console">;
|
|
544
|
+
level: z.ZodEnum<["debug", "info", "warn", "error"]>;
|
|
545
|
+
message: z.ZodString;
|
|
546
|
+
}, "strip", z.ZodTypeAny, {
|
|
547
|
+
type: "console";
|
|
548
|
+
message: string;
|
|
549
|
+
ts: number;
|
|
550
|
+
level: "debug" | "info" | "warn" | "error";
|
|
551
|
+
}, {
|
|
552
|
+
type: "console";
|
|
553
|
+
message: string;
|
|
554
|
+
ts: number;
|
|
555
|
+
level: "debug" | "info" | "warn" | "error";
|
|
556
|
+
}>;
|
|
557
|
+
declare const ErrorEventSchema: z.ZodObject<{
|
|
558
|
+
ts: z.ZodNumber;
|
|
559
|
+
} & {
|
|
560
|
+
type: z.ZodLiteral<"error">;
|
|
561
|
+
message: z.ZodString;
|
|
562
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
563
|
+
errorType: z.ZodOptional<z.ZodString>;
|
|
564
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
565
|
+
sdkError: z.ZodOptional<z.ZodUnknown>;
|
|
566
|
+
}, "strip", z.ZodTypeAny, {
|
|
567
|
+
type: "error";
|
|
568
|
+
message: string;
|
|
569
|
+
ts: number;
|
|
570
|
+
error?: unknown;
|
|
571
|
+
context?: Record<string, unknown> | undefined;
|
|
572
|
+
errorType?: string | undefined;
|
|
573
|
+
sdkError?: unknown;
|
|
574
|
+
}, {
|
|
575
|
+
type: "error";
|
|
576
|
+
message: string;
|
|
577
|
+
ts: number;
|
|
578
|
+
error?: unknown;
|
|
579
|
+
context?: Record<string, unknown> | undefined;
|
|
580
|
+
errorType?: string | undefined;
|
|
581
|
+
sdkError?: unknown;
|
|
582
|
+
}>;
|
|
583
|
+
declare const AgentEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
584
|
+
ts: z.ZodNumber;
|
|
585
|
+
} & {
|
|
586
|
+
type: z.ZodLiteral<"token">;
|
|
587
|
+
content: z.ZodString;
|
|
588
|
+
contentType: z.ZodOptional<z.ZodEnum<["text", "thinking", "tool_input"]>>;
|
|
589
|
+
}, "strip", z.ZodTypeAny, {
|
|
590
|
+
type: "token";
|
|
591
|
+
content: string;
|
|
592
|
+
ts: number;
|
|
593
|
+
contentType?: "text" | "thinking" | "tool_input" | undefined;
|
|
594
|
+
}, {
|
|
595
|
+
type: "token";
|
|
596
|
+
content: string;
|
|
597
|
+
ts: number;
|
|
598
|
+
contentType?: "text" | "thinking" | "tool_input" | undefined;
|
|
599
|
+
}>, z.ZodObject<{
|
|
600
|
+
ts: z.ZodNumber;
|
|
601
|
+
} & {
|
|
602
|
+
type: z.ZodLiteral<"content_block_start">;
|
|
603
|
+
index: z.ZodNumber;
|
|
604
|
+
contentType: z.ZodEnum<["text", "tool_use", "thinking"]>;
|
|
605
|
+
toolName: z.ZodOptional<z.ZodString>;
|
|
606
|
+
toolId: z.ZodOptional<z.ZodString>;
|
|
607
|
+
}, "strip", z.ZodTypeAny, {
|
|
608
|
+
type: "content_block_start";
|
|
609
|
+
ts: number;
|
|
610
|
+
contentType: "text" | "tool_use" | "thinking";
|
|
611
|
+
index: number;
|
|
612
|
+
toolName?: string | undefined;
|
|
613
|
+
toolId?: string | undefined;
|
|
614
|
+
}, {
|
|
615
|
+
type: "content_block_start";
|
|
616
|
+
ts: number;
|
|
617
|
+
contentType: "text" | "tool_use" | "thinking";
|
|
618
|
+
index: number;
|
|
619
|
+
toolName?: string | undefined;
|
|
620
|
+
toolId?: string | undefined;
|
|
621
|
+
}>, z.ZodObject<{
|
|
622
|
+
ts: z.ZodNumber;
|
|
623
|
+
} & {
|
|
624
|
+
type: z.ZodLiteral<"content_block_stop">;
|
|
625
|
+
index: z.ZodNumber;
|
|
626
|
+
}, "strip", z.ZodTypeAny, {
|
|
627
|
+
type: "content_block_stop";
|
|
628
|
+
ts: number;
|
|
629
|
+
index: number;
|
|
630
|
+
}, {
|
|
631
|
+
type: "content_block_stop";
|
|
632
|
+
ts: number;
|
|
633
|
+
index: number;
|
|
634
|
+
}>, z.ZodObject<{
|
|
635
|
+
ts: z.ZodNumber;
|
|
636
|
+
} & {
|
|
637
|
+
type: z.ZodLiteral<"tool_call">;
|
|
638
|
+
toolName: z.ZodString;
|
|
639
|
+
callId: z.ZodString;
|
|
640
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
641
|
+
parentToolUseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
642
|
+
tool: z.ZodOptional<z.ZodUnknown>;
|
|
643
|
+
category: z.ZodOptional<z.ZodUnknown>;
|
|
644
|
+
}, "strip", z.ZodTypeAny, {
|
|
645
|
+
type: "tool_call";
|
|
646
|
+
args: Record<string, unknown>;
|
|
647
|
+
toolName: string;
|
|
648
|
+
ts: number;
|
|
649
|
+
callId: string;
|
|
650
|
+
parentToolUseId?: string | null | undefined;
|
|
651
|
+
tool?: unknown;
|
|
652
|
+
category?: unknown;
|
|
653
|
+
}, {
|
|
654
|
+
type: "tool_call";
|
|
655
|
+
args: Record<string, unknown>;
|
|
656
|
+
toolName: string;
|
|
657
|
+
ts: number;
|
|
658
|
+
callId: string;
|
|
659
|
+
parentToolUseId?: string | null | undefined;
|
|
660
|
+
tool?: unknown;
|
|
661
|
+
category?: unknown;
|
|
662
|
+
}>, z.ZodObject<{
|
|
663
|
+
ts: z.ZodNumber;
|
|
664
|
+
} & {
|
|
665
|
+
type: z.ZodLiteral<"tool_result">;
|
|
666
|
+
toolName: z.ZodString;
|
|
667
|
+
callId: z.ZodString;
|
|
668
|
+
result: z.ZodUnknown;
|
|
669
|
+
isError: z.ZodOptional<z.ZodBoolean>;
|
|
670
|
+
parentToolUseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
671
|
+
tool: z.ZodOptional<z.ZodUnknown>;
|
|
672
|
+
category: z.ZodOptional<z.ZodUnknown>;
|
|
673
|
+
}, "strip", z.ZodTypeAny, {
|
|
674
|
+
type: "tool_result";
|
|
675
|
+
toolName: string;
|
|
676
|
+
ts: number;
|
|
677
|
+
callId: string;
|
|
678
|
+
isError?: boolean | undefined;
|
|
679
|
+
result?: unknown;
|
|
680
|
+
parentToolUseId?: string | null | undefined;
|
|
681
|
+
tool?: unknown;
|
|
682
|
+
category?: unknown;
|
|
683
|
+
}, {
|
|
684
|
+
type: "tool_result";
|
|
685
|
+
toolName: string;
|
|
686
|
+
ts: number;
|
|
687
|
+
callId: string;
|
|
688
|
+
isError?: boolean | undefined;
|
|
689
|
+
result?: unknown;
|
|
690
|
+
parentToolUseId?: string | null | undefined;
|
|
691
|
+
tool?: unknown;
|
|
692
|
+
category?: unknown;
|
|
693
|
+
}>, z.ZodObject<{
|
|
694
|
+
ts: z.ZodNumber;
|
|
695
|
+
} & {
|
|
696
|
+
type: z.ZodLiteral<"message_start">;
|
|
697
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
698
|
+
model: z.ZodOptional<z.ZodString>;
|
|
699
|
+
}, "strip", z.ZodTypeAny, {
|
|
700
|
+
type: "message_start";
|
|
701
|
+
ts: number;
|
|
702
|
+
model?: string | undefined;
|
|
703
|
+
messageId?: string | undefined;
|
|
704
|
+
}, {
|
|
705
|
+
type: "message_start";
|
|
706
|
+
ts: number;
|
|
707
|
+
model?: string | undefined;
|
|
708
|
+
messageId?: string | undefined;
|
|
709
|
+
}>, z.ZodObject<{
|
|
710
|
+
ts: z.ZodNumber;
|
|
711
|
+
} & {
|
|
712
|
+
type: z.ZodLiteral<"message_delta">;
|
|
713
|
+
stopReason: z.ZodOptional<z.ZodString>;
|
|
714
|
+
stopSequence: z.ZodOptional<z.ZodString>;
|
|
715
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
716
|
+
outputTokens: z.ZodNumber;
|
|
717
|
+
}, "strip", z.ZodTypeAny, {
|
|
718
|
+
outputTokens: number;
|
|
719
|
+
}, {
|
|
720
|
+
outputTokens: number;
|
|
721
|
+
}>>;
|
|
722
|
+
}, "strip", z.ZodTypeAny, {
|
|
723
|
+
type: "message_delta";
|
|
724
|
+
ts: number;
|
|
725
|
+
stopReason?: string | undefined;
|
|
726
|
+
usage?: {
|
|
727
|
+
outputTokens: number;
|
|
728
|
+
} | undefined;
|
|
729
|
+
stopSequence?: string | undefined;
|
|
730
|
+
}, {
|
|
731
|
+
type: "message_delta";
|
|
732
|
+
ts: number;
|
|
733
|
+
stopReason?: string | undefined;
|
|
734
|
+
usage?: {
|
|
735
|
+
outputTokens: number;
|
|
736
|
+
} | undefined;
|
|
737
|
+
stopSequence?: string | undefined;
|
|
738
|
+
}>, z.ZodObject<{
|
|
739
|
+
ts: z.ZodNumber;
|
|
740
|
+
} & {
|
|
741
|
+
type: z.ZodLiteral<"message_stop">;
|
|
742
|
+
}, "strip", z.ZodTypeAny, {
|
|
743
|
+
type: "message_stop";
|
|
744
|
+
ts: number;
|
|
745
|
+
}, {
|
|
746
|
+
type: "message_stop";
|
|
747
|
+
ts: number;
|
|
748
|
+
}>, z.ZodObject<{
|
|
749
|
+
ts: z.ZodNumber;
|
|
750
|
+
} & {
|
|
751
|
+
type: z.ZodLiteral<"user_message">;
|
|
752
|
+
content: z.ZodString;
|
|
753
|
+
isSynthetic: z.ZodOptional<z.ZodBoolean>;
|
|
754
|
+
}, "strip", z.ZodTypeAny, {
|
|
755
|
+
type: "user_message";
|
|
756
|
+
content: string;
|
|
757
|
+
ts: number;
|
|
758
|
+
isSynthetic?: boolean | undefined;
|
|
759
|
+
}, {
|
|
760
|
+
type: "user_message";
|
|
761
|
+
content: string;
|
|
762
|
+
ts: number;
|
|
763
|
+
isSynthetic?: boolean | undefined;
|
|
764
|
+
}>, z.ZodObject<{
|
|
765
|
+
ts: z.ZodNumber;
|
|
766
|
+
} & {
|
|
767
|
+
type: z.ZodLiteral<"status">;
|
|
768
|
+
phase: z.ZodString;
|
|
769
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
770
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
771
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
772
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
773
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
774
|
+
model: z.ZodOptional<z.ZodString>;
|
|
775
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
776
|
+
ts: z.ZodNumber;
|
|
777
|
+
} & {
|
|
778
|
+
type: z.ZodLiteral<"status">;
|
|
779
|
+
phase: z.ZodString;
|
|
780
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
781
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
782
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
783
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
784
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
785
|
+
model: z.ZodOptional<z.ZodString>;
|
|
786
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
787
|
+
ts: z.ZodNumber;
|
|
788
|
+
} & {
|
|
789
|
+
type: z.ZodLiteral<"status">;
|
|
790
|
+
phase: z.ZodString;
|
|
791
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
792
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
793
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
794
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
795
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
796
|
+
model: z.ZodOptional<z.ZodString>;
|
|
797
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
798
|
+
ts: z.ZodNumber;
|
|
799
|
+
} & {
|
|
800
|
+
type: z.ZodLiteral<"init">;
|
|
801
|
+
model: z.ZodString;
|
|
802
|
+
tools: z.ZodArray<z.ZodString, "many">;
|
|
803
|
+
permissionMode: z.ZodString;
|
|
804
|
+
cwd: z.ZodString;
|
|
805
|
+
apiKeySource: z.ZodString;
|
|
806
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
807
|
+
slashCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
808
|
+
outputStyle: z.ZodOptional<z.ZodString>;
|
|
809
|
+
mcpServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
810
|
+
name: z.ZodString;
|
|
811
|
+
status: z.ZodString;
|
|
812
|
+
}, "strip", z.ZodTypeAny, {
|
|
813
|
+
status: string;
|
|
814
|
+
name: string;
|
|
815
|
+
}, {
|
|
816
|
+
status: string;
|
|
817
|
+
name: string;
|
|
818
|
+
}>, "many">>;
|
|
819
|
+
}, "strip", z.ZodTypeAny, {
|
|
820
|
+
type: "init";
|
|
821
|
+
tools: string[];
|
|
822
|
+
cwd: string;
|
|
823
|
+
model: string;
|
|
824
|
+
permissionMode: string;
|
|
825
|
+
apiKeySource: string;
|
|
826
|
+
ts: number;
|
|
827
|
+
mcpServers?: {
|
|
828
|
+
status: string;
|
|
829
|
+
name: string;
|
|
830
|
+
}[] | undefined;
|
|
831
|
+
agents?: string[] | undefined;
|
|
832
|
+
slashCommands?: string[] | undefined;
|
|
833
|
+
outputStyle?: string | undefined;
|
|
834
|
+
}, {
|
|
835
|
+
type: "init";
|
|
836
|
+
tools: string[];
|
|
837
|
+
cwd: string;
|
|
838
|
+
model: string;
|
|
839
|
+
permissionMode: string;
|
|
840
|
+
apiKeySource: string;
|
|
841
|
+
ts: number;
|
|
842
|
+
mcpServers?: {
|
|
843
|
+
status: string;
|
|
844
|
+
name: string;
|
|
845
|
+
}[] | undefined;
|
|
846
|
+
agents?: string[] | undefined;
|
|
847
|
+
slashCommands?: string[] | undefined;
|
|
848
|
+
outputStyle?: string | undefined;
|
|
849
|
+
}>, z.ZodObject<{
|
|
850
|
+
ts: z.ZodNumber;
|
|
851
|
+
} & {
|
|
852
|
+
type: z.ZodLiteral<"console">;
|
|
853
|
+
level: z.ZodEnum<["debug", "info", "warn", "error"]>;
|
|
854
|
+
message: z.ZodString;
|
|
855
|
+
}, "strip", z.ZodTypeAny, {
|
|
856
|
+
type: "console";
|
|
857
|
+
message: string;
|
|
858
|
+
ts: number;
|
|
859
|
+
level: "debug" | "info" | "warn" | "error";
|
|
860
|
+
}, {
|
|
861
|
+
type: "console";
|
|
862
|
+
message: string;
|
|
863
|
+
ts: number;
|
|
864
|
+
level: "debug" | "info" | "warn" | "error";
|
|
865
|
+
}>, z.ZodObject<{
|
|
866
|
+
ts: z.ZodNumber;
|
|
867
|
+
} & {
|
|
868
|
+
type: z.ZodLiteral<"compact_boundary">;
|
|
869
|
+
trigger: z.ZodEnum<["manual", "auto"]>;
|
|
870
|
+
preTokens: z.ZodNumber;
|
|
871
|
+
}, "strip", z.ZodTypeAny, {
|
|
872
|
+
type: "compact_boundary";
|
|
873
|
+
ts: number;
|
|
874
|
+
trigger: "manual" | "auto";
|
|
875
|
+
preTokens: number;
|
|
876
|
+
}, {
|
|
877
|
+
type: "compact_boundary";
|
|
878
|
+
ts: number;
|
|
879
|
+
trigger: "manual" | "auto";
|
|
880
|
+
preTokens: number;
|
|
881
|
+
}>, z.ZodObject<{
|
|
882
|
+
ts: z.ZodNumber;
|
|
883
|
+
} & {
|
|
884
|
+
type: z.ZodLiteral<"done">;
|
|
885
|
+
result: z.ZodOptional<z.ZodString>;
|
|
886
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
887
|
+
durationApiMs: z.ZodOptional<z.ZodNumber>;
|
|
888
|
+
numTurns: z.ZodOptional<z.ZodNumber>;
|
|
889
|
+
totalCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
890
|
+
usage: z.ZodOptional<z.ZodUnknown>;
|
|
891
|
+
modelUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
892
|
+
inputTokens: z.ZodNumber;
|
|
893
|
+
outputTokens: z.ZodNumber;
|
|
894
|
+
cacheReadInputTokens: z.ZodNumber;
|
|
895
|
+
cacheCreationInputTokens: z.ZodNumber;
|
|
896
|
+
webSearchRequests: z.ZodNumber;
|
|
897
|
+
costUSD: z.ZodNumber;
|
|
898
|
+
contextWindow: z.ZodNumber;
|
|
899
|
+
}, "strip", z.ZodTypeAny, {
|
|
900
|
+
outputTokens: number;
|
|
901
|
+
inputTokens: number;
|
|
902
|
+
cacheReadInputTokens: number;
|
|
903
|
+
cacheCreationInputTokens: number;
|
|
904
|
+
webSearchRequests: number;
|
|
905
|
+
costUSD: number;
|
|
906
|
+
contextWindow: number;
|
|
907
|
+
}, {
|
|
908
|
+
outputTokens: number;
|
|
909
|
+
inputTokens: number;
|
|
910
|
+
cacheReadInputTokens: number;
|
|
911
|
+
cacheCreationInputTokens: number;
|
|
912
|
+
webSearchRequests: number;
|
|
913
|
+
costUSD: number;
|
|
914
|
+
contextWindow: number;
|
|
915
|
+
}>>>;
|
|
916
|
+
permissionDenials: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
917
|
+
tool_name: z.ZodString;
|
|
918
|
+
tool_use_id: z.ZodString;
|
|
919
|
+
tool_input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
920
|
+
}, "strip", z.ZodTypeAny, {
|
|
921
|
+
tool_use_id: string;
|
|
922
|
+
tool_name: string;
|
|
923
|
+
tool_input: Record<string, unknown>;
|
|
924
|
+
}, {
|
|
925
|
+
tool_use_id: string;
|
|
926
|
+
tool_name: string;
|
|
927
|
+
tool_input: Record<string, unknown>;
|
|
928
|
+
}>, "many">>;
|
|
929
|
+
}, "strip", z.ZodTypeAny, {
|
|
930
|
+
type: "done";
|
|
931
|
+
ts: number;
|
|
932
|
+
result?: string | undefined;
|
|
933
|
+
usage?: unknown;
|
|
934
|
+
modelUsage?: Record<string, {
|
|
935
|
+
outputTokens: number;
|
|
936
|
+
inputTokens: number;
|
|
937
|
+
cacheReadInputTokens: number;
|
|
938
|
+
cacheCreationInputTokens: number;
|
|
939
|
+
webSearchRequests: number;
|
|
940
|
+
costUSD: number;
|
|
941
|
+
contextWindow: number;
|
|
942
|
+
}> | undefined;
|
|
943
|
+
durationMs?: number | undefined;
|
|
944
|
+
durationApiMs?: number | undefined;
|
|
945
|
+
numTurns?: number | undefined;
|
|
946
|
+
totalCostUsd?: number | undefined;
|
|
947
|
+
permissionDenials?: {
|
|
948
|
+
tool_use_id: string;
|
|
949
|
+
tool_name: string;
|
|
950
|
+
tool_input: Record<string, unknown>;
|
|
951
|
+
}[] | undefined;
|
|
952
|
+
}, {
|
|
953
|
+
type: "done";
|
|
954
|
+
ts: number;
|
|
955
|
+
result?: string | undefined;
|
|
956
|
+
usage?: unknown;
|
|
957
|
+
modelUsage?: Record<string, {
|
|
958
|
+
outputTokens: number;
|
|
959
|
+
inputTokens: number;
|
|
960
|
+
cacheReadInputTokens: number;
|
|
961
|
+
cacheCreationInputTokens: number;
|
|
962
|
+
webSearchRequests: number;
|
|
963
|
+
costUSD: number;
|
|
964
|
+
contextWindow: number;
|
|
965
|
+
}> | undefined;
|
|
966
|
+
durationMs?: number | undefined;
|
|
967
|
+
durationApiMs?: number | undefined;
|
|
968
|
+
numTurns?: number | undefined;
|
|
969
|
+
totalCostUsd?: number | undefined;
|
|
970
|
+
permissionDenials?: {
|
|
971
|
+
tool_use_id: string;
|
|
972
|
+
tool_name: string;
|
|
973
|
+
tool_input: Record<string, unknown>;
|
|
974
|
+
}[] | undefined;
|
|
975
|
+
}>, z.ZodObject<{
|
|
976
|
+
ts: z.ZodNumber;
|
|
977
|
+
} & {
|
|
978
|
+
type: z.ZodLiteral<"error">;
|
|
979
|
+
message: z.ZodString;
|
|
980
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
981
|
+
errorType: z.ZodOptional<z.ZodString>;
|
|
982
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
983
|
+
sdkError: z.ZodOptional<z.ZodUnknown>;
|
|
984
|
+
}, "strip", z.ZodTypeAny, {
|
|
985
|
+
type: "error";
|
|
986
|
+
message: string;
|
|
987
|
+
ts: number;
|
|
988
|
+
error?: unknown;
|
|
989
|
+
context?: Record<string, unknown> | undefined;
|
|
990
|
+
errorType?: string | undefined;
|
|
991
|
+
sdkError?: unknown;
|
|
992
|
+
}, {
|
|
993
|
+
type: "error";
|
|
994
|
+
message: string;
|
|
995
|
+
ts: number;
|
|
996
|
+
error?: unknown;
|
|
997
|
+
context?: Record<string, unknown> | undefined;
|
|
998
|
+
errorType?: string | undefined;
|
|
999
|
+
sdkError?: unknown;
|
|
1000
|
+
}>, z.ZodObject<{
|
|
1001
|
+
ts: z.ZodNumber;
|
|
1002
|
+
} & {
|
|
1003
|
+
type: z.ZodLiteral<"metric">;
|
|
1004
|
+
key: z.ZodString;
|
|
1005
|
+
value: z.ZodNumber;
|
|
1006
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1007
|
+
}, "strip", z.ZodTypeAny, {
|
|
1008
|
+
key: string;
|
|
1009
|
+
value: number;
|
|
1010
|
+
type: "metric";
|
|
1011
|
+
ts: number;
|
|
1012
|
+
unit?: string | undefined;
|
|
1013
|
+
}, {
|
|
1014
|
+
key: string;
|
|
1015
|
+
value: number;
|
|
1016
|
+
type: "metric";
|
|
1017
|
+
ts: number;
|
|
1018
|
+
unit?: string | undefined;
|
|
1019
|
+
}>, z.ZodObject<{
|
|
1020
|
+
ts: z.ZodNumber;
|
|
1021
|
+
} & {
|
|
1022
|
+
type: z.ZodLiteral<"artifact">;
|
|
1023
|
+
kind: z.ZodString;
|
|
1024
|
+
content: z.ZodUnknown;
|
|
1025
|
+
}, "strip", z.ZodTypeAny, {
|
|
1026
|
+
type: "artifact";
|
|
1027
|
+
kind: string;
|
|
1028
|
+
ts: number;
|
|
1029
|
+
content?: unknown;
|
|
1030
|
+
}, {
|
|
1031
|
+
type: "artifact";
|
|
1032
|
+
kind: string;
|
|
1033
|
+
ts: number;
|
|
1034
|
+
content?: unknown;
|
|
1035
|
+
}>, z.ZodObject<{
|
|
1036
|
+
ts: z.ZodNumber;
|
|
1037
|
+
} & {
|
|
1038
|
+
type: z.ZodLiteral<"raw_sdk_event">;
|
|
1039
|
+
sdkMessage: z.ZodUnknown;
|
|
1040
|
+
}, "strip", z.ZodTypeAny, {
|
|
1041
|
+
type: "raw_sdk_event";
|
|
1042
|
+
ts: number;
|
|
1043
|
+
sdkMessage?: unknown;
|
|
1044
|
+
}, {
|
|
1045
|
+
type: "raw_sdk_event";
|
|
1046
|
+
ts: number;
|
|
1047
|
+
sdkMessage?: unknown;
|
|
1048
|
+
}>]>;
|
|
1049
|
+
type TokenEvent = z.infer<typeof TokenEventSchema>;
|
|
1050
|
+
type StatusEvent = z.infer<typeof StatusEventSchema>;
|
|
1051
|
+
type ConsoleEvent = z.infer<typeof ConsoleEventSchema>;
|
|
1052
|
+
type ErrorEvent = z.infer<typeof ErrorEventSchema>;
|
|
1053
|
+
type AgentEvent = z.infer<typeof AgentEventSchema>;
|
|
1054
|
+
/**
|
|
1055
|
+
* Parse and validate an AgentEvent from unknown input.
|
|
1056
|
+
* Returns the parsed event if valid, or null if invalid.
|
|
1057
|
+
*/
|
|
1058
|
+
declare function parseAgentEvent(input: unknown): AgentEvent | null;
|
|
1059
|
+
/**
|
|
1060
|
+
* Parse and validate multiple AgentEvents from an array of unknown inputs.
|
|
1061
|
+
* Invalid entries are discarded.
|
|
1062
|
+
*/
|
|
1063
|
+
declare function parseAgentEvents(inputs: unknown[]): AgentEvent[];
|
|
1064
|
+
|
|
1065
|
+
interface TaskFile {
|
|
1066
|
+
name: string;
|
|
1067
|
+
content: string;
|
|
1068
|
+
type: "plan" | "context" | "reference" | "output" | "artifact";
|
|
1069
|
+
}
|
|
1070
|
+
interface LocalArtifact {
|
|
1071
|
+
name: string;
|
|
1072
|
+
content: string;
|
|
1073
|
+
type: TaskFile["type"];
|
|
1074
|
+
contentType: string;
|
|
1075
|
+
size: number;
|
|
1076
|
+
}
|
|
1077
|
+
declare class PostHogFileManager {
|
|
1078
|
+
private repositoryPath;
|
|
1079
|
+
private logger;
|
|
1080
|
+
constructor(repositoryPath: string, logger?: Logger);
|
|
1081
|
+
private getTaskDirectory;
|
|
1082
|
+
private getTaskFilePath;
|
|
1083
|
+
ensureTaskDirectory(taskId: string): Promise<void>;
|
|
1084
|
+
writeTaskFile(taskId: string, file: TaskFile): Promise<void>;
|
|
1085
|
+
readTaskFile(taskId: string, fileName: string): Promise<string | null>;
|
|
1086
|
+
listTaskFiles(taskId: string): Promise<string[]>;
|
|
1087
|
+
deleteTaskFile(taskId: string, fileName: string): Promise<void>;
|
|
1088
|
+
taskDirectoryExists(taskId: string): Promise<boolean>;
|
|
1089
|
+
cleanupTaskDirectory(taskId: string): Promise<void>;
|
|
1090
|
+
writePlan(taskId: string, plan: string): Promise<void>;
|
|
1091
|
+
readPlan(taskId: string): Promise<string | null>;
|
|
1092
|
+
writeContext(taskId: string, context: string): Promise<void>;
|
|
1093
|
+
readContext(taskId: string): Promise<string | null>;
|
|
1094
|
+
writeRequirements(taskId: string, requirements: string): Promise<void>;
|
|
1095
|
+
readRequirements(taskId: string): Promise<string | null>;
|
|
1096
|
+
writeResearch(taskId: string, data: ResearchEvaluation): Promise<void>;
|
|
1097
|
+
readResearch(taskId: string): Promise<ResearchEvaluation | null>;
|
|
1098
|
+
writeTodos(taskId: string, data: unknown): Promise<void>;
|
|
1099
|
+
readTodos(taskId: string): Promise<unknown | null>;
|
|
1100
|
+
getTaskFiles(taskId: string): Promise<SupportingFile[]>;
|
|
1101
|
+
collectTaskArtifacts(taskId: string): Promise<LocalArtifact[]>;
|
|
1102
|
+
private resolveFileType;
|
|
1103
|
+
private inferContentType;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
interface TodoItem {
|
|
1107
|
+
content: string;
|
|
1108
|
+
status: "pending" | "in_progress" | "completed";
|
|
1109
|
+
activeForm: string;
|
|
1110
|
+
}
|
|
1111
|
+
interface TodoList {
|
|
1112
|
+
items: TodoItem[];
|
|
1113
|
+
metadata: {
|
|
1114
|
+
total: number;
|
|
1115
|
+
pending: number;
|
|
1116
|
+
in_progress: number;
|
|
1117
|
+
completed: number;
|
|
1118
|
+
last_updated: string;
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
declare class TodoManager {
|
|
1122
|
+
private fileManager;
|
|
1123
|
+
private logger;
|
|
1124
|
+
constructor(fileManager: PostHogFileManager, logger?: Logger);
|
|
1125
|
+
readTodos(taskId: string): Promise<TodoList | null>;
|
|
1126
|
+
writeTodos(taskId: string, todos: TodoList): Promise<void>;
|
|
1127
|
+
parseTodoWriteInput(toolInput: Record<string, unknown>): TodoList;
|
|
1128
|
+
private calculateMetadata;
|
|
1129
|
+
getTodoContext(taskId: string): Promise<string>;
|
|
1130
|
+
checkAndPersistFromMessage(message: Record<string, unknown>, taskId: string): Promise<TodoList | null>;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Tool category classification for grouping related tools.
|
|
1135
|
+
* Makes it easier for UIs to filter and display tools by function.
|
|
1136
|
+
*/
|
|
1137
|
+
type ToolCategory = "filesystem" | "shell" | "web" | "assistant" | "search" | "unknown";
|
|
1138
|
+
/**
|
|
1139
|
+
* Base tool interface representing a tool that can be called by the agent.
|
|
1140
|
+
* Each tool has a name, category, and human-readable description.
|
|
1141
|
+
*/
|
|
1142
|
+
interface Tool {
|
|
1143
|
+
name: string;
|
|
1144
|
+
category: ToolCategory;
|
|
1145
|
+
description: string;
|
|
1146
|
+
}
|
|
1147
|
+
interface ReadTool extends Tool {
|
|
1148
|
+
name: "Read";
|
|
1149
|
+
category: "filesystem";
|
|
1150
|
+
}
|
|
1151
|
+
interface WriteTool extends Tool {
|
|
1152
|
+
name: "Write";
|
|
1153
|
+
category: "filesystem";
|
|
1154
|
+
}
|
|
1155
|
+
interface EditTool extends Tool {
|
|
1156
|
+
name: "Edit";
|
|
1157
|
+
category: "filesystem";
|
|
1158
|
+
}
|
|
1159
|
+
interface GlobTool extends Tool {
|
|
1160
|
+
name: "Glob";
|
|
1161
|
+
category: "filesystem";
|
|
1162
|
+
}
|
|
1163
|
+
interface NotebookEditTool extends Tool {
|
|
1164
|
+
name: "NotebookEdit";
|
|
1165
|
+
category: "filesystem";
|
|
1166
|
+
}
|
|
1167
|
+
interface BashTool extends Tool {
|
|
1168
|
+
name: "Bash";
|
|
1169
|
+
category: "shell";
|
|
1170
|
+
}
|
|
1171
|
+
interface BashOutputTool extends Tool {
|
|
1172
|
+
name: "BashOutput";
|
|
1173
|
+
category: "shell";
|
|
1174
|
+
}
|
|
1175
|
+
interface KillShellTool extends Tool {
|
|
1176
|
+
name: "KillShell";
|
|
1177
|
+
category: "shell";
|
|
1178
|
+
}
|
|
1179
|
+
interface WebFetchTool extends Tool {
|
|
1180
|
+
name: "WebFetch";
|
|
1181
|
+
category: "web";
|
|
1182
|
+
}
|
|
1183
|
+
interface WebSearchTool extends Tool {
|
|
1184
|
+
name: "WebSearch";
|
|
1185
|
+
category: "web";
|
|
1186
|
+
}
|
|
1187
|
+
interface GrepTool extends Tool {
|
|
1188
|
+
name: "Grep";
|
|
1189
|
+
category: "search";
|
|
1190
|
+
}
|
|
1191
|
+
interface TaskTool extends Tool {
|
|
1192
|
+
name: "Task";
|
|
1193
|
+
category: "assistant";
|
|
1194
|
+
}
|
|
1195
|
+
interface TodoWriteTool extends Tool {
|
|
1196
|
+
name: "TodoWrite";
|
|
1197
|
+
category: "assistant";
|
|
1198
|
+
}
|
|
1199
|
+
interface ExitPlanModeTool extends Tool {
|
|
1200
|
+
name: "ExitPlanMode";
|
|
1201
|
+
category: "assistant";
|
|
1202
|
+
}
|
|
1203
|
+
interface SlashCommandTool extends Tool {
|
|
1204
|
+
name: "SlashCommand";
|
|
1205
|
+
category: "assistant";
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* Union type of all known tool types.
|
|
1209
|
+
* Useful for discriminated unions and type narrowing.
|
|
1210
|
+
*/
|
|
1211
|
+
type KnownTool = ReadTool | WriteTool | EditTool | GlobTool | NotebookEditTool | BashTool | BashOutputTool | KillShellTool | WebFetchTool | WebSearchTool | GrepTool | TaskTool | TodoWriteTool | ExitPlanModeTool | SlashCommandTool;
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Tool registry for looking up tool definitions by name.
|
|
1215
|
+
* Provides metadata about tools for UI consumption.
|
|
1216
|
+
*/
|
|
1217
|
+
declare class ToolRegistry {
|
|
1218
|
+
/**
|
|
1219
|
+
* Get tool definition by name.
|
|
1220
|
+
* Returns undefined if tool is not recognized.
|
|
1221
|
+
*/
|
|
1222
|
+
get(name: string): Tool | undefined;
|
|
1223
|
+
/**
|
|
1224
|
+
* Get all registered tools.
|
|
1225
|
+
*/
|
|
1226
|
+
getAll(): Tool[];
|
|
1227
|
+
/**
|
|
1228
|
+
* Check if a tool name is registered.
|
|
1229
|
+
*/
|
|
1230
|
+
has(name: string): boolean;
|
|
1231
|
+
/**
|
|
1232
|
+
* Get all tools in a specific category.
|
|
1233
|
+
*/
|
|
1234
|
+
getByCategory(category: string): Tool[];
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
interface WorktreeConfig {
|
|
1238
|
+
mainRepoPath: string;
|
|
1239
|
+
worktreeBasePath?: string;
|
|
1240
|
+
logger?: Logger;
|
|
1241
|
+
}
|
|
1242
|
+
declare class WorktreeManager {
|
|
1243
|
+
private mainRepoPath;
|
|
1244
|
+
private worktreeBasePath;
|
|
1245
|
+
private repoName;
|
|
1246
|
+
private logger;
|
|
1247
|
+
constructor(config: WorktreeConfig);
|
|
1248
|
+
private usesExternalPath;
|
|
1249
|
+
private runGitCommand;
|
|
1250
|
+
private randomElement;
|
|
1251
|
+
generateWorktreeName(): string;
|
|
1252
|
+
private getWorktreeFolderPath;
|
|
1253
|
+
private getWorktreePath;
|
|
1254
|
+
worktreeExists(name: string): Promise<boolean>;
|
|
1255
|
+
ensureArrayDirIgnored(): Promise<void>;
|
|
1256
|
+
private generateUniqueWorktreeName;
|
|
1257
|
+
private getDefaultBranch;
|
|
1258
|
+
createWorktree(): Promise<WorktreeInfo>;
|
|
1259
|
+
deleteWorktree(worktreePath: string): Promise<void>;
|
|
1260
|
+
getWorktreeInfo(worktreePath: string): Promise<WorktreeInfo | null>;
|
|
1261
|
+
listWorktrees(): Promise<WorktreeInfo[]>;
|
|
1262
|
+
private parseWorktreeList;
|
|
1263
|
+
isWorktree(repoPath: string): Promise<boolean>;
|
|
1264
|
+
getMainRepoPathFromWorktree(worktreePath: string): Promise<string | null>;
|
|
1265
|
+
cleanupOrphanedWorktrees(associatedWorktreePaths: string[]): Promise<{
|
|
1266
|
+
deleted: string[];
|
|
1267
|
+
errors: Array<{
|
|
1268
|
+
path: string;
|
|
1269
|
+
error: string;
|
|
1270
|
+
}>;
|
|
1271
|
+
}>;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
export { type AcpConnectionConfig, Agent, type AgentConfig, type AgentEvent, type ArtifactNotificationPayload, type BashOutputTool, type BashTool, type BranchCreatedPayload, type ConsoleEvent, type ConsoleNotificationPayload, type EditTool, type ErrorEvent, type ErrorNotificationPayload, type ExecutionResult, type ExitPlanModeTool, type GlobTool, type GrepTool, type InProcessAcpConnection, type KillShellTool, type KnownTool, LogLevel, type LogLevel$1 as LogLevelType, Logger, type LoggerConfig, type McpServerConfig, type NotebookEditTool, type OnLogCallback, POSTHOG_NOTIFICATIONS, PermissionMode, type PhaseNotificationPayload, type PostHogNotificationPayload, type PostHogNotificationType, type PrCreatedPayload, type ReadTool, type ResearchEvaluation, type RunStartedPayload, type SdkSessionPayload, type SessionPersistenceConfig, SessionStore, type SlashCommandTool, type StatusEvent, type StoredEntry, type StoredNotification, type SupportingFile, type Task, type TaskCompletePayload, type TaskRun, type TaskTool, type TodoItem, type TodoList, TodoManager, type TodoWriteTool, type TokenEvent, type Tool, type ToolCategory, ToolRegistry, type WebFetchTool, type WebSearchTool, type WorktreeConfig, type WorktreeInfo, WorktreeManager, type WriteTool, createAcpConnection, parseAgentEvent, parseAgentEvents };
|