veryfront 0.1.870 → 0.1.871
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.js +1 -1
- package/esm/src/discovery/handlers/work-handler.d.ts.map +1 -1
- package/esm/src/discovery/handlers/work-handler.js +9 -2
- 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.map +1 -1
- package/esm/src/work/factory.js +9 -7
- package/esm/src/work/index.d.ts +2 -2
- package/esm/src/work/index.d.ts.map +1 -1
- package/esm/src/work/index.js +1 -1
- package/esm/src/work/prompt-augmentation.js +3 -3
- package/esm/src/work/types.d.ts +16 -6
- package/esm/src/work/types.d.ts.map +1 -1
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -1 +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,
|
|
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,CAsBxD,CAAC"}
|
|
@@ -8,10 +8,17 @@ export const workHandler = {
|
|
|
8
8
|
typeof item === "object" &&
|
|
9
9
|
typeof item.id === "string" &&
|
|
10
10
|
typeof item.outcome === "string" &&
|
|
11
|
-
Array.isArray(item.
|
|
11
|
+
(Array.isArray(item.expectations) ||
|
|
12
|
+
Array.isArray(item.acceptanceCriteria)),
|
|
12
13
|
getId: (definition) => definition.id,
|
|
13
14
|
register: (id, definition) => {
|
|
14
|
-
const
|
|
15
|
+
const expectations = definition.expectations ?? definition.acceptanceCriteria;
|
|
16
|
+
const definitionWithId = {
|
|
17
|
+
...definition,
|
|
18
|
+
id,
|
|
19
|
+
expectations,
|
|
20
|
+
acceptanceCriteria: expectations,
|
|
21
|
+
};
|
|
15
22
|
workRegistry.register(id, definitionWithId);
|
|
16
23
|
return definitionWithId;
|
|
17
24
|
},
|
|
@@ -1 +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,
|
|
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,CA4CvD"}
|
package/esm/src/work/factory.js
CHANGED
|
@@ -3,17 +3,18 @@ import { createError, toError } from "../errors/veryfront-error.js";
|
|
|
3
3
|
export function work(config) {
|
|
4
4
|
const id = assertWorkId(config.id);
|
|
5
5
|
const outcome = assertNonEmptyString(config.outcome, `Work "${id}" outcome`);
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const rawExpectations = config.expectations ?? config.acceptanceCriteria;
|
|
7
|
+
if (!Array.isArray(rawExpectations) || rawExpectations.length === 0) {
|
|
8
|
+
throwWorkConfigError(`Work "${id}" must define at least one expectation.`);
|
|
8
9
|
}
|
|
9
10
|
const seenCriterionIds = new Set();
|
|
10
|
-
const
|
|
11
|
-
const criterionId = assertNonEmptyString(criterion.id, `Work "${id}"
|
|
11
|
+
const expectations = rawExpectations.map((criterion, index) => {
|
|
12
|
+
const criterionId = assertNonEmptyString(criterion.id, `Work "${id}" expectation at index ${index} id`);
|
|
12
13
|
if (seenCriterionIds.has(criterionId)) {
|
|
13
|
-
throwWorkConfigError(`Work "${id}" has duplicate
|
|
14
|
+
throwWorkConfigError(`Work "${id}" has duplicate expectation id "${criterionId}".`);
|
|
14
15
|
}
|
|
15
16
|
seenCriterionIds.add(criterionId);
|
|
16
|
-
const description = assertNonEmptyString(criterion.description, `Work "${id}"
|
|
17
|
+
const description = assertNonEmptyString(criterion.description, `Work "${id}" expectation "${criterionId}" description`);
|
|
17
18
|
const normalizedCriterion = {
|
|
18
19
|
id: criterionId,
|
|
19
20
|
description,
|
|
@@ -27,7 +28,8 @@ export function work(config) {
|
|
|
27
28
|
id,
|
|
28
29
|
name: config.name?.trim() || id,
|
|
29
30
|
outcome,
|
|
30
|
-
|
|
31
|
+
expectations,
|
|
32
|
+
acceptanceCriteria: expectations,
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
function assertWorkId(value) {
|
package/esm/src/work/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* id: "supplier-invoice-processing",
|
|
12
12
|
* name: "Supplier invoice processing",
|
|
13
13
|
* outcome: "Resolve all open supplier invoices.",
|
|
14
|
-
*
|
|
14
|
+
* expectations: [
|
|
15
15
|
* {
|
|
16
16
|
* id: "invoices_discovered",
|
|
17
17
|
* description: "Open supplier invoices have been discovered.",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
import "../../_dnt.polyfills.js";
|
|
24
|
-
export type { WorkAcceptanceCriterion, WorkConfig, WorkDefinition, WorkReference, } from "./types.js";
|
|
24
|
+
export type { WorkAcceptanceCriterion, WorkConfig, WorkDefinition, WorkExpectation, WorkReference, } from "./types.js";
|
|
25
25
|
export { work } from "./factory.js";
|
|
26
26
|
export { workRegistry } from "./registry.js";
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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"}
|
|
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,eAAe,EACf,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
package/esm/src/work/index.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* id: "supplier-invoice-processing",
|
|
12
12
|
* name: "Supplier invoice processing",
|
|
13
13
|
* outcome: "Resolve all open supplier invoices.",
|
|
14
|
-
*
|
|
14
|
+
* expectations: [
|
|
15
15
|
* {
|
|
16
16
|
* id: "invoices_discovered",
|
|
17
17
|
* description: "Open supplier invoices have been discovered.",
|
|
@@ -10,15 +10,15 @@ export function buildWorkManifestPrompt(works) {
|
|
|
10
10
|
if (workDefinitions.length === 0)
|
|
11
11
|
return "";
|
|
12
12
|
const sections = workDefinitions.map((definition) => {
|
|
13
|
-
const
|
|
13
|
+
const expectations = definition.expectations.map((criterion) => {
|
|
14
14
|
const optionalLabel = criterion.optional ? " (optional)" : "";
|
|
15
15
|
return `- ${criterion.id}${optionalLabel}: ${criterion.description}`;
|
|
16
16
|
}).join("\n");
|
|
17
17
|
return [
|
|
18
18
|
`### ${definition.name} (${definition.id})`,
|
|
19
19
|
`Outcome: ${definition.outcome}`,
|
|
20
|
-
"
|
|
21
|
-
|
|
20
|
+
"Expectations:",
|
|
21
|
+
expectations,
|
|
22
22
|
].join("\n");
|
|
23
23
|
}).join("\n\n");
|
|
24
24
|
return [
|
package/esm/src/work/types.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
/** One measurable
|
|
2
|
-
export interface
|
|
1
|
+
/** One measurable expectation for a Work definition. */
|
|
2
|
+
export interface WorkExpectation {
|
|
3
3
|
/** Stable identifier used by execution state and cloud persistence. */
|
|
4
4
|
id: string;
|
|
5
5
|
/** Human-readable condition that must be satisfied unless optional. */
|
|
6
6
|
description: string;
|
|
7
|
-
/** Optional
|
|
7
|
+
/** Optional expectations do not block Work execution completion. */
|
|
8
8
|
optional?: true;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Deprecated alias for WorkExpectation.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Use WorkExpectation.
|
|
14
|
+
*/
|
|
15
|
+
export type WorkAcceptanceCriterion = WorkExpectation;
|
|
10
16
|
/** Configuration used by work(). */
|
|
11
17
|
export interface WorkConfig {
|
|
12
18
|
/** Stable project-local Work identifier. */
|
|
@@ -15,15 +21,19 @@ export interface WorkConfig {
|
|
|
15
21
|
name?: string;
|
|
16
22
|
/** Business outcome the execution layer should make true. */
|
|
17
23
|
outcome: string;
|
|
18
|
-
/**
|
|
19
|
-
|
|
24
|
+
/** Expectations tracked as business process state. */
|
|
25
|
+
expectations?: WorkExpectation[];
|
|
26
|
+
/** @deprecated Use expectations. */
|
|
27
|
+
acceptanceCriteria?: WorkExpectation[];
|
|
20
28
|
}
|
|
21
29
|
/** Public API contract for Work definitions. */
|
|
22
30
|
export interface WorkDefinition {
|
|
23
31
|
id: string;
|
|
24
32
|
name: string;
|
|
25
33
|
outcome: string;
|
|
26
|
-
|
|
34
|
+
expectations: WorkExpectation[];
|
|
35
|
+
/** @deprecated Use expectations. */
|
|
36
|
+
acceptanceCriteria: WorkExpectation[];
|
|
27
37
|
}
|
|
28
38
|
/** Agent-level reference to source-declared Work. */
|
|
29
39
|
export type WorkReference = string | WorkDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/work/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/work/types.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAEtD,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,sDAAsD;IACtD,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,oCAAoC;IACpC,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;CACxC;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,oCAAoC;IACpC,kBAAkB,EAAE,eAAe,EAAE,CAAC;CACvC;AAED,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,cAAc,CAAC"}
|