@sowonai/crewx-sdk 0.1.0-dev.14 → 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 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';
@@ -1 +1,3 @@
1
1
  export * from './agent.types';
2
+ export * from './template.types';
3
+ export * from './layout.types';
@@ -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
@@ -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"}
@@ -54,7 +54,9 @@ export interface RenderContext {
54
54
  name: string;
55
55
  inline: {
56
56
  prompt: string;
57
+ [key: string]: any;
57
58
  };
59
+ [key: string]: any;
58
60
  };
59
61
  documents: Record<string, {
60
62
  content: string;
@@ -63,6 +65,25 @@ export interface RenderContext {
63
65
  }>;
64
66
  vars: Record<string, any>;
65
67
  props: Record<string, any>;
68
+ platform?: string;
69
+ messages?: Array<Record<string, any>>;
70
+ tools?: {
71
+ list?: Array<Record<string, any>>;
72
+ json?: string;
73
+ count?: number;
74
+ [key: string]: any;
75
+ } | null;
76
+ session?: {
77
+ mode?: string;
78
+ platform?: string;
79
+ options?: string[];
80
+ env?: Record<string, any>;
81
+ vars?: Record<string, any>;
82
+ tools?: any;
83
+ [key: string]: any;
84
+ };
85
+ env?: Record<string, any>;
86
+ context?: Record<string, any>;
66
87
  }
67
88
  export interface RawLayoutYaml {
68
89
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../src/types/layout.types.ts"],"names":[],"mappings":";;;AAgIA,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe,EAAkB,QAAiB,EAAkB,KAAa;QAC3F,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,aAAQ,GAAR,QAAQ,CAAS;QAAkB,UAAK,GAAL,KAAK,CAAQ;QAE3F,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAKD,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YACE,OAAe,EACC,SAA4B,EAAE,EAC9B,KAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,WAAM,GAAN,MAAM,CAAwB;QAC9B,UAAK,GAAL,KAAK,CAAQ;QAG7B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AATD,oDASC"}
1
+ {"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../src/types/layout.types.ts"],"names":[],"mappings":";;;AAqJA,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe,EAAkB,QAAiB,EAAkB,KAAa;QAC3F,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,aAAQ,GAAR,QAAQ,CAAS;QAAkB,UAAK,GAAL,KAAK,CAAQ;QAE3F,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAKD,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YACE,OAAe,EACC,SAA4B,EAAE,EAC9B,KAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,WAAM,GAAN,MAAM,CAAwB;QAC9B,UAAK,GAAL,KAAK,CAAQ;QAG7B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AATD,oDASC"}
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=template.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.types.js","sourceRoot":"","sources":["../../src/types/template.types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sowonai/crewx-sdk",
3
- "version": "0.1.0-dev.14",
3
+ "version": "0.1.0-dev.16",
4
4
  "license": "Apache-2.0",
5
5
  "description": "SowonAI CrewX SDK",
6
6
  "type": "commonjs",