@sowonai/crewx-sdk 0.1.0-dev.15 → 0.1.0-dev.16
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/README.md +28 -0
- package/dist/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/template.types.d.ts +34 -0
- package/dist/types/template.types.js +3 -0
- package/dist/types/template.types.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -987,6 +987,34 @@ Please follow these steps:
|
|
|
987
987
|
|
|
988
988
|
Apache-2.0 License - See [LICENSE](./LICENSE) for details.
|
|
989
989
|
|
|
990
|
+
## Context Integration (WBS-14)
|
|
991
|
+
|
|
992
|
+
The SDK provides `TemplateContext` and `AgentMetadata` exports for dynamic template processing:
|
|
993
|
+
|
|
994
|
+
```typescript
|
|
995
|
+
import { TemplateContext, AgentMetadata } from '@sowonai/crewx-sdk';
|
|
996
|
+
|
|
997
|
+
// Use TemplateContext for dynamic prompts
|
|
998
|
+
const context: TemplateContext = {
|
|
999
|
+
env: process.env,
|
|
1000
|
+
agent: {
|
|
1001
|
+
id: 'claude',
|
|
1002
|
+
name: 'Claude Assistant',
|
|
1003
|
+
provider: 'cli/claude',
|
|
1004
|
+
model: 'claude-3-5-sonnet'
|
|
1005
|
+
},
|
|
1006
|
+
agentMetadata: {
|
|
1007
|
+
specialties: ['code-analysis', 'architecture'],
|
|
1008
|
+
capabilities: ['file-operations', 'web-search'],
|
|
1009
|
+
description: 'Advanced reasoning and analysis specialist'
|
|
1010
|
+
},
|
|
1011
|
+
mode: 'query',
|
|
1012
|
+
platform: 'cli'
|
|
1013
|
+
};
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
For detailed usage, see [Template Variables Guide](../../docs/template-variables.md).
|
|
1017
|
+
|
|
990
1018
|
## Support
|
|
991
1019
|
|
|
992
1020
|
- [GitHub Issues](https://github.com/sowonlabs/crewx/issues)
|
package/dist/index.d.ts
CHANGED
|
@@ -30,3 +30,4 @@ export type { PropSchema, ValidationResult as PropsValidationResult, ValidationE
|
|
|
30
30
|
export { LayoutLoader } from './services/layout-loader.service';
|
|
31
31
|
export { LayoutRenderer, PropsValidationError, type RenderOptions, } from './services/layout-renderer.service';
|
|
32
32
|
export type { RenderContext, LayoutDefinition, ValidationResult, ValidationError, LoaderOptions, LayoutLoadError, InlineLayoutSpec, CustomLayoutDefinition, } from './types/layout.types';
|
|
33
|
+
export type { TemplateContext, AgentMetadata, } from './types/template.types';
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -15,4 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./agent.types"), exports);
|
|
18
|
+
__exportStar(require("./template.types"), exports);
|
|
19
|
+
__exportStar(require("./layout.types"), exports);
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,iDAA+B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface AgentMetadata {
|
|
2
|
+
specialties?: string[];
|
|
3
|
+
capabilities?: string[];
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TemplateContext {
|
|
7
|
+
env?: Record<string, string | undefined>;
|
|
8
|
+
agent?: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
provider: string;
|
|
12
|
+
model?: string;
|
|
13
|
+
workingDirectory?: string;
|
|
14
|
+
};
|
|
15
|
+
agentMetadata?: AgentMetadata;
|
|
16
|
+
mode?: 'query' | 'execute';
|
|
17
|
+
messages?: Array<{
|
|
18
|
+
text: string;
|
|
19
|
+
isAssistant: boolean;
|
|
20
|
+
metadata?: Record<string, any>;
|
|
21
|
+
}>;
|
|
22
|
+
platform?: string;
|
|
23
|
+
tools?: {
|
|
24
|
+
list: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
input_schema: any;
|
|
28
|
+
output_schema?: any;
|
|
29
|
+
}>;
|
|
30
|
+
json: string;
|
|
31
|
+
count: number;
|
|
32
|
+
};
|
|
33
|
+
vars?: Record<string, any>;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.types.js","sourceRoot":"","sources":["../../src/types/template.types.ts"],"names":[],"mappings":""}
|