veryfront 0.1.810 → 0.1.811
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/esm/deno.d.ts +3 -0
- package/esm/deno.js +5 -2
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +18 -6
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.js +1 -0
- package/esm/src/agent/types.d.ts +8 -0
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.d.ts +12 -0
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +12 -0
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +6 -1
- package/esm/src/discovery/handlers/index.d.ts +1 -0
- package/esm/src/discovery/handlers/index.d.ts.map +1 -1
- package/esm/src/discovery/handlers/index.js +1 -0
- package/esm/src/discovery/handlers/work-handler.d.ts +7 -0
- package/esm/src/discovery/handlers/work-handler.d.ts.map +1 -0
- package/esm/src/discovery/handlers/work-handler.js +19 -0
- package/esm/src/discovery/import-rewriter.d.ts +1 -1
- package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.js +1 -0
- package/esm/src/discovery/project-discovery-config.d.ts +2 -0
- package/esm/src/discovery/project-discovery-config.d.ts.map +1 -1
- package/esm/src/discovery/project-discovery-config.js +2 -0
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +2 -0
- package/esm/src/discovery/types.d.ts +3 -0
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/observability/request-profiler.d.ts +1 -0
- package/esm/src/observability/request-profiler.d.ts.map +1 -1
- package/esm/src/observability/request-profiler.js +6 -0
- package/esm/src/rendering/cache/cache-coordinator.d.ts +3 -0
- package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-coordinator.js +26 -2
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +3 -1
- package/esm/src/rendering/shared/context-aware-cache.d.ts +3 -0
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +24 -2
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +4 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/work/factory.d.ts +4 -0
- package/esm/src/work/factory.d.ts.map +1 -0
- package/esm/src/work/factory.js +51 -0
- package/esm/src/work/index.d.ts +27 -0
- package/esm/src/work/index.d.ts.map +1 -0
- package/esm/src/work/index.js +25 -0
- package/esm/src/work/prompt-augmentation.d.ts +6 -0
- package/esm/src/work/prompt-augmentation.d.ts.map +1 -0
- package/esm/src/work/prompt-augmentation.js +30 -0
- package/esm/src/work/registry.d.ts +10 -0
- package/esm/src/work/registry.d.ts.map +1 -0
- package/esm/src/work/registry.js +23 -0
- package/esm/src/work/types.d.ts +30 -0
- package/esm/src/work/types.d.ts.map +1 -0
- package/esm/src/work/types.js +1 -0
- package/package.json +5 -1
package/esm/deno.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare namespace _default {
|
|
|
31
31
|
"./workflow/claude-code": string;
|
|
32
32
|
"./workflow/claude-code/react": string;
|
|
33
33
|
"./workflow/discovery": string;
|
|
34
|
+
"./work": string;
|
|
34
35
|
"./schemas": string;
|
|
35
36
|
"./prompt": string;
|
|
36
37
|
"./resource": string;
|
|
@@ -100,6 +101,7 @@ declare namespace _default {
|
|
|
100
101
|
"veryfront/workflow/claude-code": string;
|
|
101
102
|
"veryfront/workflow/claude-code/react": string;
|
|
102
103
|
"veryfront/workflow/discovery": string;
|
|
104
|
+
"veryfront/work": string;
|
|
103
105
|
"veryfront/utils": string;
|
|
104
106
|
"veryfront/utils/box": string;
|
|
105
107
|
"veryfront/utils/case-utils": string;
|
|
@@ -203,6 +205,7 @@ declare namespace _default {
|
|
|
203
205
|
"#veryfront/workflow/claude-code": string;
|
|
204
206
|
"#veryfront/workflow/claude-code/react": string;
|
|
205
207
|
"#veryfront/workflow/discovery": string;
|
|
208
|
+
"#veryfront/work": string;
|
|
206
209
|
"#veryfront/schemas": string;
|
|
207
210
|
"#veryfront/http/responses": string;
|
|
208
211
|
"#veryfront/compat/console": string;
|
package/esm/deno.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.811",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"nodeModulesDir": "auto",
|
|
6
6
|
"minimumDependencyAge": {
|
|
@@ -86,6 +86,7 @@ export default {
|
|
|
86
86
|
"./workflow/claude-code": "./src/workflow/claude-code/index.ts",
|
|
87
87
|
"./workflow/claude-code/react": "./src/workflow/claude-code/react/index.ts",
|
|
88
88
|
"./workflow/discovery": "./src/workflow/discovery/index.ts",
|
|
89
|
+
"./work": "./src/work/index.ts",
|
|
89
90
|
"./schemas": "./src/schemas/index.ts",
|
|
90
91
|
"./prompt": "./src/prompt/index.ts",
|
|
91
92
|
"./resource": "./src/resource/index.ts",
|
|
@@ -155,6 +156,7 @@ export default {
|
|
|
155
156
|
"veryfront/workflow/claude-code": "./src/workflow/claude-code/index.ts",
|
|
156
157
|
"veryfront/workflow/claude-code/react": "./src/workflow/claude-code/react/index.ts",
|
|
157
158
|
"veryfront/workflow/discovery": "./src/workflow/discovery/index.ts",
|
|
159
|
+
"veryfront/work": "./src/work/index.ts",
|
|
158
160
|
"veryfront/utils": "./src/utils/index.ts",
|
|
159
161
|
"veryfront/utils/box": "./src/utils/box.ts",
|
|
160
162
|
"veryfront/utils/case-utils": "./src/utils/case-utils.ts",
|
|
@@ -258,6 +260,7 @@ export default {
|
|
|
258
260
|
"#veryfront/workflow/claude-code": "./src/workflow/claude-code/index.ts",
|
|
259
261
|
"#veryfront/workflow/claude-code/react": "./src/workflow/claude-code/react/index.ts",
|
|
260
262
|
"#veryfront/workflow/discovery": "./src/workflow/discovery/index.ts",
|
|
263
|
+
"#veryfront/work": "./src/work/index.ts",
|
|
261
264
|
"#veryfront/schemas": "./src/schemas/index.ts",
|
|
262
265
|
"#veryfront/http/responses": "./src/platform/compat/http/responses.ts",
|
|
263
266
|
"#veryfront/compat/console": "./src/platform/compat/console/index.ts",
|
|
@@ -368,7 +371,7 @@ export default {
|
|
|
368
371
|
"lint": "DENO_NO_PACKAGE_JSON=1 deno lint src/ cli/ react/ && deno lint --config=scripts/test.deno.json scripts/test/ scripts/build/npm-package-metadata.test.ts",
|
|
369
372
|
"fmt": "deno fmt src/ cli/ react/ && deno fmt --config=scripts/test.deno.json scripts/test/",
|
|
370
373
|
"fmt:check": "deno fmt --check src/ cli/ react/ && deno fmt --check --config=scripts/test.deno.json scripts/test/",
|
|
371
|
-
"typecheck": "deno task generate:manifests:check && deno check src/index.ts cli/main.ts src/server/index.ts src/routing/api/index.ts src/rendering/index.ts src/platform/index.ts src/platform/adapters/index.ts src/build/index.ts src/build/production-build/index.ts src/transforms/index.ts src/config/index.ts src/utils/index.ts src/data/index.ts src/security/index.ts src/middleware/index.ts src/server/handlers/dev/index.ts src/server/handlers/request/api/index.ts src/rendering/cache/index.ts src/rendering/cache/stores/index.ts src/rendering/rsc/actions/index.ts src/html/index.ts src/modules/index.ts src/proxy/main.ts src/chat/index.ts src/markdown/index.ts src/mdx/index.ts src/fs/index.ts src/oauth/index.ts src/agent/index.ts src/agent/service/route-export.check.ts src/tool/index.ts src/workflow/index.ts src/prompt/index.ts src/resource/index.ts src/runs/index.ts src/mcp/index.ts src/provider/index.ts",
|
|
374
|
+
"typecheck": "deno task generate:manifests:check && deno check src/index.ts cli/main.ts src/server/index.ts src/routing/api/index.ts src/rendering/index.ts src/platform/index.ts src/platform/adapters/index.ts src/build/index.ts src/build/production-build/index.ts src/transforms/index.ts src/config/index.ts src/utils/index.ts src/data/index.ts src/security/index.ts src/middleware/index.ts src/server/handlers/dev/index.ts src/server/handlers/request/api/index.ts src/rendering/cache/index.ts src/rendering/cache/stores/index.ts src/rendering/rsc/actions/index.ts src/html/index.ts src/modules/index.ts src/proxy/main.ts src/chat/index.ts src/markdown/index.ts src/mdx/index.ts src/fs/index.ts src/oauth/index.ts src/agent/index.ts src/agent/service/route-export.check.ts src/tool/index.ts src/workflow/index.ts src/work/index.ts src/prompt/index.ts src/resource/index.ts src/runs/index.ts src/mcp/index.ts src/provider/index.ts",
|
|
372
375
|
"verify": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck && deno task test && deno task test:e2e:binary",
|
|
373
376
|
"verify:quick": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck",
|
|
374
377
|
"docs": "deno run --allow-read --allow-write --allow-run --allow-env scripts/docs/generate-api-reference.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/agent/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,eAAe,EAKhB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/agent/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,eAAe,EAKhB,MAAM,YAAY,CAAC;AAoDpB,oBAAoB;AACpB,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CA6NhD;AAcD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC,GACnD,eAAe,EAAE,CAanB"}
|
package/esm/src/agent/factory.js
CHANGED
|
@@ -6,6 +6,7 @@ import { registerTool } from "../mcp/index.js";
|
|
|
6
6
|
import { toolRegistry } from "../tool/index.js";
|
|
7
7
|
import { skillRegistry } from "../skill/registry.js";
|
|
8
8
|
import { buildSkillManifestPrompt } from "../skill/prompt-augmentation.js";
|
|
9
|
+
import { buildWorkManifestPrompt, resolveWorkReferences, } from "../work/prompt-augmentation.js";
|
|
9
10
|
import { createExecuteSkillScriptTool, createLoadSkillReferenceTool, createLoadSkillTool, } from "../skill/tools.js";
|
|
10
11
|
import { agentRegistry } from "./composition/index.js";
|
|
11
12
|
import { agentLogger } from "../utils/logger/logger.js";
|
|
@@ -81,23 +82,34 @@ export function agent(config) {
|
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
// System prompt augmentation with skill manifest.
|
|
85
|
-
// Re-resolve
|
|
85
|
+
// System prompt augmentation with Work context and skill manifest.
|
|
86
|
+
// Re-resolve registry-backed entries at invocation time so HMR changes are picked up.
|
|
86
87
|
const originalSystem = config.system;
|
|
88
|
+
const workAugmentedSystem = config.work
|
|
89
|
+
? async () => {
|
|
90
|
+
const basePrompt = typeof originalSystem === "function"
|
|
91
|
+
? await originalSystem()
|
|
92
|
+
: originalSystem;
|
|
93
|
+
const workPrompt = buildWorkManifestPrompt(resolveWorkReferences(config.work));
|
|
94
|
+
if (!workPrompt)
|
|
95
|
+
return basePrompt ?? "You are a helpful assistant.";
|
|
96
|
+
return `${basePrompt ?? "You are a helpful assistant."}\n\n${workPrompt}`;
|
|
97
|
+
}
|
|
98
|
+
: originalSystem;
|
|
87
99
|
const augmentedSystem = config.skills
|
|
88
100
|
? async () => {
|
|
89
101
|
// Owner-aware: the manifest only ever advertises skills visible to this
|
|
90
102
|
// agent (unowned project skills plus its own), matching skill-tool
|
|
91
103
|
// enforcement at execution time.
|
|
92
104
|
const currentSkills = skillRegistry.resolveForAgent(config.skills, { agentId: id });
|
|
93
|
-
const basePrompt = typeof
|
|
94
|
-
? await
|
|
95
|
-
:
|
|
105
|
+
const basePrompt = typeof workAugmentedSystem === "function"
|
|
106
|
+
? await workAugmentedSystem()
|
|
107
|
+
: workAugmentedSystem;
|
|
96
108
|
if (!currentSkills.size)
|
|
97
109
|
return basePrompt ?? "You are a helpful assistant.";
|
|
98
110
|
return `${basePrompt}\n\n${buildSkillManifestPrompt(currentSkills)}`;
|
|
99
111
|
}
|
|
100
|
-
:
|
|
112
|
+
: workAugmentedSystem;
|
|
101
113
|
const resolvedMiddleware = resolveSecurityMiddleware(config);
|
|
102
114
|
const platform = detectPlatform();
|
|
103
115
|
const compatibility = validatePlatformCompatibility({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veryfront-cloud-agent-service.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/veryfront-cloud-agent-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAiB9E,OAAO,EAGL,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAE,KAAK,mBAAmB,EAAE,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BAAsB,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,WAAW,CAAC,EAAE,yCAAyC,CAAC;IACxD;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,uCAAuC,EAAE,CAAC;IAChE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,+BAA+B,CAAC,gBAAgB,CAAC,CAAC;IACnE,GAAG,CAAC,EAAE,kDAAkD,CAAC,KAAK,CAAC,CAAC;IAChE,aAAa,CAAC,EAAE,2CAA2C,CAAC;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,OAAO,EAAE,CAAC;CACrC,CAAC;AAEF,yDAAyD;AACzD,MAAM,MAAM,iCAAiC,GAAG,qCAAqC,CAAC;AACtF,yCAAyC;AACzC,MAAM,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AASxE,qFAAqF;AACrF,MAAM,MAAM,+CAA+C,GAAG,2BAA2B,GAAG;IAC1F,MAAM,EAAE,yBAAyB,CAAC;IAClC,KAAK,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAClD,cAAc,EAAE,gCAAgC,CAAC;CAClD,CAAC;AACF,gEAAgE;AAChE,MAAM,MAAM,6BAA6B,GAAG,+CAA+C,CAAC;AAC5F,4DAA4D;AAC5D,MAAM,MAAM,yBAAyB,GAAG,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"veryfront-cloud-agent-service.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/veryfront-cloud-agent-service.ts"],"names":[],"mappings":"AAGA,OAAO,KA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,CAAC,UAAU,CAAC,CAAC;IAClD,cAAc,EAAE,gCAAgC,CAAC;CAClD,CAAC;AACF,gEAAgE;AAChE,MAAM,MAAM,6BAA6B,GAAG,+CAA+C,CAAC;AAC5F,4DAA4D;AAC5D,MAAM,MAAM,yBAAyB,GAAG,2CAA2C,CAAC;AA8XpF,wBAAgB,sBAAsB,CAAC,KAAK,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAYhF;AAqcD,yDAAyD;AACzD,wBAAsB,2CAA2C,CAC/D,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,yBAAyB,CAAC,+CAA+C,CAAC,CAAC,CAKrF;AAED,iDAAiD;AACjD,wBAAsB,mCAAmC,CACvD,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,2BAA2B,CAAC,+CAA+C,CAAC,CAAC,CAgBvF;AAED,4BAA4B;AAC5B,wBAAsB,iBAAiB,CACrC,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,IAAI,CAAC,CAiDf"}
|
|
@@ -76,6 +76,7 @@ function hasDiscoveryRoot(baseDir) {
|
|
|
76
76
|
...DEFAULT_PROJECT_DISCOVERY_DIRS.resourceDirs,
|
|
77
77
|
...DEFAULT_PROJECT_DISCOVERY_DIRS.promptDirs,
|
|
78
78
|
...DEFAULT_PROJECT_DISCOVERY_DIRS.workflowDirs,
|
|
79
|
+
...DEFAULT_PROJECT_DISCOVERY_DIRS.workDirs,
|
|
79
80
|
...DEFAULT_PROJECT_DISCOVERY_DIRS.taskDirs,
|
|
80
81
|
];
|
|
81
82
|
return discoveryDirs.some((dir) => existsSync(resolve(baseDir, dir))) ||
|
package/esm/src/agent/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
**************************/
|
|
4
4
|
import type { ModelRuntime } from "../provider/types.js";
|
|
5
5
|
import type { Tool, ToolExecutionContext } from "../tool/index.js";
|
|
6
|
+
import type { WorkReference } from "../work/index.js";
|
|
6
7
|
import type { Memory } from "./memory/memory-interface.js";
|
|
7
8
|
export type { AgentContext, AgentResponse, AgentStatus, EdgeConfig, MemoryConfig, Message, MessagePart, ModelProvider, StreamToolCall, ToolCall, ToolCallPart, ToolCallPartWithArgs, ToolCallPartWithInput, ToolResultPart, } from "./schemas/index.js";
|
|
8
9
|
import type { Message, MessagePart, ToolCall, ToolCallPart, ToolCallPartWithArgs, ToolCallPartWithInput } from "./schemas/index.js";
|
|
@@ -160,6 +161,13 @@ export interface AgentConfig {
|
|
|
160
161
|
* and registers the skill tools.
|
|
161
162
|
*/
|
|
162
163
|
skills?: true | string[];
|
|
164
|
+
/**
|
|
165
|
+
* Business process definitions this agent is expected to observe and update.
|
|
166
|
+
*
|
|
167
|
+
* Work is outcome/state context, not workflow control flow. Use source
|
|
168
|
+
* declarations from work/ and persist executions through Work tools.
|
|
169
|
+
*/
|
|
170
|
+
work?: WorkReference | WorkReference[];
|
|
163
171
|
suggestions?: Suggestions;
|
|
164
172
|
/** Set to false to disable the default security middleware */
|
|
165
173
|
security?: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/agent/types.ts"],"names":[],"mappings":"AAAA;;4BAE4B;AAE5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/agent/types.ts"],"names":[],"mappings":"AAAA;;4BAE4B;AAE5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,M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,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;QAC7C,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE/B,mFAAmF;IACnF,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE7C,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAE7B,cAAc,IAAI,OAAO,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IAEH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B"}
|
|
@@ -301,6 +301,12 @@ export declare const getVeryfrontConfigSchema: () => import("../../internal-agen
|
|
|
301
301
|
paths: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
|
|
302
302
|
}>> | undefined>;
|
|
303
303
|
}>> | undefined>;
|
|
304
|
+
work: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
305
|
+
discovery: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
306
|
+
enabled: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
307
|
+
paths: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
|
|
308
|
+
}>> | undefined>;
|
|
309
|
+
}>> | undefined>;
|
|
304
310
|
tasks: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
305
311
|
discovery: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
306
312
|
enabled: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
@@ -699,6 +705,12 @@ export declare const veryfrontConfigSchema: import("../../internal-agents/schema
|
|
|
699
705
|
paths: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
|
|
700
706
|
}>> | undefined>;
|
|
701
707
|
}>> | undefined>;
|
|
708
|
+
work: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
709
|
+
discovery: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
710
|
+
enabled: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
711
|
+
paths: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
|
|
712
|
+
}>> | undefined>;
|
|
713
|
+
}>> | undefined>;
|
|
702
714
|
tasks: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
703
715
|
discovery: import("../../internal-agents/schema.js").Schema<Partial<import("../../extensions/schema/schema-validator.js").InferShape<{
|
|
704
716
|
enabled: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.schema.d.ts","sourceRoot":"","sources":["../../../../src/src/config/schemas/config.schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAiChF,eAAO,MAAM,wBAAwB;;;;;QAQ3B,2GAA2G;;;;;;;;;;;;;;;IAuB/G,wFAAwF;;IAExF,0FAA0F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAyCtF;;;;;;;;;;;;;;;;;WAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgDH;;;;;;;;;;WAUG;;;;;;;;;;QAaH;;;;;WAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4HC,kFAAkF;;YAElF,oFAAoF;;YAEpF,+EAA+E;;YAE/E,m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;IAWnB,CAAC;AAG1E,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC;AAG3F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CA0BvE;AAqCD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAEhF"}
|
|
@@ -455,6 +455,18 @@ export const getVeryfrontConfigSchema = defineSchema((v) => v
|
|
|
455
455
|
})
|
|
456
456
|
.partial()
|
|
457
457
|
.optional(),
|
|
458
|
+
work: v
|
|
459
|
+
.object({
|
|
460
|
+
discovery: v
|
|
461
|
+
.object({
|
|
462
|
+
enabled: v.boolean().optional(),
|
|
463
|
+
paths: v.array(v.string()).optional(),
|
|
464
|
+
})
|
|
465
|
+
.partial()
|
|
466
|
+
.optional(),
|
|
467
|
+
})
|
|
468
|
+
.partial()
|
|
469
|
+
.optional(),
|
|
458
470
|
tasks: v
|
|
459
471
|
.object({
|
|
460
472
|
discovery: v
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-engine.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/discovery-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EAEhB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery-engine.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/discovery-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EAEhB,MAAM,YAAY,CAAC;AAuIpB;;GAEG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAqFnF"}
|
|
@@ -10,7 +10,7 @@ import { ensureError } from "../errors/veryfront-error.js";
|
|
|
10
10
|
import { registerSkill, skillRegistry } from "../skill/registry.js";
|
|
11
11
|
import { importModule } from "./transpiler.js";
|
|
12
12
|
import { findTypeScriptFiles } from "./file-discovery.js";
|
|
13
|
-
import { agentHandler, discoverSkills, promptHandler, resourceHandler, taskHandler, toolHandler, workflowHandler, } from "./handlers/index.js";
|
|
13
|
+
import { agentHandler, discoverSkills, promptHandler, resourceHandler, taskHandler, toolHandler, workflowHandler, workHandler, } from "./handlers/index.js";
|
|
14
14
|
import { discoverRuntimeAgentMarkdownDefinitions } from "./handlers/runtime-agent-markdown-handler.js";
|
|
15
15
|
import { filenameToId } from "./discovery-utils.js";
|
|
16
16
|
import { join } from "../platform/compat/path/index.js";
|
|
@@ -113,6 +113,7 @@ export async function discoverAll(config) {
|
|
|
113
113
|
resources: new Map(),
|
|
114
114
|
prompts: new Map(),
|
|
115
115
|
workflows: new Map(),
|
|
116
|
+
works: new Map(),
|
|
116
117
|
tasks: new Map(),
|
|
117
118
|
errors: [],
|
|
118
119
|
};
|
|
@@ -156,6 +157,10 @@ export async function discoverAll(config) {
|
|
|
156
157
|
for (const dir of config.workflowDirs ?? ["workflows"]) {
|
|
157
158
|
await discoverItems(`${baseDir}/${dir}`, result, context, workflowHandler, config.verbose);
|
|
158
159
|
}
|
|
160
|
+
// Discover Work definitions
|
|
161
|
+
for (const dir of config.workDirs ?? ["work"]) {
|
|
162
|
+
await discoverItems(`${baseDir}/${dir}`, result, context, workHandler, config.verbose);
|
|
163
|
+
}
|
|
159
164
|
// Discover tasks
|
|
160
165
|
for (const dir of config.taskDirs ?? ["tasks"]) {
|
|
161
166
|
await discoverItems(`${baseDir}/${dir}`, result, context, taskHandler, config.verbose);
|
|
@@ -8,6 +8,7 @@ export { agentHandler } from "./agent-handler.js";
|
|
|
8
8
|
export { resourceHandler } from "./resource-handler.js";
|
|
9
9
|
export { promptHandler } from "./prompt-handler.js";
|
|
10
10
|
export { workflowHandler } from "./workflow-handler.js";
|
|
11
|
+
export { workHandler } from "./work-handler.js";
|
|
11
12
|
export { taskHandler } from "./task-handler.js";
|
|
12
13
|
export { discoverSkills } from "./skill-handler.js";
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/discovery/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/discovery/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -8,5 +8,6 @@ export { agentHandler } from "./agent-handler.js";
|
|
|
8
8
|
export { resourceHandler } from "./resource-handler.js";
|
|
9
9
|
export { promptHandler } from "./prompt-handler.js";
|
|
10
10
|
export { workflowHandler } from "./workflow-handler.js";
|
|
11
|
+
export { workHandler } from "./work-handler.js";
|
|
11
12
|
export { taskHandler } from "./task-handler.js";
|
|
12
13
|
export { discoverSkills } from "./skill-handler.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-handler.d.ts","sourceRoot":"","sources":["../../../../src/src/discovery/handlers/work-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,cAAc,CAexD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Discovery Handler
|
|
3
|
+
*/
|
|
4
|
+
import { workRegistry } from "../../work/index.js";
|
|
5
|
+
export const workHandler = {
|
|
6
|
+
typeName: "work",
|
|
7
|
+
validate: (item) => item !== null &&
|
|
8
|
+
typeof item === "object" &&
|
|
9
|
+
typeof item.id === "string" &&
|
|
10
|
+
typeof item.outcome === "string" &&
|
|
11
|
+
Array.isArray(item.acceptanceCriteria),
|
|
12
|
+
getId: (definition) => definition.id,
|
|
13
|
+
register: (id, definition) => {
|
|
14
|
+
const definitionWithId = definition.id === id ? definition : { ...definition, id };
|
|
15
|
+
workRegistry.register(id, definitionWithId);
|
|
16
|
+
return definitionWithId;
|
|
17
|
+
},
|
|
18
|
+
getResultMap: (result) => result.works,
|
|
19
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* (Deno, Node.js) and handles veryfront package resolution.
|
|
6
6
|
*/
|
|
7
7
|
import { createFileSystem } from "../platform/compat/fs.js";
|
|
8
|
-
export declare const DISCOVERY_GLOBAL_VERYFRONT_MODULES: readonly ["veryfront/agent", "veryfront/tool", "veryfront/platform", "veryfront/prompt", "veryfront/resource", "veryfront/embedding", "veryfront/workflow", "veryfront/schemas"];
|
|
8
|
+
export declare const DISCOVERY_GLOBAL_VERYFRONT_MODULES: readonly ["veryfront/agent", "veryfront/tool", "veryfront/platform", "veryfront/prompt", "veryfront/resource", "veryfront/embedding", "veryfront/workflow", "veryfront/work", "veryfront/schemas"];
|
|
9
9
|
interface DenoRewriteOptions {
|
|
10
10
|
compiled?: boolean;
|
|
11
11
|
resolveSpecifier?: (specifier: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/import-rewriter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,eAAO,MAAM,kCAAkC,
|
|
1
|
+
{"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/import-rewriter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,eAAO,MAAM,kCAAkC,oMAUrC,CAAC;AAEX,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAkHD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CA2BR;AAqFD;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,EACvC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CA2PjB"}
|
|
@@ -8,6 +8,7 @@ export declare const DEFAULT_PROJECT_DISCOVERY_DIRS: {
|
|
|
8
8
|
resourceDirs: string[];
|
|
9
9
|
promptDirs: string[];
|
|
10
10
|
workflowDirs: string[];
|
|
11
|
+
workDirs: string[];
|
|
11
12
|
taskDirs: string[];
|
|
12
13
|
};
|
|
13
14
|
type ProjectDiscoveryConfigInput = {
|
|
@@ -23,6 +24,7 @@ export type ProjectDiscoveryConfig = DiscoveryConfig & {
|
|
|
23
24
|
resourceDirs: string[];
|
|
24
25
|
promptDirs: string[];
|
|
25
26
|
workflowDirs: string[];
|
|
27
|
+
workDirs: string[];
|
|
26
28
|
taskDirs: string[];
|
|
27
29
|
};
|
|
28
30
|
export declare function createProjectDiscoveryConfig(input: ProjectDiscoveryConfigInput): ProjectDiscoveryConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-discovery-config.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/project-discovery-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"project-discovery-config.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/project-discovery-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,eAAO,MAAM,8BAA8B;;;;;;;;;CAS1C,CAAC;AAOF,KAAK,2BAA2B,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG;IACrD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAgBF,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,2BAA2B,GACjC,sBAAsB,CAwCxB"}
|
|
@@ -5,6 +5,7 @@ export const DEFAULT_PROJECT_DISCOVERY_DIRS = {
|
|
|
5
5
|
resourceDirs: ["resources"],
|
|
6
6
|
promptDirs: ["prompts"],
|
|
7
7
|
workflowDirs: ["workflows"],
|
|
8
|
+
workDirs: ["work"],
|
|
8
9
|
taskDirs: ["tasks"],
|
|
9
10
|
};
|
|
10
11
|
function isDiscoveryEnabled(discovery) {
|
|
@@ -26,6 +27,7 @@ export function createProjectDiscoveryConfig(input) {
|
|
|
26
27
|
resourceDirs: resolveDiscoveryPaths(aiConfig?.resources?.discovery, DEFAULT_PROJECT_DISCOVERY_DIRS.resourceDirs),
|
|
27
28
|
promptDirs: resolveDiscoveryPaths(aiConfig?.prompts?.discovery, DEFAULT_PROJECT_DISCOVERY_DIRS.promptDirs),
|
|
28
29
|
workflowDirs: resolveDiscoveryPaths(aiConfig?.workflows?.discovery, DEFAULT_PROJECT_DISCOVERY_DIRS.workflowDirs),
|
|
30
|
+
workDirs: resolveDiscoveryPaths(aiConfig?.work?.discovery, DEFAULT_PROJECT_DISCOVERY_DIRS.workDirs),
|
|
29
31
|
taskDirs: resolveDiscoveryPaths(aiConfig?.tasks?.discovery, DEFAULT_PROJECT_DISCOVERY_DIRS.taskDirs),
|
|
30
32
|
fsAdapter: input.fsAdapter,
|
|
31
33
|
verbose: input.verbose ?? false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transpiler.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/transpiler.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"transpiler.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/transpiler.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAqIvD;;GAEG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAkGlB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
|
|
@@ -20,6 +20,7 @@ import * as promptMod from "../prompt/index.js";
|
|
|
20
20
|
import * as resourceMod from "../resource/index.js";
|
|
21
21
|
import * as embeddingMod from "../embedding/index.js";
|
|
22
22
|
import * as workflowMod from "../workflow/index.js";
|
|
23
|
+
import * as workMod from "../work/index.js";
|
|
23
24
|
import * as schemasMod from "../schemas/index.js";
|
|
24
25
|
const transpileCache = new Map();
|
|
25
26
|
// Setup veryfront modules as globals for compiled binary support
|
|
@@ -38,6 +39,7 @@ async function ensureVeryfrontGlobals() {
|
|
|
38
39
|
"veryfront/resource": resourceMod,
|
|
39
40
|
"veryfront/embedding": embeddingMod,
|
|
40
41
|
"veryfront/workflow": workflowMod,
|
|
42
|
+
"veryfront/work": workMod,
|
|
41
43
|
"veryfront/schemas": schemasMod,
|
|
42
44
|
};
|
|
43
45
|
dntShim.dntGlobalThis.__VERYFRONT_MODULES__ = modules;
|
|
@@ -8,6 +8,7 @@ import type { Prompt } from "../prompt/types.js";
|
|
|
8
8
|
import type { Resource } from "../resource/types.js";
|
|
9
9
|
import type { Skill } from "../skill/types.js";
|
|
10
10
|
import type { Tool } from "../tool/types.js";
|
|
11
|
+
import type { WorkDefinition } from "../work/index.js";
|
|
11
12
|
import type { Workflow } from "../workflow/types.js";
|
|
12
13
|
import type { TaskDefinition } from "../task/types.js";
|
|
13
14
|
import type { Platform } from "../platform/core-platform.js";
|
|
@@ -35,6 +36,7 @@ export interface DiscoveryConfig {
|
|
|
35
36
|
resourceDirs?: string[];
|
|
36
37
|
promptDirs?: string[];
|
|
37
38
|
workflowDirs?: string[];
|
|
39
|
+
workDirs?: string[];
|
|
38
40
|
taskDirs?: string[];
|
|
39
41
|
verbose?: boolean;
|
|
40
42
|
fsAdapter?: FileSystemAdapter;
|
|
@@ -49,6 +51,7 @@ export interface DiscoveryResult {
|
|
|
49
51
|
resources: Map<string, Resource>;
|
|
50
52
|
prompts: Map<string, Prompt>;
|
|
51
53
|
workflows: Map<string, Workflow>;
|
|
54
|
+
works: Map<string, WorkDefinition>;
|
|
52
55
|
tasks: Map<string, TaskDefinition>;
|
|
53
56
|
errors: Array<{
|
|
54
57
|
file: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBA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AC;IAC7B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACnC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACnC,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC;IACvC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACtD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC,CAAC;IAChE,YAAY,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAC3D"}
|
|
@@ -24,6 +24,7 @@ export declare function runWithRequestProfiling<T>(options: {
|
|
|
24
24
|
requestMode?: string;
|
|
25
25
|
}, fn: () => Promise<T>): Promise<T>;
|
|
26
26
|
export declare function profilePhase<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
27
|
+
export declare function markRequestProfilePhase(name: string, durationMs?: number): void;
|
|
27
28
|
export declare function profileSyncPhase<T>(name: string, fn: () => T): T;
|
|
28
29
|
export declare function updateRequestProfileContext(update: RequestProfileContextUpdate): void;
|
|
29
30
|
export declare function finalizeRequestProfiling(status?: number): RequestProfileRecord | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-profiler.d.ts","source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AAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,EACD,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAYZ;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAWpF;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,SAAI,GAAG,IAAI,CAK1E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAWhE;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,2BAA2B,GAAG,IAAI,CAMrF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAsBrF;AAUD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAQ5E;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAClC,QAAQ,CAiBV;AAED,wBAAgB,uBAAuB,IAAI;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC,CAMA;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C"}
|
|
@@ -55,6 +55,12 @@ export async function profilePhase(name, fn) {
|
|
|
55
55
|
session.phases.set(name, roundMs((session.phases.get(name) ?? 0) + duration));
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
export function markRequestProfilePhase(name, durationMs = 0) {
|
|
59
|
+
const session = storage.getStore();
|
|
60
|
+
if (!session)
|
|
61
|
+
return;
|
|
62
|
+
session.phases.set(name, roundMs((session.phases.get(name) ?? 0) + durationMs));
|
|
63
|
+
}
|
|
58
64
|
export function profileSyncPhase(name, fn) {
|
|
59
65
|
const session = storage.getStore();
|
|
60
66
|
if (!session)
|
|
@@ -23,11 +23,14 @@ export interface CacheCoordinatorOptions {
|
|
|
23
23
|
*/
|
|
24
24
|
contentSourceId?: string;
|
|
25
25
|
}
|
|
26
|
+
export type CacheLookupStatus = "hit" | "miss" | "expired";
|
|
26
27
|
export interface CacheLookupResult {
|
|
27
28
|
cachedResult?: RenderResult;
|
|
28
29
|
depAwareSlug: string;
|
|
29
30
|
moduleCacheKey: string;
|
|
30
31
|
cachedModule?: RenderResult["pageModule"];
|
|
32
|
+
cacheStatus: CacheLookupStatus;
|
|
33
|
+
lookupDurationMs: number;
|
|
31
34
|
}
|
|
32
35
|
export declare class CacheCoordinator {
|
|
33
36
|
private store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-coordinator.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/cache/cache-coordinator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"cache-coordinator.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/cache/cache-coordinator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAQnF,MAAM,WAAW,uBAAuB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IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAShC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,aAAa;CAkBtB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { rendererLogger as logger } from "../../utils/index.js";
|
|
2
2
|
import { MemoryCacheStore } from "./stores/index.js";
|
|
3
3
|
import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
4
|
+
import { markRequestProfilePhase } from "../../observability/request-profiler.js";
|
|
5
|
+
import { metrics } from "../../observability/simple-metrics/index.js";
|
|
4
6
|
/** Default TTL for cache entries (5 minutes) */
|
|
5
7
|
const DEFAULT_CACHE_TTL_MS = 5 * 60 * 1_000;
|
|
6
8
|
export class CacheCoordinator {
|
|
@@ -41,19 +43,33 @@ export class CacheCoordinator {
|
|
|
41
43
|
checkCache(slug, cacheKey) {
|
|
42
44
|
const key = this.buildCacheKey(slug, cacheKey);
|
|
43
45
|
return withSpan("cache.checkCache", async () => {
|
|
46
|
+
const lookupStart = performance.now();
|
|
44
47
|
const cached = await this.store.get(key);
|
|
45
48
|
if (!cached) {
|
|
46
|
-
|
|
49
|
+
const lookupDurationMs = roundDurationMs(performance.now() - lookupStart);
|
|
50
|
+
recordCacheLookup("miss", lookupDurationMs);
|
|
51
|
+
return { depAwareSlug: slug, moduleCacheKey: key, cacheStatus: "miss", lookupDurationMs };
|
|
47
52
|
}
|
|
48
53
|
if (this.isExpired(cached)) {
|
|
49
54
|
await this.store.delete(key);
|
|
50
|
-
|
|
55
|
+
const lookupDurationMs = roundDurationMs(performance.now() - lookupStart);
|
|
56
|
+
recordCacheLookup("expired", lookupDurationMs);
|
|
57
|
+
return {
|
|
58
|
+
depAwareSlug: slug,
|
|
59
|
+
moduleCacheKey: key,
|
|
60
|
+
cacheStatus: "expired",
|
|
61
|
+
lookupDurationMs,
|
|
62
|
+
};
|
|
51
63
|
}
|
|
64
|
+
const lookupDurationMs = roundDurationMs(performance.now() - lookupStart);
|
|
65
|
+
recordCacheLookup("hit", lookupDurationMs);
|
|
52
66
|
return {
|
|
53
67
|
cachedResult: this.hydrateResult(cached),
|
|
54
68
|
depAwareSlug: slug,
|
|
55
69
|
moduleCacheKey: key,
|
|
56
70
|
cachedModule: cached.result.pageModule,
|
|
71
|
+
cacheStatus: "hit",
|
|
72
|
+
lookupDurationMs,
|
|
57
73
|
};
|
|
58
74
|
}, { "cache.slug": slug, "cache.key": key, "cache.projectId": this.projectId ?? "unknown" });
|
|
59
75
|
}
|
|
@@ -128,3 +144,11 @@ export class CacheCoordinator {
|
|
|
128
144
|
};
|
|
129
145
|
}
|
|
130
146
|
}
|
|
147
|
+
function roundDurationMs(value) {
|
|
148
|
+
return Math.round(value * 100) / 100;
|
|
149
|
+
}
|
|
150
|
+
function recordCacheLookup(status, durationMs) {
|
|
151
|
+
markRequestProfilePhase("render.cache_lookup", durationMs);
|
|
152
|
+
markRequestProfilePhase(`render.cache_${status}`);
|
|
153
|
+
metrics.recordCacheGet(status === "hit");
|
|
154
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/renderer.ts"],"names":[],"mappings":"AA6CA,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAgBzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAwBxD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,MAAM,CAAC,EAAE,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AW,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAU5C,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ5D,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAO9B,OAAO,CAAC,wBAAwB;CA4FjC;AAED,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,GACnB,CAAC;AAMF,wBAAgB,WAAW,IAAI,QAAQ,CAOtC;AAED,wBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsBrF;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAQrD;AAED,wBAAsB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnF;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,cAAc,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,cAAc,CAAC,EAAE,0BAA0B,GAC1C,OAAO,CAAC,YAAY,CAAC,CAIvB"}
|
|
@@ -130,7 +130,7 @@ export class Renderer {
|
|
|
130
130
|
const cacheKey = this.buildCacheKey(slug, effectiveCtx, effectiveOptions);
|
|
131
131
|
const cacheResult = cacheKey
|
|
132
132
|
? await this.cache.checkCache(slug, effectiveCtx, effectiveOptions?.colorScheme, cacheKey)
|
|
133
|
-
: { hit: false, cacheKey: "" };
|
|
133
|
+
: { hit: false, cacheKey: "", status: "miss", lookupDurationMs: 0 };
|
|
134
134
|
if (cacheResult.hit && cacheResult.cachedResult) {
|
|
135
135
|
logger.debug("Cache hit", {
|
|
136
136
|
slug,
|
|
@@ -398,6 +398,8 @@ export class Renderer {
|
|
|
398
398
|
depAwareSlug: slug,
|
|
399
399
|
moduleCacheKey: cacheKey ?? slug,
|
|
400
400
|
cachedModule: result.cachedResult?.pageModule,
|
|
401
|
+
cacheStatus: result.status,
|
|
402
|
+
lookupDurationMs: result.lookupDurationMs,
|
|
401
403
|
};
|
|
402
404
|
},
|
|
403
405
|
persistResult: async (result, slug, cacheKey) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RenderResult } from "../orchestrator/types.js";
|
|
2
2
|
import type { CacheStore } from "../cache/types.js";
|
|
3
|
+
import type { CacheLookupStatus } from "../cache/cache-coordinator.js";
|
|
3
4
|
import { type MemoryCacheStoreOptions } from "../cache/stores/index.js";
|
|
4
5
|
import type { RenderContext } from "../context/render-context.js";
|
|
5
6
|
export interface ContextAwareCacheOptions {
|
|
@@ -11,6 +12,8 @@ export interface ContextAwareCacheLookupResult {
|
|
|
11
12
|
cachedResult?: RenderResult;
|
|
12
13
|
cacheKey: string;
|
|
13
14
|
hit: boolean;
|
|
15
|
+
status: CacheLookupStatus;
|
|
16
|
+
lookupDurationMs: number;
|
|
14
17
|
}
|
|
15
18
|
export declare class ContextAwareCacheCoordinator {
|
|
16
19
|
private store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-aware-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/shared/context-aware-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context-aware-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/shared/context-aware-cache.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAoB,KAAK,uBAAuB,EA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I,OAAO,CAAC,IAAI,CAAC;IAI9B,QAAQ,IAAI;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;IAO5B,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,WAAW;CAkCpB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { rendererLogger } from "../../utils/index.js";
|
|
2
|
+
import { markRequestProfilePhase } from "../../observability/request-profiler.js";
|
|
3
|
+
import { metrics } from "../../observability/simple-metrics/index.js";
|
|
2
4
|
import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
3
5
|
import { SpanNames } from "../../observability/tracing/span-names.js";
|
|
4
6
|
import { MemoryCacheStore } from "../cache/stores/index.js";
|
|
@@ -23,35 +25,47 @@ export class ContextAwareCacheCoordinator {
|
|
|
23
25
|
checkCache(slug, ctx, colorScheme, cacheKeyOverride) {
|
|
24
26
|
const cacheKey = this.getCacheKey(slug, ctx, colorScheme, cacheKeyOverride);
|
|
25
27
|
return withSpan(SpanNames.CACHE_CHECK_SPECULATIVE, async () => {
|
|
28
|
+
const lookupStart = performance.now();
|
|
26
29
|
const cached = (await this.store.get(cacheKey));
|
|
27
30
|
if (!cached) {
|
|
31
|
+
const lookupDurationMs = roundDurationMs(performance.now() - lookupStart);
|
|
32
|
+
recordCacheLookup("miss", lookupDurationMs);
|
|
28
33
|
logger.debug("Cache miss", {
|
|
29
34
|
slug,
|
|
30
35
|
cacheKey,
|
|
31
36
|
projectId: ctx.projectId,
|
|
32
37
|
environment: ctx.environment,
|
|
38
|
+
lookupDurationMs,
|
|
33
39
|
});
|
|
34
|
-
return { cacheKey, hit: false };
|
|
40
|
+
return { cacheKey, hit: false, status: "miss", lookupDurationMs };
|
|
35
41
|
}
|
|
36
42
|
if (this.isExpired(cached)) {
|
|
37
43
|
await this.store.delete(cacheKey);
|
|
44
|
+
const lookupDurationMs = roundDurationMs(performance.now() - lookupStart);
|
|
45
|
+
recordCacheLookup("expired", lookupDurationMs);
|
|
38
46
|
logger.debug("Cache expired", {
|
|
39
47
|
slug,
|
|
40
48
|
cacheKey,
|
|
41
49
|
projectId: ctx.projectId,
|
|
42
50
|
environment: ctx.environment,
|
|
51
|
+
lookupDurationMs,
|
|
43
52
|
});
|
|
44
|
-
return { cacheKey, hit: false };
|
|
53
|
+
return { cacheKey, hit: false, status: "expired", lookupDurationMs };
|
|
45
54
|
}
|
|
55
|
+
const lookupDurationMs = roundDurationMs(performance.now() - lookupStart);
|
|
56
|
+
recordCacheLookup("hit", lookupDurationMs);
|
|
46
57
|
logger.debug("Cache hit", {
|
|
47
58
|
slug,
|
|
48
59
|
projectId: ctx.projectId,
|
|
49
60
|
environment: ctx.environment,
|
|
61
|
+
lookupDurationMs,
|
|
50
62
|
});
|
|
51
63
|
return {
|
|
52
64
|
cachedResult: this.cloneResult(cached.result, cached.nodeMapEntries),
|
|
53
65
|
cacheKey,
|
|
54
66
|
hit: true,
|
|
67
|
+
status: "hit",
|
|
68
|
+
lookupDurationMs,
|
|
55
69
|
};
|
|
56
70
|
}, {
|
|
57
71
|
"cache.key": cacheKey,
|
|
@@ -195,3 +209,11 @@ export class ContextAwareCacheCoordinator {
|
|
|
195
209
|
return cloned;
|
|
196
210
|
}
|
|
197
211
|
}
|
|
212
|
+
function roundDurationMs(value) {
|
|
213
|
+
return Math.round(value * 100) / 100;
|
|
214
|
+
}
|
|
215
|
+
function recordCacheLookup(status, durationMs) {
|
|
216
|
+
markRequestProfilePhase("render.cache_lookup", durationMs);
|
|
217
|
+
markRequestProfilePhase(`render.cache_${status}`);
|
|
218
|
+
metrics.recordCacheGet(status === "hit");
|
|
219
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/src/server/dev-server/server.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,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AAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,CAAsC;IACvD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,iBAAiB,CAAC,CAAa;IACvC,OAAO,CAAC,qBAAqB,CAAC,CAAa;IAC3C,OAAO,CAAC,8BAA8B,CAAC,CAAa;gBAEhC,OAAO,EAAE,gBAAgB;IAQ7C,OAAO,CAAC,OAAO;YAID,YAAY;IAWpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgL5B,qEAAqE;IACrE,IAAI,OAAO,IAAI,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAKjD;IAED,OAAO,CAAC,oBAAoB;YAmBd,qBAAqB;YAoBrB,yBAAyB;YAoBzB,uBAAuB;YA4BvB,wBAAwB;IAmBtC,OAAO,CAAC,kBAAkB;IAuBpB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;YAe7B,iBAAiB;IAsC/B,qBAAqB,IAAI,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,GAAG,IAAI;IAIlE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CA6B5B"}
|
|
@@ -227,6 +227,7 @@ export class DevServer {
|
|
|
227
227
|
resourceDirs: ["resources"],
|
|
228
228
|
promptDirs: ["prompts"],
|
|
229
229
|
workflowDirs: ["workflows"],
|
|
230
|
+
workDirs: ["work"],
|
|
230
231
|
fsAdapter: this.adapter.fs,
|
|
231
232
|
verbose: this.isDebug(),
|
|
232
233
|
};
|
|
@@ -236,10 +237,12 @@ export class DevServer {
|
|
|
236
237
|
const config = this.buildDiscoveryConfig();
|
|
237
238
|
const result = await discoverAll(config);
|
|
238
239
|
const total = result.tools.size + result.agents.size + result.skills.size +
|
|
239
|
-
result.workflows.size + result.
|
|
240
|
+
result.workflows.size + result.works.size + result.prompts.size +
|
|
241
|
+
result.resources.size;
|
|
240
242
|
if (total > 0) {
|
|
241
243
|
logger.debug(`[Discovery] Registered ${result.tools.size} tools, ${result.agents.size} agents, ` +
|
|
242
244
|
`${result.skills.size} skills, ${result.workflows.size} workflows, ` +
|
|
245
|
+
`${result.works.size} Work definitions, ` +
|
|
243
246
|
`${result.prompts.size} prompts, ${result.resources.size} resources`);
|
|
244
247
|
}
|
|
245
248
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/work/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGtF,sCAAsC;AACtC,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,cAAc,CA0CvD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createError, toError } from "../errors/veryfront-error.js";
|
|
2
|
+
/** Create a typed Work definition. */
|
|
3
|
+
export function work(config) {
|
|
4
|
+
const id = assertWorkId(config.id);
|
|
5
|
+
const outcome = assertNonEmptyString(config.outcome, `Work "${id}" outcome`);
|
|
6
|
+
if (!Array.isArray(config.acceptanceCriteria) || config.acceptanceCriteria.length === 0) {
|
|
7
|
+
throwWorkConfigError(`Work "${id}" must define at least one acceptance criterion.`);
|
|
8
|
+
}
|
|
9
|
+
const seenCriterionIds = new Set();
|
|
10
|
+
const acceptanceCriteria = config.acceptanceCriteria.map((criterion, index) => {
|
|
11
|
+
const criterionId = assertNonEmptyString(criterion.id, `Work "${id}" acceptance criterion at index ${index} id`);
|
|
12
|
+
if (seenCriterionIds.has(criterionId)) {
|
|
13
|
+
throwWorkConfigError(`Work "${id}" has duplicate acceptance criterion id "${criterionId}".`);
|
|
14
|
+
}
|
|
15
|
+
seenCriterionIds.add(criterionId);
|
|
16
|
+
const description = assertNonEmptyString(criterion.description, `Work "${id}" acceptance criterion "${criterionId}" description`);
|
|
17
|
+
const normalizedCriterion = {
|
|
18
|
+
id: criterionId,
|
|
19
|
+
description,
|
|
20
|
+
};
|
|
21
|
+
if (criterion.optional === true) {
|
|
22
|
+
normalizedCriterion.optional = true;
|
|
23
|
+
}
|
|
24
|
+
return normalizedCriterion;
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
id,
|
|
28
|
+
name: config.name?.trim() || id,
|
|
29
|
+
outcome,
|
|
30
|
+
acceptanceCriteria,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function assertWorkId(value) {
|
|
34
|
+
const id = assertNonEmptyString(value, "Work id");
|
|
35
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(id)) {
|
|
36
|
+
throwWorkConfigError("Work id must be a path-safe single segment using letters, numbers, underscores, or hyphens.");
|
|
37
|
+
}
|
|
38
|
+
return id;
|
|
39
|
+
}
|
|
40
|
+
function assertNonEmptyString(value, label) {
|
|
41
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
42
|
+
throwWorkConfigError(`${label} cannot be empty.`);
|
|
43
|
+
}
|
|
44
|
+
return value.trim();
|
|
45
|
+
}
|
|
46
|
+
function throwWorkConfigError(message) {
|
|
47
|
+
throw toError(createError({
|
|
48
|
+
type: "agent",
|
|
49
|
+
message,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declare source-backed Work definitions for business process observability.
|
|
3
|
+
*
|
|
4
|
+
* @module work
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { work } from "veryfront/work";
|
|
9
|
+
*
|
|
10
|
+
* export default work({
|
|
11
|
+
* id: "supplier-invoice-processing",
|
|
12
|
+
* name: "Supplier invoice processing",
|
|
13
|
+
* outcome: "Resolve all open supplier invoices.",
|
|
14
|
+
* acceptanceCriteria: [
|
|
15
|
+
* {
|
|
16
|
+
* id: "invoices_discovered",
|
|
17
|
+
* description: "Open supplier invoices have been discovered.",
|
|
18
|
+
* },
|
|
19
|
+
* ],
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import "../../_dnt.polyfills.js";
|
|
24
|
+
export type { WorkAcceptanceCriterion, WorkConfig, WorkDefinition, WorkReference, } from "./types.js";
|
|
25
|
+
export { work } from "./factory.js";
|
|
26
|
+
export { workRegistry } from "./registry.js";
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/work/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declare source-backed Work definitions for business process observability.
|
|
3
|
+
*
|
|
4
|
+
* @module work
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { work } from "veryfront/work";
|
|
9
|
+
*
|
|
10
|
+
* export default work({
|
|
11
|
+
* id: "supplier-invoice-processing",
|
|
12
|
+
* name: "Supplier invoice processing",
|
|
13
|
+
* outcome: "Resolve all open supplier invoices.",
|
|
14
|
+
* acceptanceCriteria: [
|
|
15
|
+
* {
|
|
16
|
+
* id: "invoices_discovered",
|
|
17
|
+
* description: "Open supplier invoices have been discovered.",
|
|
18
|
+
* },
|
|
19
|
+
* ],
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import "../../_dnt.polyfills.js";
|
|
24
|
+
export { work } from "./factory.js";
|
|
25
|
+
export { workRegistry } from "./registry.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WorkDefinition, WorkReference } from "./types.js";
|
|
2
|
+
/** Resolve agent work references to concrete Work definitions. */
|
|
3
|
+
export declare function resolveWorkReferences(references: WorkReference | WorkReference[]): WorkDefinition[];
|
|
4
|
+
/** Build a concise system-prompt section describing assigned Work outcomes. */
|
|
5
|
+
export declare function buildWorkManifestPrompt(works: Iterable<WorkDefinition>): string;
|
|
6
|
+
//# sourceMappingURL=prompt-augmentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-augmentation.d.ts","sourceRoot":"","sources":["../../../src/src/work/prompt-augmentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhE,kEAAkE;AAClE,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,aAAa,GAAG,aAAa,EAAE,GAC1C,cAAc,EAAE,CAGlB;AAED,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,MAAM,CAwB/E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { workRegistry } from "./registry.js";
|
|
2
|
+
/** Resolve agent work references to concrete Work definitions. */
|
|
3
|
+
export function resolveWorkReferences(references) {
|
|
4
|
+
const refs = Array.isArray(references) ? references : [references];
|
|
5
|
+
return refs.map((ref) => typeof ref === "string" ? workRegistry.getRequired(ref) : ref);
|
|
6
|
+
}
|
|
7
|
+
/** Build a concise system-prompt section describing assigned Work outcomes. */
|
|
8
|
+
export function buildWorkManifestPrompt(works) {
|
|
9
|
+
const workDefinitions = Array.from(works);
|
|
10
|
+
if (workDefinitions.length === 0)
|
|
11
|
+
return "";
|
|
12
|
+
const sections = workDefinitions.map((definition) => {
|
|
13
|
+
const criteria = definition.acceptanceCriteria.map((criterion) => {
|
|
14
|
+
const optionalLabel = criterion.optional ? " (optional)" : "";
|
|
15
|
+
return `- ${criterion.id}${optionalLabel}: ${criterion.description}`;
|
|
16
|
+
}).join("\n");
|
|
17
|
+
return [
|
|
18
|
+
`### ${definition.name} (${definition.id})`,
|
|
19
|
+
`Outcome: ${definition.outcome}`,
|
|
20
|
+
"Acceptance criteria:",
|
|
21
|
+
criteria,
|
|
22
|
+
].join("\n");
|
|
23
|
+
}).join("\n\n");
|
|
24
|
+
return [
|
|
25
|
+
"## Work",
|
|
26
|
+
"Work is business/process state: pursue the outcome, then use Work execution tools to record durable status and evidence. Work definitions do not prescribe fixed workflow control flow.",
|
|
27
|
+
"",
|
|
28
|
+
sections,
|
|
29
|
+
].join("\n");
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkDefinition } from "./types.js";
|
|
2
|
+
import { ScopedRegistryFacade } from "../registry/scoped-registry-facade.js";
|
|
3
|
+
declare class WorkRegistryClass extends ScopedRegistryFacade<WorkDefinition> {
|
|
4
|
+
getRequired(id: string): WorkDefinition;
|
|
5
|
+
list(): string[];
|
|
6
|
+
}
|
|
7
|
+
/** Shared Work registry value. */
|
|
8
|
+
export declare const workRegistry: WorkRegistryClass;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/src/work/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAa7E,cAAM,iBAAkB,SAAQ,oBAAoB,CAAC,cAAc,CAAC;IAClE,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc;IAMvC,IAAI,IAAI,MAAM,EAAE;CAGjB;AAED,kCAAkC;AAClC,eAAO,MAAM,YAAY,mBAA6C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createError, toError } from "../errors/veryfront-error.js";
|
|
2
|
+
import { ProjectScopedRegistryManager } from "../registry/project-scoped-registry-manager.js";
|
|
3
|
+
import { ScopedRegistryFacade } from "../registry/scoped-registry-facade.js";
|
|
4
|
+
const workRegistryManager = new ProjectScopedRegistryManager("work");
|
|
5
|
+
function createMissingWorkError(id) {
|
|
6
|
+
return toError(createError({
|
|
7
|
+
type: "agent",
|
|
8
|
+
message: `Work "${id}" not found`,
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
class WorkRegistryClass extends ScopedRegistryFacade {
|
|
12
|
+
getRequired(id) {
|
|
13
|
+
const registeredWork = this.get(id);
|
|
14
|
+
if (registeredWork)
|
|
15
|
+
return registeredWork;
|
|
16
|
+
throw createMissingWorkError(id);
|
|
17
|
+
}
|
|
18
|
+
list() {
|
|
19
|
+
return this.getAllIds();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Shared Work registry value. */
|
|
23
|
+
export const workRegistry = new WorkRegistryClass(workRegistryManager);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** One measurable outcome condition for a Work definition. */
|
|
2
|
+
export interface WorkAcceptanceCriterion {
|
|
3
|
+
/** Stable identifier used by execution state and cloud persistence. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Human-readable condition that must be satisfied unless optional. */
|
|
6
|
+
description: string;
|
|
7
|
+
/** Optional criteria do not block Work execution completion. */
|
|
8
|
+
optional?: true;
|
|
9
|
+
}
|
|
10
|
+
/** Configuration used by work(). */
|
|
11
|
+
export interface WorkConfig {
|
|
12
|
+
/** Stable project-local Work identifier. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Human-readable display name. Defaults to the id when omitted. */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** Business outcome the execution layer should make true. */
|
|
17
|
+
outcome: string;
|
|
18
|
+
/** Outcome criteria tracked as business process state. */
|
|
19
|
+
acceptanceCriteria: WorkAcceptanceCriterion[];
|
|
20
|
+
}
|
|
21
|
+
/** Public API contract for Work definitions. */
|
|
22
|
+
export interface WorkDefinition {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
outcome: string;
|
|
26
|
+
acceptanceCriteria: WorkAcceptanceCriterion[];
|
|
27
|
+
}
|
|
28
|
+
/** Agent-level reference to source-declared Work. */
|
|
29
|
+
export type WorkReference = string | WorkDefinition;
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/work/types.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,uBAAuB;IACtC,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,oCAAoC;AACpC,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,kBAAkB,EAAE,uBAAuB,EAAE,CAAC;CAC/C;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,uBAAuB,EAAE,CAAC;CAC/C;AAED,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.811",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -105,6 +105,10 @@
|
|
|
105
105
|
"import": "./esm/src/workflow/discovery/index.js",
|
|
106
106
|
"types": "./esm/src/workflow/discovery/index.d.ts"
|
|
107
107
|
},
|
|
108
|
+
"./work": {
|
|
109
|
+
"import": "./esm/src/work/index.js",
|
|
110
|
+
"types": "./esm/src/work/index.d.ts"
|
|
111
|
+
},
|
|
108
112
|
"./schemas": {
|
|
109
113
|
"import": "./esm/src/schemas/index.js",
|
|
110
114
|
"types": "./esm/src/schemas/index.d.ts"
|