@crewx/sdk 0.8.0-rc.79 → 0.8.0-rc.82
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/__tests__/adapter/context-builder.test.d.ts +1 -0
- package/dist/__tests__/adapter/plugin-helper.test.d.ts +1 -0
- package/dist/__tests__/adapter/registration-integration.test.d.ts +1 -0
- package/dist/__tests__/adapter/scoped-store.test.d.ts +1 -0
- package/dist/__tests__/plugins/conversation.test.d.ts +1 -0
- package/dist/__tests__/testing/createMockContext.test.d.ts +1 -0
- package/dist/adapter/context-builder.d.ts +0 -9
- package/dist/adapter/index.d.ts +0 -1
- package/dist/adapter/plugin-helper.d.ts +0 -7
- package/dist/adapter/scoped-store.d.ts +0 -10
- package/dist/adapter/types.d.ts +0 -7
- package/dist/agent/resolver.d.ts +0 -13
- package/dist/boxing/box-storage.interface.d.ts +0 -4
- package/dist/boxing/box.service.d.ts +0 -4
- package/dist/boxing/box.types.d.ts +0 -4
- package/dist/boxing/context-builder.d.ts +0 -4
- package/dist/client/CrewxClient.d.ts +0 -32
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.js +1 -6
- package/dist/config/loader.browser.d.ts +0 -8
- package/dist/config/loader.d.ts +0 -12
- package/dist/conversation/__tests__/sqlite-provider.test.d.ts +1 -0
- package/dist/conversation/__tests__/to-task-reader.test.d.ts +1 -0
- package/dist/conversation/index.d.ts +0 -1
- package/dist/conversation/sqlite-provider.d.ts +0 -9
- package/dist/conversation/to-task-reader.d.ts +0 -11
- package/dist/conversation/to-template-messages.d.ts +0 -13
- package/dist/conversation/types.d.ts +0 -58
- package/dist/esm/client/index.js +1 -2
- package/dist/esm/hooks/index.js +7 -6
- package/dist/esm/index.js +79 -60
- package/dist/esm/plugins/index.js +52 -0
- package/dist/esm/testing/index.js +1 -0
- package/dist/esm/tools/node/index.js +36 -54
- package/dist/events/TypedEventEmitter.d.ts +0 -24
- package/dist/events/types.d.ts +0 -43
- package/dist/facade/Crewx.browser.d.ts +0 -40
- package/dist/facade/Crewx.d.ts +0 -163
- package/dist/hooks/define.d.ts +0 -1
- package/dist/hooks/dispatch.d.ts +0 -12
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +7 -24
- package/dist/hooks/observer.d.ts +0 -1
- package/dist/hooks/plugin.d.ts +0 -1
- package/dist/hooks/tool-normalize.d.ts +0 -26
- package/dist/hooks/types.d.ts +0 -1
- package/dist/hooks/yaml-plugin.d.ts +0 -1
- package/dist/index.browser.d.ts +0 -7
- package/dist/index.browser.js +2 -25
- package/dist/index.d.ts +0 -4
- package/dist/index.js +79 -151
- package/dist/layout/loader.d.ts +0 -20
- package/dist/layout/props-validator.d.ts +0 -6
- package/dist/layout/renderer.d.ts +0 -24
- package/dist/layout/types.d.ts +0 -42
- package/dist/parallel/agent-runtime.d.ts +0 -11
- package/dist/parallel/helpers.d.ts +0 -1
- package/dist/parallel/index.d.ts +0 -1
- package/dist/parallel/parallel-runner.d.ts +0 -8
- package/dist/parallel/types.d.ts +0 -24
- package/dist/parsers/agent-call.util.d.ts +0 -3
- package/dist/parsers/claude.parser.d.ts +0 -8
- package/dist/parsers/codex.parser.d.ts +0 -8
- package/dist/parsers/copilot.parser.d.ts +0 -9
- package/dist/parsers/gemini.parser.d.ts +0 -10
- package/dist/parsers/opencode.parser.d.ts +0 -10
- package/dist/parsers/router.d.ts +0 -5
- package/dist/paths.d.ts +1 -0
- package/dist/platform/BrowserFsAdapter.d.ts +0 -20
- package/dist/platform/IFsAdapter.d.ts +0 -23
- package/dist/platform/NodeFsAdapter.d.ts +0 -8
- package/dist/plugin/plugin-provider.d.ts +0 -22
- package/dist/plugin/types.d.ts +0 -31
- package/dist/plugin.d.ts +0 -27
- package/dist/plugins/conversation.d.ts +0 -2
- package/dist/plugins/file-logger.d.ts +0 -13
- package/dist/plugins/index.d.ts +0 -10
- package/dist/plugins/index.js +52 -19
- package/dist/plugins/sqlite-tracing.d.ts +0 -13
- package/dist/plugins/sqlite-tracing.spec.d.ts +1 -0
- package/dist/provider/bridge.browser.d.ts +0 -20
- package/dist/provider/bridge.d.ts +0 -47
- package/dist/provider/parse-usage.d.ts +0 -14
- package/dist/provider/register-api.d.ts +0 -7
- package/dist/provider/vercel-runtime.d.ts +0 -29
- package/dist/remote/index.d.ts +0 -6
- package/dist/remote/remote-agent-manager.d.ts +0 -31
- package/dist/remote/remote-provider.d.ts +0 -15
- package/dist/remote/remote-transport.d.ts +0 -17
- package/dist/remote/types.d.ts +0 -59
- package/dist/server/auth.d.ts +0 -16
- package/dist/server/handler.d.ts +0 -17
- package/dist/server/index.d.ts +0 -4
- package/dist/server/tool-adapter.d.ts +0 -16
- package/dist/template/engine.d.ts +0 -19
- package/dist/template/helpers/exec.browser.d.ts +0 -7
- package/dist/template/helpers/exec.d.ts +0 -45
- package/dist/template/helpers/fenced_code.d.ts +0 -16
- package/dist/template/helpers/format-conversation.d.ts +0 -22
- package/dist/template/helpers/include.d.ts +0 -15
- package/dist/template/helpers/p1p2.d.ts +0 -32
- package/dist/template/loader/DocumentLoader.d.ts +0 -30
- package/dist/template/types.d.ts +0 -30
- package/dist/testing/index.d.ts +0 -1
- package/dist/testing/index.js +1 -16
- package/dist/testing/mock-audit.d.ts +0 -1
- package/dist/testing/mock-context.d.ts +0 -1
- package/dist/testing/mock-logger.d.ts +0 -1
- package/dist/testing/mock-router.d.ts +0 -1
- package/dist/testing/mock-storage.d.ts +0 -1
- package/dist/testing/mock-store.d.ts +0 -1
- package/dist/tools/delegate.d.ts +0 -7
- package/dist/tools/index.d.ts +0 -4
- package/dist/tools/node/builtin.d.ts +0 -16
- package/dist/tools/node/index.d.ts +0 -20
- package/dist/tools/node/index.js +36 -59
- package/dist/types/index.d.ts +0 -20
- package/dist/types/task-log.types.d.ts +0 -4
- package/dist/utils/env-defaults.d.ts +0 -16
- package/dist/utils/glob-match.d.ts +0 -16
- package/dist/utils/id.d.ts +0 -15
- package/dist/utils/timestamp.d.ts +0 -1
- package/dist/utils/workspace.d.ts +0 -4
- package/package.json +24 -25
- package/dist/adapter/context-builder.js +0 -87
- package/dist/adapter/index.js +0 -21
- package/dist/adapter/plugin-helper.js +0 -45
- package/dist/adapter/scoped-store.js +0 -43
- package/dist/adapter/types.js +0 -23
- package/dist/agent/resolver.js +0 -46
- package/dist/boxing/box-storage.interface.js +0 -6
- package/dist/boxing/box.service.js +0 -73
- package/dist/boxing/box.types.js +0 -6
- package/dist/boxing/context-builder.js +0 -79
- package/dist/client/CrewxClient.js +0 -86
- package/dist/config/loader.browser.js +0 -59
- package/dist/config/loader.js +0 -95
- package/dist/conversation/index.js +0 -25
- package/dist/conversation/sqlite-provider.js +0 -178
- package/dist/conversation/to-task-reader.js +0 -28
- package/dist/conversation/to-template-messages.js +0 -34
- package/dist/conversation/types.js +0 -10
- package/dist/esm/agent/resolver.js +0 -41
- package/dist/esm/boxing/box-storage.interface.js +0 -5
- package/dist/esm/boxing/box.service.js +0 -69
- package/dist/esm/boxing/box.types.js +0 -5
- package/dist/esm/boxing/context-builder.js +0 -76
- package/dist/esm/client/CrewxClient.js +0 -82
- package/dist/esm/config/loader.browser.js +0 -54
- package/dist/esm/config/loader.js +0 -77
- package/dist/esm/events/TypedEventEmitter.js +0 -61
- package/dist/esm/events/types.js +0 -8
- package/dist/esm/facade/Crewx.browser.js +0 -310
- package/dist/esm/facade/Crewx.js +0 -941
- package/dist/esm/hooks/define.js +0 -10
- package/dist/esm/hooks/dispatch.js +0 -76
- package/dist/esm/hooks/observer.js +0 -56
- package/dist/esm/hooks/plugin.js +0 -12
- package/dist/esm/hooks/types.js +0 -9
- package/dist/esm/index.browser.js +0 -15
- package/dist/esm/layout/loader.js +0 -268
- package/dist/esm/layout/props-validator.js +0 -297
- package/dist/esm/layout/renderer.js +0 -180
- package/dist/esm/layout/types.js +0 -31
- package/dist/esm/parallel/agent-runtime.js +0 -21
- package/dist/esm/parallel/helpers.js +0 -214
- package/dist/esm/parallel/index.js +0 -5
- package/dist/esm/parallel/parallel-runner.js +0 -221
- package/dist/esm/parallel/types.js +0 -5
- package/dist/esm/parsers/agent-call.util.js +0 -15
- package/dist/esm/parsers/claude.parser.js +0 -64
- package/dist/esm/parsers/codex.parser.js +0 -97
- package/dist/esm/parsers/copilot.parser.js +0 -63
- package/dist/esm/parsers/gemini.parser.js +0 -43
- package/dist/esm/parsers/opencode.parser.js +0 -73
- package/dist/esm/parsers/router.js +0 -53
- package/dist/esm/platform/BrowserFsAdapter.js +0 -80
- package/dist/esm/platform/IFsAdapter.js +0 -2
- package/dist/esm/platform/NodeFsAdapter.js +0 -34
- package/dist/esm/plugin/plugin-provider.js +0 -202
- package/dist/esm/plugin/types.js +0 -8
- package/dist/esm/plugin.js +0 -25
- package/dist/esm/provider/bridge.browser.js +0 -43
- package/dist/esm/provider/bridge.js +0 -373
- package/dist/esm/provider/parse-usage.js +0 -80
- package/dist/esm/provider/register-api.js +0 -21
- package/dist/esm/provider/vercel-runtime.js +0 -310
- package/dist/esm/remote/index.js +0 -10
- package/dist/esm/remote/remote-agent-manager.js +0 -194
- package/dist/esm/remote/remote-provider.js +0 -98
- package/dist/esm/remote/remote-transport.js +0 -79
- package/dist/esm/remote/types.js +0 -8
- package/dist/esm/server/auth.js +0 -31
- package/dist/esm/server/handler.js +0 -72
- package/dist/esm/server/index.js +0 -5
- package/dist/esm/server/tool-adapter.js +0 -92
- package/dist/esm/template/engine.js +0 -100
- package/dist/esm/template/helpers/exec.browser.js +0 -31
- package/dist/esm/template/helpers/exec.js +0 -220
- package/dist/esm/template/helpers/fenced_code.js +0 -17
- package/dist/esm/template/helpers/include.js +0 -20
- package/dist/esm/template/helpers/p1p2.js +0 -83
- package/dist/esm/template/loader/DocumentLoader.js +0 -124
- package/dist/esm/template/types.js +0 -5
- package/dist/esm/tools/delegate.js +0 -57
- package/dist/esm/tools/index.js +0 -5
- package/dist/esm/tools/node/builtin.js +0 -541
- package/dist/esm/types/index.js +0 -27
- package/dist/esm/types/task-log.types.js +0 -5
- package/dist/esm/utils/env-defaults.js +0 -23
- package/dist/esm/utils/glob-match.js +0 -38
- package/dist/esm/utils/id.js +0 -46
- package/dist/esm/utils/workspace.js +0 -21
- package/dist/events/TypedEventEmitter.js +0 -65
- package/dist/events/types.js +0 -9
- package/dist/facade/Crewx.browser.js +0 -314
- package/dist/facade/Crewx.js +0 -1299
- package/dist/hooks/define.js +0 -13
- package/dist/hooks/dispatch.js +0 -147
- package/dist/hooks/observer.js +0 -60
- package/dist/hooks/plugin.js +0 -17
- package/dist/hooks/tool-normalize.js +0 -110
- package/dist/hooks/types.js +0 -12
- package/dist/hooks/yaml-plugin.js +0 -356
- package/dist/layout/loader.js +0 -305
- package/dist/layout/props-validator.js +0 -301
- package/dist/layout/renderer.js +0 -193
- package/dist/layout/types.js +0 -36
- package/dist/parallel/agent-runtime.js +0 -25
- package/dist/parallel/helpers.js +0 -219
- package/dist/parallel/index.js +0 -13
- package/dist/parallel/parallel-runner.js +0 -226
- package/dist/parallel/types.js +0 -6
- package/dist/parsers/agent-call.util.js +0 -19
- package/dist/parsers/api.parser.d.ts +0 -10
- package/dist/parsers/api.parser.js +0 -26
- package/dist/parsers/claude.parser.js +0 -67
- package/dist/parsers/codex.parser.js +0 -100
- package/dist/parsers/copilot.parser.js +0 -66
- package/dist/parsers/gemini.parser.js +0 -46
- package/dist/parsers/opencode.parser.js +0 -76
- package/dist/parsers/router.js +0 -56
- package/dist/platform/BrowserFsAdapter.js +0 -84
- package/dist/platform/IFsAdapter.js +0 -3
- package/dist/platform/NodeFsAdapter.js +0 -38
- package/dist/plugin/plugin-provider.js +0 -207
- package/dist/plugin/types.js +0 -9
- package/dist/plugin.js +0 -29
- package/dist/plugins/conversation.js +0 -59
- package/dist/plugins/file-logger.js +0 -87
- package/dist/plugins/sqlite-tracing.js +0 -112
- package/dist/provider/bridge.browser.js +0 -49
- package/dist/provider/bridge.js +0 -381
- package/dist/provider/mastra-runtime.d.ts +0 -45
- package/dist/provider/mastra-runtime.js +0 -208
- package/dist/provider/parse-usage.js +0 -83
- package/dist/provider/register-api.js +0 -24
- package/dist/provider/vercel-runtime.js +0 -347
- package/dist/remote/index.js +0 -32
- package/dist/remote/remote-agent-manager.js +0 -198
- package/dist/remote/remote-provider.js +0 -141
- package/dist/remote/remote-transport.js +0 -83
- package/dist/remote/types.js +0 -9
- package/dist/server/auth.js +0 -35
- package/dist/server/handler.js +0 -75
- package/dist/server/index.js +0 -9
- package/dist/server/tool-adapter.js +0 -95
- package/dist/template/engine.js +0 -137
- package/dist/template/helpers/exec.browser.js +0 -41
- package/dist/template/helpers/exec.js +0 -230
- package/dist/template/helpers/fenced_code.js +0 -20
- package/dist/template/helpers/format-conversation.js +0 -53
- package/dist/template/helpers/include.js +0 -23
- package/dist/template/helpers/p1p2.js +0 -90
- package/dist/template/loader/DocumentLoader.js +0 -128
- package/dist/template/types.js +0 -6
- package/dist/testing/mock-audit.js +0 -13
- package/dist/testing/mock-context.js +0 -68
- package/dist/testing/mock-logger.js +0 -27
- package/dist/testing/mock-router.js +0 -67
- package/dist/testing/mock-storage.js +0 -21
- package/dist/testing/mock-store.js +0 -8
- package/dist/tools/delegate.js +0 -60
- package/dist/tools/index.js +0 -9
- package/dist/tools/node/builtin.js +0 -547
- package/dist/types/index.js +0 -32
- package/dist/types/task-log.types.js +0 -6
- package/dist/utils/env-defaults.js +0 -27
- package/dist/utils/glob-match.js +0 -42
- package/dist/utils/id.js +0 -50
- package/dist/utils/timestamp.js +0 -13
- package/dist/utils/workspace.js +0 -58
package/dist/layout/loader.d.ts
CHANGED
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LayoutLoader — loads layout templates from templates/agents/*.yaml files.
|
|
3
|
-
* Ported 1:1 from packages/sdk-bak/src/services/layout-loader.service.ts.
|
|
4
|
-
* Only import paths and DEFAULT_OPTIONS.templatesPath are changed.
|
|
5
|
-
*/
|
|
6
1
|
import { CustomLayoutDefinition, LayoutDefinition, LoaderOptions } from './types';
|
|
7
|
-
/**
|
|
8
|
-
* Layout loader service.
|
|
9
|
-
* Loads and caches layout definitions from YAML files.
|
|
10
|
-
* Provides fallback mechanism and prop override support.
|
|
11
|
-
*/
|
|
12
2
|
export declare class LayoutLoader {
|
|
13
3
|
private layouts;
|
|
14
4
|
private options;
|
|
15
5
|
constructor(options?: Partial<LoaderOptions>);
|
|
16
|
-
/**
|
|
17
|
-
* Load a layout by ID with optional props override.
|
|
18
|
-
*/
|
|
19
6
|
load(layoutId: string, propsOverride?: Record<string, any>): LayoutDefinition;
|
|
20
7
|
getLayoutIds(): string[];
|
|
21
8
|
hasLayout(layoutId: string): boolean;
|
|
22
9
|
reload(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Register or override a layout at runtime.
|
|
25
|
-
*/
|
|
26
10
|
registerLayout(layoutId: string, layoutConfig: string | CustomLayoutDefinition): void;
|
|
27
|
-
/**
|
|
28
|
-
* Register multiple layouts from a map.
|
|
29
|
-
*/
|
|
30
11
|
registerLayouts(layoutsMap: Record<string, string | CustomLayoutDefinition>): void;
|
|
31
12
|
private loadAllLayouts;
|
|
32
13
|
private loadLayoutFile;
|
|
@@ -35,4 +16,3 @@ export declare class LayoutLoader {
|
|
|
35
16
|
private normalizeLayoutId;
|
|
36
17
|
private resolveLayoutEntry;
|
|
37
18
|
}
|
|
38
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PropsValidator — React PropTypes style props validation.
|
|
3
|
-
* Ported 1:1 from packages/sdk-bak/src/services/props-validator.service.ts.
|
|
4
|
-
* Only the import path is changed.
|
|
5
|
-
*/
|
|
6
1
|
import { PropSchema, ValidationResult } from './types';
|
|
7
2
|
export type ValidationMode = 'strict' | 'lenient';
|
|
8
3
|
export interface PropsValidatorOptions {
|
|
@@ -32,4 +27,3 @@ export declare class PropsValidator {
|
|
|
32
27
|
private buildPath;
|
|
33
28
|
private describeType;
|
|
34
29
|
}
|
|
35
|
-
//# sourceMappingURL=props-validator.d.ts.map
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LayoutRenderer — Handlebars-based layout rendering.
|
|
3
|
-
* Ported from packages/sdk-bak/src/services/layout-renderer.service.ts.
|
|
4
|
-
* Excluded: registerTemplateHelpers (exec/shell-quote).
|
|
5
|
-
* Exec is handled separately by TemplateEngine in the facade layer.
|
|
6
|
-
* WI-CONV-002: formatConversation helper restored.
|
|
7
|
-
*/
|
|
8
1
|
import { PropsValidator } from './props-validator';
|
|
9
2
|
import type { LayoutDefinition, RenderContext, PropSchema, ValidationResult } from './types';
|
|
10
3
|
export { PropsValidationError } from './types';
|
|
@@ -13,30 +6,14 @@ export interface RenderOptions {
|
|
|
13
6
|
validationMode?: 'strict' | 'lenient';
|
|
14
7
|
skipValidation?: boolean;
|
|
15
8
|
}
|
|
16
|
-
/**
|
|
17
|
-
* LayoutRenderer — renders layout templates with Handlebars.
|
|
18
|
-
*/
|
|
19
9
|
export declare class LayoutRenderer {
|
|
20
10
|
private readonly handlebars;
|
|
21
11
|
private readonly propsValidator;
|
|
22
12
|
constructor(propsValidator?: PropsValidator);
|
|
23
|
-
/**
|
|
24
|
-
* Render a layout template with the given context.
|
|
25
|
-
*/
|
|
26
13
|
render(layout: LayoutDefinition, context: RenderContext, options?: RenderOptions): string;
|
|
27
|
-
/**
|
|
28
|
-
* Validate props against schema.
|
|
29
|
-
*/
|
|
30
14
|
validate(props: Record<string, any> | undefined, propsSchema: Record<string, PropSchema>, mode?: 'strict' | 'lenient'): ValidationResult;
|
|
31
|
-
/**
|
|
32
|
-
* Merge default props and runtime props, then validate.
|
|
33
|
-
*/
|
|
34
15
|
resolveProps(layout: LayoutDefinition, props: Record<string, any> | undefined, mode?: 'strict' | 'lenient'): ValidationResult;
|
|
35
16
|
private prepareRenderContext;
|
|
36
|
-
/**
|
|
37
|
-
* Register built-in Handlebars helpers (no exec).
|
|
38
|
-
* WI-CONV-002: formatConversation block helper registered for conversation history.
|
|
39
|
-
*/
|
|
40
17
|
private registerHelpers;
|
|
41
18
|
private executeValidation;
|
|
42
19
|
private mergeProps;
|
|
@@ -45,4 +22,3 @@ export declare class LayoutRenderer {
|
|
|
45
22
|
private isPlainObject;
|
|
46
23
|
private sanitizeVars;
|
|
47
24
|
}
|
|
48
|
-
//# sourceMappingURL=renderer.d.ts.map
|
package/dist/layout/types.d.ts
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Layout system type definitions for CrewX SDK.
|
|
3
|
-
* Ported from packages/sdk-bak/src/types/layout.types.ts (1:1, import path only changed).
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Template variables for layout rendering (security_key, custom extensions).
|
|
7
|
-
*/
|
|
8
1
|
export interface TemplateVars {
|
|
9
|
-
/** Authentication token used to validate prompt containers */
|
|
10
2
|
security_key?: string;
|
|
11
3
|
[key: string]: unknown;
|
|
12
4
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Prop schema definition (React PropTypes style).
|
|
15
|
-
*/
|
|
16
5
|
export interface PropSchema {
|
|
17
6
|
type: 'string' | 'number' | 'bool' | 'array' | 'arrayOf' | 'object' | 'shape' | 'oneOfType' | 'func' | 'node';
|
|
18
7
|
isRequired?: boolean;
|
|
@@ -29,9 +18,6 @@ export interface PropSchema {
|
|
|
29
18
|
pattern?: string;
|
|
30
19
|
description?: string;
|
|
31
20
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Layout definition loaded from YAML.
|
|
34
|
-
*/
|
|
35
21
|
export interface LayoutDefinition {
|
|
36
22
|
id: string;
|
|
37
23
|
version: string;
|
|
@@ -40,9 +26,6 @@ export interface LayoutDefinition {
|
|
|
40
26
|
propsSchema: Record<string, PropSchema>;
|
|
41
27
|
defaultProps: Record<string, any>;
|
|
42
28
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Custom layout configuration for runtime registration.
|
|
45
|
-
*/
|
|
46
29
|
export interface CustomLayoutDefinition {
|
|
47
30
|
template: string;
|
|
48
31
|
description?: string;
|
|
@@ -50,40 +33,25 @@ export interface CustomLayoutDefinition {
|
|
|
50
33
|
propsSchema?: Record<string, any>;
|
|
51
34
|
defaultProps?: Record<string, any>;
|
|
52
35
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Inline layout specification from agent config.
|
|
55
|
-
*/
|
|
56
36
|
export type InlineLayoutSpec = string | {
|
|
57
37
|
id: string;
|
|
58
38
|
props?: Record<string, any>;
|
|
59
39
|
};
|
|
60
|
-
/**
|
|
61
|
-
* Validation result from PropsValidator.
|
|
62
|
-
*/
|
|
63
40
|
export interface ValidationResult {
|
|
64
41
|
valid: boolean;
|
|
65
42
|
props: Record<string, any>;
|
|
66
43
|
errors: ValidationError[];
|
|
67
44
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Validation error details.
|
|
70
|
-
*/
|
|
71
45
|
export interface ValidationError {
|
|
72
46
|
path: string;
|
|
73
47
|
message: string;
|
|
74
48
|
value?: any;
|
|
75
49
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Layout loader options.
|
|
78
|
-
*/
|
|
79
50
|
export interface LoaderOptions {
|
|
80
51
|
templatesPath: string;
|
|
81
52
|
validationMode?: 'strict' | 'lenient';
|
|
82
53
|
fallbackLayoutId?: string;
|
|
83
54
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Render context for layout-specific template rendering.
|
|
86
|
-
*/
|
|
87
55
|
export interface RenderContext {
|
|
88
56
|
user_input?: string;
|
|
89
57
|
messages?: Array<{
|
|
@@ -131,9 +99,6 @@ export interface RenderContext {
|
|
|
131
99
|
context?: Record<string, any>;
|
|
132
100
|
[key: string]: unknown;
|
|
133
101
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Raw layout YAML structure.
|
|
136
|
-
*/
|
|
137
102
|
export interface RawLayoutYaml {
|
|
138
103
|
id?: string;
|
|
139
104
|
version?: string;
|
|
@@ -142,20 +107,13 @@ export interface RawLayoutYaml {
|
|
|
142
107
|
template?: string;
|
|
143
108
|
layouts?: Record<string, string>;
|
|
144
109
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Error thrown when layout loading fails.
|
|
147
|
-
*/
|
|
148
110
|
export declare class LayoutLoadError extends Error {
|
|
149
111
|
readonly layoutId?: string | undefined;
|
|
150
112
|
readonly cause?: Error | undefined;
|
|
151
113
|
constructor(message: string, layoutId?: string | undefined, cause?: Error | undefined);
|
|
152
114
|
}
|
|
153
|
-
/**
|
|
154
|
-
* Error thrown when props validation fails (strict mode).
|
|
155
|
-
*/
|
|
156
115
|
export declare class PropsValidationError extends Error {
|
|
157
116
|
readonly errors: ValidationError[];
|
|
158
117
|
readonly cause?: Error | undefined;
|
|
159
118
|
constructor(message: string, errors?: ValidationError[], cause?: Error | undefined);
|
|
160
119
|
}
|
|
161
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal AgentRuntime for the parallel execution module.
|
|
3
|
-
* Provides query/execute methods to run agent operations.
|
|
4
|
-
* Tests use vi.spyOn(AgentRuntime.prototype, 'query') to mock these methods.
|
|
5
|
-
*/
|
|
6
1
|
export interface AgentQueryRequest {
|
|
7
2
|
agentId?: string;
|
|
8
3
|
prompt: string;
|
|
@@ -19,13 +14,7 @@ export interface AgentResult {
|
|
|
19
14
|
agentId?: string;
|
|
20
15
|
metadata?: Record<string, unknown>;
|
|
21
16
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Runtime that executes agent query/execute operations.
|
|
24
|
-
* Default implementation throws — callers must inject a working provider
|
|
25
|
-
* or mock the prototype methods in tests.
|
|
26
|
-
*/
|
|
27
17
|
export declare class AgentRuntime {
|
|
28
18
|
query(_request: AgentQueryRequest): Promise<AgentResult>;
|
|
29
19
|
execute(_request: AgentExecuteRequest): Promise<AgentResult>;
|
|
30
20
|
}
|
|
31
|
-
//# sourceMappingURL=agent-runtime.d.ts.map
|
|
@@ -25,4 +25,3 @@ export interface HelperResult<T = AgentResult> {
|
|
|
25
25
|
}
|
|
26
26
|
export declare const runQueriesParallel: (queries: AgentQueryRequest[], config?: ParallelConfig) => Promise<AgentResult[]>;
|
|
27
27
|
export declare const runExecutesParallel: (requests: AgentExecuteRequest[], config?: ParallelConfig) => Promise<AgentResult[]>;
|
|
28
|
-
//# sourceMappingURL=helpers.d.ts.map
|
package/dist/parallel/index.d.ts
CHANGED
|
@@ -5,4 +5,3 @@ export { runQueriesParallel, runExecutesParallel } from './helpers';
|
|
|
5
5
|
export type { ParallelConfig, HelperResult, RetryPolicy } from './helpers';
|
|
6
6
|
export { AgentRuntime } from './agent-runtime';
|
|
7
7
|
export type { AgentResult, AgentQueryRequest, AgentExecuteRequest } from './agent-runtime';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import type { ParallelRunnerMetrics, ParallelRunnerOptions, Task, TaskResult } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Error raised when a task exceeds the configured per-task timeout.
|
|
4
|
-
*/
|
|
5
2
|
export declare class ParallelRunnerTimeoutError extends Error {
|
|
6
3
|
readonly taskId: string;
|
|
7
4
|
readonly timeoutMs: number;
|
|
8
5
|
constructor(taskId: string, timeoutMs: number);
|
|
9
6
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Executes tasks with bounded concurrency and cooperative cancellation support.
|
|
12
|
-
* Framework-agnostic — usable from CLI, SDK, or any consumer.
|
|
13
|
-
*/
|
|
14
7
|
export declare class ParallelRunner {
|
|
15
8
|
private readonly defaults;
|
|
16
9
|
private metrics;
|
|
@@ -20,4 +13,3 @@ export declare class ParallelRunner {
|
|
|
20
13
|
private mergeOptions;
|
|
21
14
|
private mergeCallbacks;
|
|
22
15
|
}
|
|
23
|
-
//# sourceMappingURL=parallel-runner.d.ts.map
|
package/dist/parallel/types.d.ts
CHANGED
|
@@ -1,57 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types for the parallel execution module.
|
|
3
|
-
*/
|
|
4
|
-
/** A unit of work that can be executed by the ParallelRunner. */
|
|
5
1
|
export interface Task<T> {
|
|
6
|
-
/** Unique identifier for the task. Used for logging and metrics. */
|
|
7
2
|
id: string;
|
|
8
|
-
/** Optional metadata associated with the task. */
|
|
9
3
|
metadata?: Record<string, unknown>;
|
|
10
|
-
/** Perform the actual work, respecting the provided execution context. */
|
|
11
4
|
run: (context: TaskExecutionContext) => Promise<T>;
|
|
12
5
|
}
|
|
13
|
-
/** Context information passed to each task during execution. */
|
|
14
6
|
export interface TaskExecutionContext {
|
|
15
|
-
/** AbortSignal triggered on timeout or cooperative cancellation. */
|
|
16
7
|
signal: AbortSignal;
|
|
17
8
|
}
|
|
18
|
-
/** Result produced by the ParallelRunner for each executed task. */
|
|
19
9
|
export interface TaskResult<T> {
|
|
20
10
|
taskId: string;
|
|
21
11
|
success: boolean;
|
|
22
12
|
value?: T;
|
|
23
13
|
error?: Error;
|
|
24
|
-
/** Milliseconds spent executing the task. */
|
|
25
14
|
durationMs: number;
|
|
26
|
-
/** performance.now() timestamp when the task started. */
|
|
27
15
|
startedAt: number;
|
|
28
|
-
/** performance.now() timestamp when the task finished. */
|
|
29
16
|
finishedAt: number;
|
|
30
|
-
/** Metadata forwarded from the original task definition. */
|
|
31
17
|
metadata?: Record<string, unknown>;
|
|
32
|
-
/** Whether the failure was caused by an abort/timeout event. */
|
|
33
18
|
aborted?: boolean;
|
|
34
19
|
}
|
|
35
|
-
/** Callback hooks for task lifecycle instrumentation. */
|
|
36
20
|
export interface TaskCallbacks<T> {
|
|
37
21
|
onTaskStart?: (task: Task<T>) => void | Promise<void>;
|
|
38
22
|
onTaskComplete?: (result: TaskResult<T>) => void | Promise<void>;
|
|
39
23
|
onError?: (task: Task<T>, error: Error, durationMs: number) => void | Promise<void>;
|
|
40
24
|
}
|
|
41
|
-
/** Execution options for the ParallelRunner. */
|
|
42
25
|
export interface ParallelRunnerOptions<T = unknown> {
|
|
43
|
-
/** Maximum concurrent tasks. Defaults to 5. */
|
|
44
26
|
maxConcurrency?: number;
|
|
45
|
-
/** Per-task timeout in milliseconds. Undefined disables timeout. */
|
|
46
27
|
timeoutMs?: number;
|
|
47
|
-
/** Stop scheduling new tasks after any failure. */
|
|
48
28
|
failFast?: boolean;
|
|
49
|
-
/** Lifecycle callback hooks. */
|
|
50
29
|
callbacks?: TaskCallbacks<T>;
|
|
51
|
-
/** Determine whether a resolved value is considered successful. Defaults to always true. */
|
|
52
30
|
evaluateTaskSuccess?: (value: T, task: Task<T>) => boolean;
|
|
53
31
|
}
|
|
54
|
-
/** Metrics summary produced after a ParallelRunner.run() call. */
|
|
55
32
|
export interface ParallelRunnerMetrics {
|
|
56
33
|
totalTasks: number;
|
|
57
34
|
startedTasks: number;
|
|
@@ -62,4 +39,3 @@ export interface ParallelRunnerMetrics {
|
|
|
62
39
|
averageDurationMs: number;
|
|
63
40
|
throughput: number;
|
|
64
41
|
}
|
|
65
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { TaskLogEntry } from '../types/task-log.types';
|
|
2
|
-
/** Detect crewx execute/x command pattern */
|
|
3
2
|
export declare function isAgentCallCommand(command: string): boolean;
|
|
4
|
-
/** Extract agent_call entry from crewx x "@agent ..." command */
|
|
5
3
|
export declare function parseAgentCall(timestamp: string, command: string): TaskLogEntry;
|
|
6
|
-
//# sourceMappingURL=agent-call.util.d.ts.map
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import type { TaskLogEntry } from '../types/task-log.types';
|
|
2
|
-
/**
|
|
3
|
-
* Parse Claude stream-json events into TaskLogEntry[].
|
|
4
|
-
*
|
|
5
|
-
* Claude events:
|
|
6
|
-
* - { type: "assistant", message: { content: [{ type: "text"|"tool_use", ... }] } }
|
|
7
|
-
* - { type: "user", message: { content: [{ type: "tool_result", ... }] } }
|
|
8
|
-
*/
|
|
9
2
|
export declare function parseClaudeEvent(timestamp: string, parsed: Record<string, unknown>): TaskLogEntry[];
|
|
10
|
-
//# sourceMappingURL=claude.parser.d.ts.map
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import type { TaskLogEntry } from '../types/task-log.types';
|
|
2
|
-
/**
|
|
3
|
-
* Parse Codex experimental-json events into TaskLogEntry[].
|
|
4
|
-
*
|
|
5
|
-
* Codex events:
|
|
6
|
-
* - { type: "item.started", item: { type: "command_execution", command } }
|
|
7
|
-
* - { type: "item.completed", item: { type: "command_execution"|"message"|"text"|"reasoning"|"tool_use"|"tool_result", ... } }
|
|
8
|
-
*/
|
|
9
2
|
export declare function parseCodexEvent(timestamp: string, parsed: Record<string, unknown>): TaskLogEntry[];
|
|
10
|
-
//# sourceMappingURL=codex.parser.d.ts.map
|
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import type { TaskLogEntry } from '../types/task-log.types';
|
|
2
|
-
/**
|
|
3
|
-
* Parse Copilot json events into TaskLogEntry[].
|
|
4
|
-
*
|
|
5
|
-
* Copilot events:
|
|
6
|
-
* - { type: "tool.execution_start", data: { toolName, arguments } }
|
|
7
|
-
* - { type: "tool.execution_complete", data: { result?: { content }, error?: { message } } }
|
|
8
|
-
* - { type: "assistant.message", data: { content } }
|
|
9
|
-
*/
|
|
10
2
|
export declare function parseCopilotEvent(timestamp: string, parsed: Record<string, unknown>): TaskLogEntry[];
|
|
11
|
-
//# sourceMappingURL=copilot.parser.d.ts.map
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
import type { TaskLogEntry } from '../types/task-log.types';
|
|
2
|
-
/**
|
|
3
|
-
* Parse Gemini stream-json events into TaskLogEntry[].
|
|
4
|
-
*
|
|
5
|
-
* Gemini events:
|
|
6
|
-
* - { type: "message", role: "assistant", delta: true, content: "..." }
|
|
7
|
-
* - { type: "init", ... } (ignored)
|
|
8
|
-
* - { type: "tool_use", tool_name, tool_id, parameters }
|
|
9
|
-
* - { type: "tool_result", tool_id, status, output }
|
|
10
|
-
*/
|
|
11
2
|
export declare function parseGeminiEvent(timestamp: string, parsed: Record<string, unknown>): TaskLogEntry[];
|
|
12
|
-
//# sourceMappingURL=gemini.parser.d.ts.map
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
import type { TaskLogEntry } from '../types/task-log.types';
|
|
2
|
-
/**
|
|
3
|
-
* Parse OpenCode stream-json events (--format json) into TaskLogEntry[].
|
|
4
|
-
*
|
|
5
|
-
* OpenCode events:
|
|
6
|
-
* - { type: "step_start", sessionID: "ses_...", part: { type: "step-start" } }
|
|
7
|
-
* - { type: "text", part: { type: "text", text: "..." } }
|
|
8
|
-
* - { type: "step_finish", part: { reason: "stop", tokens: { total, input, output, reasoning, cache: { write, read } }, cost: 0 } }
|
|
9
|
-
* - { type: "tool_use", part: { type: "tool", tool: "bash"|"write"|..., callID: "...", state: { status, input, output } } }
|
|
10
|
-
*/
|
|
11
2
|
export declare function parseOpencodeEvent(timestamp: string, parsed: Record<string, unknown>): TaskLogEntry[];
|
|
12
|
-
//# sourceMappingURL=opencode.parser.d.ts.map
|
package/dist/parsers/router.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* parseStdoutEvent — routes a single stdout JSONL event to the appropriate provider parser.
|
|
3
|
-
* Returns TaskLogEntry[] (may be empty if event is not recognized or irrelevant).
|
|
4
|
-
*/
|
|
5
1
|
import type { TaskLogEntry } from '../types/task-log.types';
|
|
6
2
|
export declare function parseStdoutEvent(timestamp: string, message: string): TaskLogEntry[];
|
|
7
|
-
//# sourceMappingURL=router.d.ts.map
|
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveTemplatesPath(override?: string): string;
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BrowserFsAdapter — IFsAdapter implementation for browser environments.
|
|
3
|
-
*
|
|
4
|
-
* Uses localStorage as the backing store with a key-prefix namespace.
|
|
5
|
-
* Paths are normalized to forward-slash POSIX style.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* const fs = new BrowserFsAdapter();
|
|
9
|
-
* // Pre-load content before using with DocumentLoader:
|
|
10
|
-
* fs.setItem('/docs/guide.md', '# Guide\n...');
|
|
11
|
-
*/
|
|
12
1
|
import type { IFsAdapter } from './IFsAdapter';
|
|
13
2
|
export declare class BrowserFsAdapter implements IFsAdapter {
|
|
14
3
|
private readonly prefix;
|
|
15
4
|
private readonly store;
|
|
16
|
-
/**
|
|
17
|
-
* @param options.prefix - localStorage key prefix (default: 'crewx:fs:')
|
|
18
|
-
* @param options.storage - optional external storage map (defaults to an in-memory Map;
|
|
19
|
-
* pass a localStorage-backed wrapper for persistence)
|
|
20
|
-
*/
|
|
21
5
|
constructor(options?: {
|
|
22
6
|
prefix?: string;
|
|
23
7
|
storage?: Map<string, string>;
|
|
@@ -26,12 +10,8 @@ export declare class BrowserFsAdapter implements IFsAdapter {
|
|
|
26
10
|
exists(path: string): Promise<boolean>;
|
|
27
11
|
resolvePath(...segments: string[]): string;
|
|
28
12
|
isAbsolute(path: string): boolean;
|
|
29
|
-
/** Store a virtual file for later reading. */
|
|
30
13
|
setItem(path: string, content: string): void;
|
|
31
|
-
/** Remove a virtual file. */
|
|
32
14
|
removeItem(path: string): void;
|
|
33
|
-
/** List all stored virtual file paths. */
|
|
34
15
|
keys(): string[];
|
|
35
16
|
private toKey;
|
|
36
17
|
}
|
|
37
|
-
//# sourceMappingURL=BrowserFsAdapter.d.ts.map
|
|
@@ -1,29 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IFsAdapter — minimal file-system abstraction for DocumentLoader.
|
|
3
|
-
*
|
|
4
|
-
* Allows injection of alternative implementations (e.g., in-memory for tests,
|
|
5
|
-
* or a WEB-compatible adapter in a future round).
|
|
6
|
-
*
|
|
7
|
-
* Node.js default: NodeFsAdapter.
|
|
8
|
-
*/
|
|
9
1
|
export interface IFsAdapter {
|
|
10
|
-
/**
|
|
11
|
-
* Read a file as UTF-8 string.
|
|
12
|
-
* @throws if the file does not exist or is not readable.
|
|
13
|
-
*/
|
|
14
2
|
readFile(path: string): Promise<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Check whether a file exists at the given path.
|
|
17
|
-
*/
|
|
18
3
|
exists(path: string): Promise<boolean>;
|
|
19
|
-
/**
|
|
20
|
-
* Resolve path segments into an absolute path.
|
|
21
|
-
* Behaves like path.resolve() / path.join() depending on implementation.
|
|
22
|
-
*/
|
|
23
4
|
resolvePath(...segments: string[]): string;
|
|
24
|
-
/**
|
|
25
|
-
* Return true if the given path is absolute.
|
|
26
|
-
*/
|
|
27
5
|
isAbsolute(path: string): boolean;
|
|
28
6
|
}
|
|
29
|
-
//# sourceMappingURL=IFsAdapter.d.ts.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NodeFsAdapter — default IFsAdapter implementation using Node.js fs/path.
|
|
3
|
-
*
|
|
4
|
-
* This is the concrete adapter used in CLI and server contexts.
|
|
5
|
-
* Full platform abstraction (WEB, browser) is deferred to a future round.
|
|
6
|
-
*/
|
|
7
1
|
import type { IFsAdapter } from './IFsAdapter';
|
|
8
2
|
export declare class NodeFsAdapter implements IFsAdapter {
|
|
9
3
|
readFile(path: string): Promise<string>;
|
|
@@ -11,6 +5,4 @@ export declare class NodeFsAdapter implements IFsAdapter {
|
|
|
11
5
|
resolvePath(...segments: string[]): string;
|
|
12
6
|
isAbsolute(path: string): boolean;
|
|
13
7
|
}
|
|
14
|
-
/** Singleton default adapter for convenience in CLI usage. */
|
|
15
8
|
export declare const defaultFsAdapter: IFsAdapter;
|
|
16
|
-
//# sourceMappingURL=NodeFsAdapter.d.ts.map
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Provider Runtime
|
|
3
|
-
*
|
|
4
|
-
* Implements ProviderRuntime for `type: plugin` providers in crewx.yaml.
|
|
5
|
-
* Wraps an arbitrary CLI tool as a CrewX agent via child_process.spawn (shell: false).
|
|
6
|
-
*
|
|
7
|
-
* Symmetric to remote/remote-provider.ts — registered as the `plugin` namespace factory.
|
|
8
|
-
*/
|
|
9
1
|
import type { ProviderRuntime, ProviderFactory, ProviderQueryOptions } from '../provider/bridge.js';
|
|
10
2
|
import type { PluginProviderConfig } from './types.js';
|
|
11
|
-
/**
|
|
12
|
-
* ProviderRuntime implementation for plugin (CLI-wrapped) providers.
|
|
13
|
-
*
|
|
14
|
-
* Created by the `plugin` namespace factory when `createProvider('plugin/mock')` is called.
|
|
15
|
-
* Spawns the configured CLI with args derived from query_args/execute_args,
|
|
16
|
-
* applies `{model}` substitution, and routes the prompt via args or stdin.
|
|
17
|
-
*/
|
|
18
3
|
export declare class PluginProviderRuntime implements ProviderRuntime {
|
|
19
4
|
private readonly config;
|
|
20
5
|
private readonly providerStr;
|
|
@@ -23,11 +8,4 @@ export declare class PluginProviderRuntime implements ProviderRuntime {
|
|
|
23
8
|
execute(message: string, options?: ProviderQueryOptions): Promise<string>;
|
|
24
9
|
private runProcess;
|
|
25
10
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Create a provider factory function for the `plugin` namespace.
|
|
28
|
-
*
|
|
29
|
-
* @param pluginConfigs - Map of plugin provider ID → config (from crewx.yaml `providers:` section)
|
|
30
|
-
* @returns ProviderFactory to register via registerProviderFactory('plugin', factory)
|
|
31
|
-
*/
|
|
32
11
|
export declare function createPluginProviderFactory(pluginConfigs: Map<string, PluginProviderConfig>): ProviderFactory;
|
|
33
|
-
//# sourceMappingURL=plugin-provider.d.ts.map
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -1,53 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Provider Types
|
|
3
|
-
*
|
|
4
|
-
* Configuration for `type: plugin` providers in crewx.yaml.
|
|
5
|
-
* Plugin providers wrap arbitrary CLI tools as CrewX agents.
|
|
6
|
-
*/
|
|
7
1
|
export interface PluginProviderConfig {
|
|
8
2
|
id: string;
|
|
9
3
|
type: 'plugin';
|
|
10
|
-
/** CLI command (binary name or relative path). Executed via spawn(shell: false). */
|
|
11
4
|
cli_command: string;
|
|
12
5
|
display_name?: string;
|
|
13
6
|
description?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Default model used for `{model}` substitution in args.
|
|
16
|
-
* Can be overridden per-call via QueryOptions.model.
|
|
17
|
-
*/
|
|
18
7
|
default_model?: string;
|
|
19
|
-
/**
|
|
20
|
-
* CLI argument array for `query` mode.
|
|
21
|
-
* `{model}` placeholders are replaced with the resolved model name.
|
|
22
|
-
*/
|
|
23
8
|
query_args: string[];
|
|
24
|
-
/**
|
|
25
|
-
* CLI argument array for `execute` mode.
|
|
26
|
-
* `{model}` placeholders are replaced with the resolved model name.
|
|
27
|
-
*/
|
|
28
9
|
execute_args: string[];
|
|
29
|
-
/**
|
|
30
|
-
* When true, the prompt is appended as the final positional argument.
|
|
31
|
-
* When false, the prompt is written to the process stdin.
|
|
32
|
-
*/
|
|
33
10
|
prompt_in_args: boolean;
|
|
34
|
-
/** Additional environment variables merged into process.env (never replaces it). */
|
|
35
11
|
env?: Record<string, string>;
|
|
36
|
-
/** Per-mode timeout in milliseconds. Defaults: query=600000, execute=600000. */
|
|
37
12
|
timeout?: {
|
|
38
13
|
query: number;
|
|
39
14
|
execute: number;
|
|
40
15
|
};
|
|
41
|
-
/**
|
|
42
|
-
* Output patterns that signal a provider-level error (e.g. "not authenticated").
|
|
43
|
-
* Matched against combined stdout+stderr. Uses string contains (not regex).
|
|
44
|
-
*/
|
|
45
16
|
error_patterns?: Array<{
|
|
46
17
|
pattern: string;
|
|
47
18
|
type: string;
|
|
48
19
|
message: string;
|
|
49
20
|
}>;
|
|
50
|
-
/** Human-readable message shown when the CLI is not found. */
|
|
51
21
|
not_installed_message?: string;
|
|
52
22
|
}
|
|
53
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CrewxPlugin — base class for SDK plugins.
|
|
3
|
-
*
|
|
4
|
-
* Plugins subscribe to Crewx events in attach() and clean up in detach().
|
|
5
|
-
* Register via Crewx.use(plugin).
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* class MyPlugin extends CrewxPlugin {
|
|
9
|
-
* readonly name = 'my-plugin';
|
|
10
|
-
* attach(crewx: Crewx) {
|
|
11
|
-
* crewx.on('task:start', (e) => console.log(e.traceId));
|
|
12
|
-
* }
|
|
13
|
-
* }
|
|
14
|
-
* await crewx.use(new MyPlugin());
|
|
15
|
-
*/
|
|
16
1
|
import type { Crewx } from './facade/Crewx';
|
|
17
2
|
export declare abstract class CrewxPlugin {
|
|
18
|
-
/** Unique plugin name. Used for same-instance deduplication in Crewx.use(). */
|
|
19
3
|
abstract readonly name: string;
|
|
20
|
-
/**
|
|
21
|
-
* Called when the plugin is registered via Crewx.use().
|
|
22
|
-
* Subscribe to events and initialize resources here.
|
|
23
|
-
* May be async (e.g. for DB connections).
|
|
24
|
-
*/
|
|
25
4
|
abstract attach(crewx: Crewx): void | Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Called on Crewx.close() in LIFO order.
|
|
28
|
-
* Remove event listeners and release resources here.
|
|
29
|
-
* Default: no-op.
|
|
30
|
-
*/
|
|
31
5
|
detach(_crewx: Crewx): void | Promise<void>;
|
|
32
6
|
}
|
|
33
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -10,9 +10,7 @@ export declare class ConversationPlugin extends CrewxPlugin {
|
|
|
10
10
|
private unsubStart;
|
|
11
11
|
private unsubEnd;
|
|
12
12
|
constructor(opts?: ConversationPluginOptions);
|
|
13
|
-
/** Expose provider for SDK history auto-fetch (WI-CONV-002). */
|
|
14
13
|
get conversationProvider(): IConversationHistoryProvider;
|
|
15
14
|
attach(crewx: Crewx): void;
|
|
16
15
|
detach(_crewx: Crewx): void;
|
|
17
16
|
}
|
|
18
|
-
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FileLoggerPlugin — writes structured log files to .crewx/logs/.
|
|
3
|
-
*
|
|
4
|
-
* Subscribes to task:start and task:end events and writes one log file
|
|
5
|
-
* per task execution. Format mirrors cli-bak TaskManagementService for
|
|
6
|
-
* backward compatibility.
|
|
7
|
-
*
|
|
8
|
-
* File name: {YYYYMMDDTHHmmss}_{traceId}.log
|
|
9
|
-
* e.g. 20260412T145044_tsk_AbCdEfGh.log
|
|
10
|
-
*/
|
|
11
1
|
import { CrewxPlugin } from '../plugin';
|
|
12
2
|
import type { Crewx } from '../facade/Crewx';
|
|
13
3
|
export interface FileLoggerPluginOptions {
|
|
14
|
-
/** Root directory under which `.crewx/logs/` will be created. Defaults to `process.cwd()`. */
|
|
15
4
|
workspaceRoot?: string;
|
|
16
|
-
/** Caller-provided version string written into the log header. Defaults to `'unknown'`. */
|
|
17
5
|
version?: string;
|
|
18
6
|
}
|
|
19
7
|
export declare class FileLoggerPlugin extends CrewxPlugin {
|
|
@@ -26,4 +14,3 @@ export declare class FileLoggerPlugin extends CrewxPlugin {
|
|
|
26
14
|
attach(crewx: Crewx): void;
|
|
27
15
|
detach(_crewx: Crewx): void;
|
|
28
16
|
}
|
|
29
|
-
//# sourceMappingURL=file-logger.d.ts.map
|