@helmiq/crew 0.1.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/defaults/personas/architect.persona.yaml +72 -0
- package/defaults/personas/engineer.persona.yaml +137 -0
- package/defaults/personas/persona-spec.schema.yaml +149 -0
- package/defaults/personas/reviewer.persona.yaml +47 -0
- package/defaults/rubrics/adr.rubric.yaml +48 -0
- package/defaults/rubrics/code-review.rubric.yaml +39 -0
- package/defaults/rubrics/pull-request.rubric.yaml +40 -0
- package/dist/actions/actions.test.d.ts +2 -0
- package/dist/actions/actions.test.d.ts.map +1 -0
- package/dist/actions/actions.test.js +158 -0
- package/dist/actions/direct-dispatcher.d.ts +10 -0
- package/dist/actions/direct-dispatcher.d.ts.map +1 -0
- package/dist/actions/direct-dispatcher.js +27 -0
- package/dist/actions/dispatcher.d.ts +11 -0
- package/dist/actions/dispatcher.d.ts.map +1 -0
- package/dist/actions/dispatcher.js +1 -0
- package/dist/actions/index.d.ts +7 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +3 -0
- package/dist/actions/registry.d.ts +13 -0
- package/dist/actions/registry.d.ts.map +1 -0
- package/dist/actions/registry.js +40 -0
- package/dist/actions/resolver.d.ts +47 -0
- package/dist/actions/resolver.d.ts.map +1 -0
- package/dist/actions/resolver.js +43 -0
- package/dist/cli/cli.test.d.ts +2 -0
- package/dist/cli/cli.test.d.ts.map +1 -0
- package/dist/cli/cli.test.js +392 -0
- package/dist/cli/run.d.ts +45 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +236 -0
- package/dist/common/errors.d.ts +76 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +74 -0
- package/dist/config/config.test.d.ts +2 -0
- package/dist/config/config.test.d.ts.map +1 -0
- package/dist/config/config.test.js +691 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/config/loader.d.ts +16 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +56 -0
- package/dist/config/model-resolver.d.ts +24 -0
- package/dist/config/model-resolver.d.ts.map +1 -0
- package/dist/config/model-resolver.js +39 -0
- package/dist/config/resolver.d.ts +22 -0
- package/dist/config/resolver.d.ts.map +1 -0
- package/dist/config/resolver.js +115 -0
- package/dist/config/schemas.d.ts +266 -0
- package/dist/config/schemas.d.ts.map +1 -0
- package/dist/config/schemas.js +115 -0
- package/dist/context/artifact-reader.d.ts +12 -0
- package/dist/context/artifact-reader.d.ts.map +1 -0
- package/dist/context/artifact-reader.js +92 -0
- package/dist/context/assembler.d.ts +22 -0
- package/dist/context/assembler.d.ts.map +1 -0
- package/dist/context/assembler.js +126 -0
- package/dist/context/code-reader.d.ts +14 -0
- package/dist/context/code-reader.d.ts.map +1 -0
- package/dist/context/code-reader.js +56 -0
- package/dist/context/context.test.d.ts +2 -0
- package/dist/context/context.test.d.ts.map +1 -0
- package/dist/context/context.test.js +260 -0
- package/dist/context/index.d.ts +9 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +5 -0
- package/dist/context/section-extractor.d.ts +9 -0
- package/dist/context/section-extractor.d.ts.map +1 -0
- package/dist/context/section-extractor.js +32 -0
- package/dist/context/token-budget.d.ts +11 -0
- package/dist/context/token-budget.d.ts.map +1 -0
- package/dist/context/token-budget.js +22 -0
- package/dist/control/control.test.d.ts +2 -0
- package/dist/control/control.test.d.ts.map +1 -0
- package/dist/control/control.test.js +137 -0
- package/dist/control/id-generator.d.ts +12 -0
- package/dist/control/id-generator.d.ts.map +1 -0
- package/dist/control/id-generator.js +20 -0
- package/dist/control/index.d.ts +5 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +3 -0
- package/dist/control/lock-manager.d.ts +13 -0
- package/dist/control/lock-manager.d.ts.map +1 -0
- package/dist/control/lock-manager.js +72 -0
- package/dist/control/run-state.d.ts +16 -0
- package/dist/control/run-state.d.ts.map +1 -0
- package/dist/control/run-state.js +55 -0
- package/dist/engine/composite.d.ts +34 -0
- package/dist/engine/composite.d.ts.map +1 -0
- package/dist/engine/composite.js +192 -0
- package/dist/engine/composite.test.d.ts +2 -0
- package/dist/engine/composite.test.d.ts.map +1 -0
- package/dist/engine/composite.test.js +1947 -0
- package/dist/engine/engine.test.d.ts +2 -0
- package/dist/engine/engine.test.d.ts.map +1 -0
- package/dist/engine/engine.test.js +334 -0
- package/dist/engine/index.d.ts +10 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +5 -0
- package/dist/engine/llm-client.d.ts +27 -0
- package/dist/engine/llm-client.d.ts.map +1 -0
- package/dist/engine/llm-client.js +46 -0
- package/dist/engine/simple.d.ts +21 -0
- package/dist/engine/simple.d.ts.map +1 -0
- package/dist/engine/simple.js +59 -0
- package/dist/engine/tool-dispatch.d.ts +37 -0
- package/dist/engine/tool-dispatch.d.ts.map +1 -0
- package/dist/engine/tool-dispatch.js +146 -0
- package/dist/engine/tool-dispatch.test.d.ts +2 -0
- package/dist/engine/tool-dispatch.test.d.ts.map +1 -0
- package/dist/engine/tool-dispatch.test.js +348 -0
- package/dist/engine/tool-filter.d.ts +13 -0
- package/dist/engine/tool-filter.d.ts.map +1 -0
- package/dist/engine/tool-filter.js +25 -0
- package/dist/evaluation/evaluation.test.d.ts +2 -0
- package/dist/evaluation/evaluation.test.d.ts.map +1 -0
- package/dist/evaluation/evaluation.test.js +490 -0
- package/dist/evaluation/evaluator.d.ts +19 -0
- package/dist/evaluation/evaluator.d.ts.map +1 -0
- package/dist/evaluation/evaluator.js +78 -0
- package/dist/evaluation/index.d.ts +4 -0
- package/dist/evaluation/index.d.ts.map +1 -0
- package/dist/evaluation/index.js +2 -0
- package/dist/evaluation/scorer.d.ts +38 -0
- package/dist/evaluation/scorer.d.ts.map +1 -0
- package/dist/evaluation/scorer.js +94 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +1 -0
- package/dist/providers/provider-factory.d.ts +11 -0
- package/dist/providers/provider-factory.d.ts.map +1 -0
- package/dist/providers/provider-factory.js +30 -0
- package/dist/publication/frontmatter.d.ts +21 -0
- package/dist/publication/frontmatter.d.ts.map +1 -0
- package/dist/publication/frontmatter.js +15 -0
- package/dist/publication/git-ops.d.ts +18 -0
- package/dist/publication/git-ops.d.ts.map +1 -0
- package/dist/publication/git-ops.js +74 -0
- package/dist/publication/index.d.ts +9 -0
- package/dist/publication/index.d.ts.map +1 -0
- package/dist/publication/index.js +5 -0
- package/dist/publication/provenance-writer.d.ts +27 -0
- package/dist/publication/provenance-writer.d.ts.map +1 -0
- package/dist/publication/provenance-writer.js +21 -0
- package/dist/publication/publication.test.d.ts +2 -0
- package/dist/publication/publication.test.d.ts.map +1 -0
- package/dist/publication/publication.test.js +235 -0
- package/dist/publication/publisher.d.ts +32 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/publisher.js +113 -0
- package/dist/publication/secret-scanner.d.ts +6 -0
- package/dist/publication/secret-scanner.d.ts.map +1 -0
- package/dist/publication/secret-scanner.js +19 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/registry.d.ts +15 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +288 -0
- package/dist/tools/registry.test.d.ts +2 -0
- package/dist/tools/registry.test.d.ts.map +1 -0
- package/dist/tools/registry.test.js +131 -0
- package/dist/tools/tool-groups.d.ts +20 -0
- package/dist/tools/tool-groups.d.ts.map +1 -0
- package/dist/tools/tool-groups.js +48 -0
- package/dist/tools/tool-groups.test.d.ts +2 -0
- package/dist/tools/tool-groups.test.d.ts.map +1 -0
- package/dist/tools/tool-groups.test.js +127 -0
- package/dist/types/artifact-store.d.ts +33 -0
- package/dist/types/artifact-store.d.ts.map +1 -0
- package/dist/types/artifact-store.js +9 -0
- package/dist/types/evaluation-rubric.d.ts +18 -0
- package/dist/types/evaluation-rubric.d.ts.map +1 -0
- package/dist/types/evaluation-rubric.js +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/llm-provider.d.ts +47 -0
- package/dist/types/llm-provider.d.ts.map +1 -0
- package/dist/types/llm-provider.js +8 -0
- package/dist/types/persona-spec.d.ts +79 -0
- package/dist/types/persona-spec.d.ts.map +1 -0
- package/dist/types/persona-spec.js +1 -0
- package/dist/types/project-config.d.ts +28 -0
- package/dist/types/project-config.d.ts.map +1 -0
- package/dist/types/project-config.js +1 -0
- package/dist/types/provenance.d.ts +67 -0
- package/dist/types/provenance.d.ts.map +1 -0
- package/dist/types/provenance.js +1 -0
- package/dist/types/run-state.d.ts +11 -0
- package/dist/types/run-state.d.ts.map +1 -0
- package/dist/types/run-state.js +1 -0
- package/dist/types/tool-runtime.d.ts +43 -0
- package/dist/types/tool-runtime.d.ts.map +1 -0
- package/dist/types/tool-runtime.js +30 -0
- package/dist/workspace/detect.d.ts +11 -0
- package/dist/workspace/detect.d.ts.map +1 -0
- package/dist/workspace/detect.js +28 -0
- package/dist/workspace/detect.test.d.ts +2 -0
- package/dist/workspace/detect.test.d.ts.map +1 -0
- package/dist/workspace/detect.test.js +53 -0
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract artifact store interface.
|
|
3
|
+
*
|
|
4
|
+
* Provides CRUD operations for delivery artifacts (requirements, designs,
|
|
5
|
+
* reviews, etc.) backed by an adapter. The filesystem adapter is the
|
|
6
|
+
* Phase 1 implementation; future adapters (Linear, Jira, GitHub) implement
|
|
7
|
+
* the same contract. See ADR-0011.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface EvaluationRubric {
|
|
2
|
+
rubric: {
|
|
3
|
+
artifact_type: string;
|
|
4
|
+
scoring_scale?: number;
|
|
5
|
+
pass_threshold: number;
|
|
6
|
+
aggregate_threshold?: number;
|
|
7
|
+
divergence_threshold?: number;
|
|
8
|
+
models?: string[];
|
|
9
|
+
criteria: Criterion[];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface Criterion {
|
|
13
|
+
name: string;
|
|
14
|
+
weight: CriterionWeight;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
export type CriterionWeight = 'blocking' | 'important' | 'advisory';
|
|
18
|
+
//# sourceMappingURL=evaluation-rubric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluation-rubric.d.ts","sourceRoot":"","sources":["../../src/types/evaluation-rubric.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE;QACN,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,QAAQ,EAAE,SAAS,EAAE,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { PersonaSpec, Identity, Perception, ContextRef, Task, SimpleTask, CompositeTask, SubAgent, ToolPermissions, Cadence, ScheduleEntry, EventEntry, EvaluationConfig, TriggerType, QualityGateType, } from './persona-spec.js';
|
|
2
|
+
export type { ProjectConfig, SourceConfig, WorkspaceConfig, LlmConfig, Provider, } from './project-config.js';
|
|
3
|
+
export type { EvaluationRubric, Criterion, CriterionWeight } from './evaluation-rubric.js';
|
|
4
|
+
export type { RunStatus, RunRecord } from './run-state.js';
|
|
5
|
+
export type { Provenance, ProvenanceVersions, ProvenanceInputs, ProvenanceOutputs, ProvenanceEvaluation, ProvenanceCost, ArtifactReference, } from './provenance.js';
|
|
6
|
+
export type { LlmProvider, GenerateTextOptions, GenerateTextResult, LlmMessage, ToolCallRecord, ToolDefinition, ToolSet, } from './llm-provider.js';
|
|
7
|
+
export type { ArtifactStore, ArtifactRecord, ArtifactVersion, ArtifactListFilter, ArtifactWriteResult, } from './artifact-store.js';
|
|
8
|
+
export type { CrewTool, CrewToolSet, ToolExecutionContext, ToolExecutionRecord, ToolLogger, } from './tool-runtime.js';
|
|
9
|
+
export { createNullToolContext } from './tool-runtime.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,IAAI,EACJ,UAAU,EACV,aAAa,EACb,QAAQ,EACR,eAAe,EACf,OAAO,EACP,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,YAAY,EACZ,eAAe,EACf,SAAS,EACT,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE3F,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3D,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,cAAc,EACd,OAAO,GACR,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createNullToolContext } from './tool-runtime.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crew-defined LLM provider interface.
|
|
3
|
+
*
|
|
4
|
+
* Provider packages (e.g., @helmiq/anthropic-sdk) implement this interface.
|
|
5
|
+
* The runtime depends only on these types, never on SDK-specific types.
|
|
6
|
+
* See ADR-0009.
|
|
7
|
+
*/
|
|
8
|
+
export interface LlmProvider {
|
|
9
|
+
generateText(options: GenerateTextOptions): Promise<GenerateTextResult>;
|
|
10
|
+
}
|
|
11
|
+
export interface GenerateTextOptions {
|
|
12
|
+
model: string;
|
|
13
|
+
system: string;
|
|
14
|
+
messages: LlmMessage[];
|
|
15
|
+
tools?: ToolSet;
|
|
16
|
+
maxRetries?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GenerateTextResult {
|
|
19
|
+
text: string;
|
|
20
|
+
toolCalls: ToolCallRecord[];
|
|
21
|
+
tokensIn: number;
|
|
22
|
+
tokensOut: number;
|
|
23
|
+
}
|
|
24
|
+
export type LlmMessage = {
|
|
25
|
+
role: 'user' | 'assistant' | 'system';
|
|
26
|
+
content: string;
|
|
27
|
+
} | {
|
|
28
|
+
role: 'tool';
|
|
29
|
+
toolCallId: string;
|
|
30
|
+
toolName: string;
|
|
31
|
+
content: string;
|
|
32
|
+
};
|
|
33
|
+
export interface ToolCallRecord {
|
|
34
|
+
toolCallId: string;
|
|
35
|
+
toolName: string;
|
|
36
|
+
input: unknown;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A tool definition that the LLM can invoke.
|
|
40
|
+
* Vendor packages convert this to the SDK-specific tool format internally.
|
|
41
|
+
*/
|
|
42
|
+
export interface ToolDefinition {
|
|
43
|
+
description: string;
|
|
44
|
+
parameters: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
export type ToolSet = Record<string, ToolDefinition>;
|
|
47
|
+
//# sourceMappingURL=llm-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-provider.d.ts","sourceRoot":"","sources":["../../src/types/llm-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface PersonaSpec {
|
|
2
|
+
persona: {
|
|
3
|
+
name: string;
|
|
4
|
+
identity: Identity;
|
|
5
|
+
skills: string[];
|
|
6
|
+
perception: Perception;
|
|
7
|
+
tasks: Record<string, Task>;
|
|
8
|
+
tools: ToolPermissions;
|
|
9
|
+
cadence: Cadence;
|
|
10
|
+
evaluation: EvaluationConfig;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface Identity {
|
|
14
|
+
role: string;
|
|
15
|
+
}
|
|
16
|
+
export interface Perception {
|
|
17
|
+
always_read?: ContextRef[];
|
|
18
|
+
per_task: Record<string, ContextRef[]>;
|
|
19
|
+
}
|
|
20
|
+
export interface ContextRef {
|
|
21
|
+
artifact: string;
|
|
22
|
+
scope?: Record<string, string>;
|
|
23
|
+
sections?: string[];
|
|
24
|
+
when?: string;
|
|
25
|
+
}
|
|
26
|
+
export type Task = SimpleTask | CompositeTask;
|
|
27
|
+
export interface SimpleTask {
|
|
28
|
+
mode: 'simple';
|
|
29
|
+
trigger: TriggerType[];
|
|
30
|
+
skill: string;
|
|
31
|
+
reads?: string[];
|
|
32
|
+
produces: string;
|
|
33
|
+
tools?: string[];
|
|
34
|
+
published_artifact?: string;
|
|
35
|
+
quality_gate?: QualityGateType;
|
|
36
|
+
}
|
|
37
|
+
export interface CompositeTask {
|
|
38
|
+
mode: 'composite';
|
|
39
|
+
trigger: TriggerType[];
|
|
40
|
+
sub_agents: SubAgent[];
|
|
41
|
+
published_artifact: string;
|
|
42
|
+
quality_gate?: QualityGateType;
|
|
43
|
+
}
|
|
44
|
+
export interface SubAgent {
|
|
45
|
+
name: string;
|
|
46
|
+
skill: string;
|
|
47
|
+
reads: string[];
|
|
48
|
+
produces: string;
|
|
49
|
+
tools?: string[];
|
|
50
|
+
max_iterations?: number;
|
|
51
|
+
gate?: string;
|
|
52
|
+
on_fail?: string;
|
|
53
|
+
max_loops?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ToolPermissions {
|
|
56
|
+
permitted: string[];
|
|
57
|
+
denied: string[];
|
|
58
|
+
writable_paths?: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface Cadence {
|
|
61
|
+
scheduled?: ScheduleEntry[];
|
|
62
|
+
event?: EventEntry[];
|
|
63
|
+
}
|
|
64
|
+
export interface ScheduleEntry {
|
|
65
|
+
cron: string;
|
|
66
|
+
task: string;
|
|
67
|
+
}
|
|
68
|
+
export interface EventEntry {
|
|
69
|
+
on: string;
|
|
70
|
+
task: string;
|
|
71
|
+
}
|
|
72
|
+
export interface EvaluationConfig {
|
|
73
|
+
self_eval_model?: string;
|
|
74
|
+
rubric: string;
|
|
75
|
+
multi_model?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export type TriggerType = 'manual' | 'scheduled' | 'event';
|
|
78
|
+
export type QualityGateType = 'self-eval' | 'human-review' | 'multi-model';
|
|
79
|
+
//# sourceMappingURL=persona-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-spec.d.ts","sourceRoot":"","sources":["../../src/types/persona-spec.ts"],"names":[],"mappings":"AAAA,MAAM,WA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
3
|
+
name: string;
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
workspace: WorkspaceConfig;
|
|
7
|
+
source: SourceConfig;
|
|
8
|
+
llm: LlmConfig;
|
|
9
|
+
}
|
|
10
|
+
export interface SourceConfig {
|
|
11
|
+
repo: string;
|
|
12
|
+
path: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkspaceConfig {
|
|
15
|
+
path: string;
|
|
16
|
+
work: string;
|
|
17
|
+
runs: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LlmConfig {
|
|
20
|
+
default_model: string;
|
|
21
|
+
allowed_models?: string[];
|
|
22
|
+
providers: Record<string, Provider>;
|
|
23
|
+
}
|
|
24
|
+
export interface Provider {
|
|
25
|
+
api_key_env: string;
|
|
26
|
+
models: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=project-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../src/types/project-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { TriggerType } from './persona-spec.js';
|
|
2
|
+
import type { RunStatus } from './run-state.js';
|
|
3
|
+
export interface Provenance {
|
|
4
|
+
run_id: string;
|
|
5
|
+
parent_run_id?: string;
|
|
6
|
+
persona: string;
|
|
7
|
+
task: string;
|
|
8
|
+
sub_agent_chain?: string[];
|
|
9
|
+
feedback_iteration?: number;
|
|
10
|
+
versions: ProvenanceVersions;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
duration_ms: number;
|
|
13
|
+
trigger: TriggerType;
|
|
14
|
+
inputs: ProvenanceInputs;
|
|
15
|
+
outputs: ProvenanceOutputs;
|
|
16
|
+
evaluation: ProvenanceEvaluation;
|
|
17
|
+
cost: ProvenanceCost;
|
|
18
|
+
run_state: RunStatus;
|
|
19
|
+
}
|
|
20
|
+
export interface ProvenanceVersions {
|
|
21
|
+
persona_spec_hash: string;
|
|
22
|
+
prompt_hashes: Record<string, string>;
|
|
23
|
+
model: string;
|
|
24
|
+
rubric_hash: string;
|
|
25
|
+
runtime_version: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ProvenanceInputs {
|
|
28
|
+
artifacts_read: ArtifactReference[];
|
|
29
|
+
context_tokens: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ArtifactReference {
|
|
32
|
+
type: string;
|
|
33
|
+
path: string;
|
|
34
|
+
commit?: string;
|
|
35
|
+
status?: string;
|
|
36
|
+
sections?: string[];
|
|
37
|
+
repo?: string;
|
|
38
|
+
files?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ProvenanceOutputs {
|
|
41
|
+
artifact_produced: {
|
|
42
|
+
type: string;
|
|
43
|
+
id: string;
|
|
44
|
+
};
|
|
45
|
+
target_repo_branch?: string;
|
|
46
|
+
target_repo_commit?: string;
|
|
47
|
+
files_changed?: number;
|
|
48
|
+
tests_added?: number;
|
|
49
|
+
work_products?: string[];
|
|
50
|
+
}
|
|
51
|
+
export interface ProvenanceEvaluation {
|
|
52
|
+
self_eval_score?: number;
|
|
53
|
+
self_eval_pass?: boolean;
|
|
54
|
+
self_eval_model?: string;
|
|
55
|
+
automated_checks?: Record<string, string>;
|
|
56
|
+
multi_model_eval?: unknown;
|
|
57
|
+
human_review?: string;
|
|
58
|
+
human_reviewer?: string;
|
|
59
|
+
human_decision?: string;
|
|
60
|
+
human_decision_timestamp?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ProvenanceCost {
|
|
63
|
+
llm_calls: number;
|
|
64
|
+
total_tokens: number;
|
|
65
|
+
estimated_cost_usd: number;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../src/types/provenance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE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;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type RunStatus = 'queued' | 'running' | 'evaluating' | 'publishing' | 'published' | 'failed' | 'awaiting_review' | 'approved' | 'rejected';
|
|
2
|
+
export interface RunRecord {
|
|
3
|
+
run_id: string;
|
|
4
|
+
persona: string;
|
|
5
|
+
task: string;
|
|
6
|
+
scope: string;
|
|
7
|
+
status: RunStatus;
|
|
8
|
+
started_at: string;
|
|
9
|
+
completed_at?: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=run-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-state.d.ts","sourceRoot":"","sources":["../../src/types/run-state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,iBAAiB,GACjB,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-facing tool contracts per ADR-0010.
|
|
3
|
+
*
|
|
4
|
+
* CrewTool combines a JSON schema (for the LLM) with an execute function
|
|
5
|
+
* (for the runtime). The runtime strips execute to produce schema-only
|
|
6
|
+
* ToolSet for the provider, then dispatches tool calls back to execute.
|
|
7
|
+
*/
|
|
8
|
+
import type { ProjectConfig } from './project-config.js';
|
|
9
|
+
export type ToolLogger = (message: string, data?: Record<string, unknown>) => void;
|
|
10
|
+
export interface ToolExecutionContext {
|
|
11
|
+
workspacePath: string;
|
|
12
|
+
targetRepoPath: string;
|
|
13
|
+
project: ProjectConfig;
|
|
14
|
+
persona: string;
|
|
15
|
+
task: string;
|
|
16
|
+
runId: string;
|
|
17
|
+
protectedPaths: string[];
|
|
18
|
+
logger: ToolLogger;
|
|
19
|
+
}
|
|
20
|
+
export interface CrewTool<TParams = unknown, TResult = unknown> {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
parameters: Record<string, unknown>;
|
|
24
|
+
execute: (params: TParams, context: ToolExecutionContext) => Promise<TResult>;
|
|
25
|
+
}
|
|
26
|
+
export type CrewToolSet = Record<string, CrewTool>;
|
|
27
|
+
/**
|
|
28
|
+
* Build a stub ToolExecutionContext for cases where no real context is
|
|
29
|
+
* available (e.g. tests with mocked tools). Paths are empty so any
|
|
30
|
+
* real tool call would fail -- callers should prefer providing a real
|
|
31
|
+
* context via the toolContext parameter.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createNullToolContext(persona: string, task: string): ToolExecutionContext;
|
|
34
|
+
export interface ToolExecutionRecord {
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
toolName: string;
|
|
37
|
+
inputSummary: string;
|
|
38
|
+
outputSummary: string;
|
|
39
|
+
durationMs: number;
|
|
40
|
+
success: boolean;
|
|
41
|
+
errorCode?: string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=tool-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-facing tool contracts per ADR-0010.
|
|
3
|
+
*
|
|
4
|
+
* CrewTool combines a JSON schema (for the LLM) with an execute function
|
|
5
|
+
* (for the runtime). The runtime strips execute to produce schema-only
|
|
6
|
+
* ToolSet for the provider, then dispatches tool calls back to execute.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Build a stub ToolExecutionContext for cases where no real context is
|
|
10
|
+
* available (e.g. tests with mocked tools). Paths are empty so any
|
|
11
|
+
* real tool call would fail -- callers should prefer providing a real
|
|
12
|
+
* context via the toolContext parameter.
|
|
13
|
+
*/
|
|
14
|
+
export function createNullToolContext(persona, task) {
|
|
15
|
+
return {
|
|
16
|
+
workspacePath: '',
|
|
17
|
+
targetRepoPath: '',
|
|
18
|
+
project: {
|
|
19
|
+
project: { name: '', key: '' },
|
|
20
|
+
workspace: { path: '', work: '', runs: '' },
|
|
21
|
+
source: { repo: '', path: '' },
|
|
22
|
+
llm: { default_model: '', providers: {} },
|
|
23
|
+
},
|
|
24
|
+
persona,
|
|
25
|
+
task,
|
|
26
|
+
runId: '',
|
|
27
|
+
protectedPaths: [],
|
|
28
|
+
logger: () => { },
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class WorkspaceNotFoundError extends Error {
|
|
2
|
+
readonly code: "WORKSPACE_NOT_FOUND";
|
|
3
|
+
constructor(startDir: string);
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Walk up from `startDir` looking for a directory containing `.crew/config`.
|
|
7
|
+
* Returns the absolute path of the first matching directory.
|
|
8
|
+
* Throws `WorkspaceNotFoundError` if the filesystem root is reached without a match.
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectWorkspace(startDir: string): string;
|
|
11
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/workspace/detect.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,EAAG,qBAAqB,CAAU;gBAEnC,QAAQ,EAAE,MAAM;CAO7B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAaxD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
export class WorkspaceNotFoundError extends Error {
|
|
4
|
+
code = 'WORKSPACE_NOT_FOUND';
|
|
5
|
+
constructor(startDir) {
|
|
6
|
+
super(`No workspace found. Searched from '${startDir}' to filesystem root for .crew/config. ` +
|
|
7
|
+
`Run from within a workspace directory or pass --workspace.`);
|
|
8
|
+
this.name = 'WorkspaceNotFoundError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Walk up from `startDir` looking for a directory containing `.crew/config`.
|
|
13
|
+
* Returns the absolute path of the first matching directory.
|
|
14
|
+
* Throws `WorkspaceNotFoundError` if the filesystem root is reached without a match.
|
|
15
|
+
*/
|
|
16
|
+
export function detectWorkspace(startDir) {
|
|
17
|
+
let dir = resolve(startDir);
|
|
18
|
+
while (true) {
|
|
19
|
+
if (existsSync(join(dir, '.crew', 'config'))) {
|
|
20
|
+
return dir;
|
|
21
|
+
}
|
|
22
|
+
const parent = dirname(dir);
|
|
23
|
+
if (parent === dir) {
|
|
24
|
+
throw new WorkspaceNotFoundError(startDir);
|
|
25
|
+
}
|
|
26
|
+
dir = parent;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.test.d.ts","sourceRoot":"","sources":["../../src/workspace/detect.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { detectWorkspace, WorkspaceNotFoundError } from './detect.js';
|
|
6
|
+
describe('detectWorkspace', () => {
|
|
7
|
+
let tempDir;
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
tempDir = mkdtempSync(join(tmpdir(), 'crew-ws-detect-'));
|
|
10
|
+
});
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
13
|
+
});
|
|
14
|
+
it('finds workspace when .crew/config exists in the start directory', () => {
|
|
15
|
+
mkdirSync(join(tempDir, '.crew'), { recursive: true });
|
|
16
|
+
writeFileSync(join(tempDir, '.crew', 'config'), 'project: {}');
|
|
17
|
+
expect(detectWorkspace(tempDir)).toBe(tempDir);
|
|
18
|
+
});
|
|
19
|
+
it('finds workspace in a parent directory', () => {
|
|
20
|
+
mkdirSync(join(tempDir, '.crew'), { recursive: true });
|
|
21
|
+
writeFileSync(join(tempDir, '.crew', 'config'), 'project: {}');
|
|
22
|
+
const nested = join(tempDir, 'a', 'b', 'c');
|
|
23
|
+
mkdirSync(nested, { recursive: true });
|
|
24
|
+
expect(detectWorkspace(nested)).toBe(tempDir);
|
|
25
|
+
});
|
|
26
|
+
it('throws WorkspaceNotFoundError when no workspace exists', () => {
|
|
27
|
+
const noWorkspace = join(tempDir, 'empty');
|
|
28
|
+
mkdirSync(noWorkspace, { recursive: true });
|
|
29
|
+
expect(() => detectWorkspace(noWorkspace)).toThrow(WorkspaceNotFoundError);
|
|
30
|
+
});
|
|
31
|
+
it('error message mentions --workspace flag', () => {
|
|
32
|
+
const noWorkspace = join(tempDir, 'empty');
|
|
33
|
+
mkdirSync(noWorkspace, { recursive: true });
|
|
34
|
+
try {
|
|
35
|
+
detectWorkspace(noWorkspace);
|
|
36
|
+
expect.fail('should have thrown');
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
expect(err).toBeInstanceOf(WorkspaceNotFoundError);
|
|
40
|
+
expect(err.message).toContain('--workspace');
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
it('finds the nearest workspace when multiple exist in the ancestor chain', () => {
|
|
44
|
+
mkdirSync(join(tempDir, '.crew'), { recursive: true });
|
|
45
|
+
writeFileSync(join(tempDir, '.crew', 'config'), 'project: {}');
|
|
46
|
+
const inner = join(tempDir, 'sub');
|
|
47
|
+
mkdirSync(join(inner, '.crew'), { recursive: true });
|
|
48
|
+
writeFileSync(join(inner, '.crew', 'config'), 'project: {}');
|
|
49
|
+
const deepChild = join(inner, 'deep');
|
|
50
|
+
mkdirSync(deepChild, { recursive: true });
|
|
51
|
+
expect(detectWorkspace(deepChild)).toBe(inner);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { detectWorkspace, WorkspaceNotFoundError } from './detect.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@helmiq/crew",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Artifact-centric autonomous delivery runtime",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/helmiq/crew",
|
|
10
|
+
"directory": "packages/crew"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"helmiq",
|
|
14
|
+
"crew",
|
|
15
|
+
"delivery",
|
|
16
|
+
"ai-agents",
|
|
17
|
+
"runtime"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20.9.0"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"defaults"
|
|
25
|
+
],
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"gray-matter": "^4.0.3",
|
|
34
|
+
"js-tiktoken": "^1.0.21",
|
|
35
|
+
"simple-git": "^3.33.0",
|
|
36
|
+
"yaml": "^2.8.3",
|
|
37
|
+
"zod": "^4.3.6",
|
|
38
|
+
"@helmiq/crew-code": "0.1.0",
|
|
39
|
+
"@helmiq/crew-git": "0.1.0",
|
|
40
|
+
"@helmiq/crew-shell": "0.1.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^25.5.0",
|
|
44
|
+
"typescript": "^6.0.2",
|
|
45
|
+
"@helmiq/typescript-config": "0.0.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc --project tsconfig.json",
|
|
49
|
+
"typecheck": "tsc --noEmit --project tsconfig.json"
|
|
50
|
+
}
|
|
51
|
+
}
|