@gate-forge/pack-workflow 0.1.0
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/LICENSE +202 -0
- package/dist/adapter-schema.d.ts +145 -0
- package/dist/adapter-schema.d.ts.map +1 -0
- package/dist/adapter-schema.js +125 -0
- package/dist/adapter-schema.js.map +1 -0
- package/dist/detector.d.ts +47 -0
- package/dist/detector.d.ts.map +1 -0
- package/dist/detector.js +514 -0
- package/dist/detector.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/obligations.d.ts +58 -0
- package/dist/obligations.d.ts.map +1 -0
- package/dist/obligations.js +69 -0
- package/dist/obligations.js.map +1 -0
- package/dist/version.d.ts +11 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +11 -0
- package/dist/version.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obligations.d.ts","sourceRoot":"","sources":["../src/obligations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAE/E,4EAA4E;AAC5E,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAM1D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAKpF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Obligation contract vocabulary for the workflow pack.
|
|
3
|
+
*
|
|
4
|
+
* Every discovered `workflow.contract.*` resource generates the same
|
|
5
|
+
* five obligations (the policy stage of the engine chooses a subset
|
|
6
|
+
* based on classification; the contracts themselves are fixed). The
|
|
7
|
+
* contract names are the suffix of the obligation id
|
|
8
|
+
* `<resourceId>:<contract>`; resource ids always start with
|
|
9
|
+
* `workflow.contract.`, so obligation ids look like
|
|
10
|
+
* `workflow.contract.contracts.draft:workflow:transition-allowed`.
|
|
11
|
+
*
|
|
12
|
+
* The five contracts mirror the root plan §6 "Workflow pack" obligations
|
|
13
|
+
* (valid transition / invalid transition / persisted final state /
|
|
14
|
+
* audit event records actor and transition) plus an explicit
|
|
15
|
+
* terminal-immutability obligation that the e2e suite exercises.
|
|
16
|
+
*/
|
|
17
|
+
/** Valid transition succeeds + persists + appends an audit row. */
|
|
18
|
+
export const WORKFLOW_TRANSITION_ALLOWED = 'workflow:transition-allowed';
|
|
19
|
+
/**
|
|
20
|
+
* Invalid transition is rejected: the adapter's `attemptTransition`
|
|
21
|
+
* returns `{ accepted: false }`, the persisted state is unchanged, and
|
|
22
|
+
* no audit row is appended.
|
|
23
|
+
*/
|
|
24
|
+
export const WORKFLOW_TRANSITION_REJECTED = 'workflow:transition-rejected';
|
|
25
|
+
/**
|
|
26
|
+
* Any write attempt against a terminal state is rejected with
|
|
27
|
+
* `{ accepted: false, reason: 'terminal-state' }`; no audit row is
|
|
28
|
+
* appended.
|
|
29
|
+
*/
|
|
30
|
+
export const WORKFLOW_TERMINAL_IMMUTABLE = 'workflow:terminal-immutable';
|
|
31
|
+
/**
|
|
32
|
+
* Audit row emitted on every accepted transition contains `actor`,
|
|
33
|
+
* `from`, `to`, and a timestamp; the adapter's `readAuditLog()`
|
|
34
|
+
* returns the append-only log verbatim.
|
|
35
|
+
*/
|
|
36
|
+
export const WORKFLOW_AUDIT_EMITTED = 'workflow:audit-emitted';
|
|
37
|
+
/**
|
|
38
|
+
* The persisted entity's `status` matches the machine's terminal state
|
|
39
|
+
* after the transition sequence (e.g. `terminated`, `signed`).
|
|
40
|
+
*/
|
|
41
|
+
export const WORKFLOW_PERSISTED_FINAL_STATE = 'workflow:persisted-final-state';
|
|
42
|
+
/** Every workflow contract this pack ships, in stable declaration order. */
|
|
43
|
+
export const WORKFLOW_OBLIGATION_CONTRACTS = [
|
|
44
|
+
WORKFLOW_TRANSITION_ALLOWED,
|
|
45
|
+
WORKFLOW_TRANSITION_REJECTED,
|
|
46
|
+
WORKFLOW_TERMINAL_IMMUTABLE,
|
|
47
|
+
WORKFLOW_AUDIT_EMITTED,
|
|
48
|
+
WORKFLOW_PERSISTED_FINAL_STATE,
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Returns the obligation contracts applicable to a workflow resource.
|
|
52
|
+
* Currently every workflow resource is treated equally; the engine's
|
|
53
|
+
* classification stage may narrow this later.
|
|
54
|
+
*
|
|
55
|
+
* Args:
|
|
56
|
+
* resourceId: The full `workflow.contract.<domain>.<name>` id.
|
|
57
|
+
*
|
|
58
|
+
* Returns:
|
|
59
|
+
* readonly string[]: The full contract list — same for every workflow
|
|
60
|
+
* resource today, returned as a fresh copy so callers may not mutate
|
|
61
|
+
* the shared array.
|
|
62
|
+
*/
|
|
63
|
+
export function obligationsForWorkflowResource(resourceId) {
|
|
64
|
+
if (!resourceId.startsWith('workflow.contract.')) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
return [...WORKFLOW_OBLIGATION_CONTRACTS];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=obligations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obligations.js","sourceRoot":"","sources":["../src/obligations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,mEAAmE;AACnE,MAAM,CAAC,MAAM,2BAA2B,GAAG,6BAA6B,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,6BAA6B,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,gCAAgC,CAAC;AAE/E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,6BAA6B,GAAsB;IAC9D,2BAA2B;IAC3B,4BAA4B;IAC5B,2BAA2B;IAC3B,sBAAsB;IACtB,8BAA8B;CAC/B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,8BAA8B,CAAC,UAAkB;IAC/D,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACjD,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,GAAG,6BAA6B,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack identity constants. The GPP/3 handshake pins these values: the
|
|
3
|
+
* `.gateforge.yml` plugin entry MUST declare the same `id` and `version`
|
|
4
|
+
* (see the pack README). `version` follows gateforge pack semantics
|
|
5
|
+
* (mirror pack-sqlalchemy).
|
|
6
|
+
*/
|
|
7
|
+
/** Plugin id every workflow pack contribution is pinned to. */
|
|
8
|
+
export declare const PACK_PLUGIN_ID = "gateforge.pack-workflow";
|
|
9
|
+
/** Detector/pack version. */
|
|
10
|
+
export declare const PACK_VERSION = "0.1.0";
|
|
11
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,cAAc,4BAA4B,CAAC;AAExD,6BAA6B;AAC7B,eAAO,MAAM,YAAY,UAAU,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack identity constants. The GPP/3 handshake pins these values: the
|
|
3
|
+
* `.gateforge.yml` plugin entry MUST declare the same `id` and `version`
|
|
4
|
+
* (see the pack README). `version` follows gateforge pack semantics
|
|
5
|
+
* (mirror pack-sqlalchemy).
|
|
6
|
+
*/
|
|
7
|
+
/** Plugin id every workflow pack contribution is pinned to. */
|
|
8
|
+
export const PACK_PLUGIN_ID = 'gateforge.pack-workflow';
|
|
9
|
+
/** Detector/pack version. */
|
|
10
|
+
export const PACK_VERSION = '0.1.0';
|
|
11
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAG,yBAAyB,CAAC;AAExD,6BAA6B;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gate-forge/pack-workflow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "Workflow / state-machine discovery pack: TS-only AST detector (GPP/3), five workflow contracts (transition-allowed, transition-rejected, terminal-immutable, audit-emitted, persisted-final-state), entity-adapter schema for state-machine witnesses.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"README.md",
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.build.json",
|
|
22
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
|
+
"test": "vitest run"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@gate-forge/core": "^0.1.0",
|
|
27
|
+
"@gate-forge/plugin-protocol": "^0.1.0",
|
|
28
|
+
"zod": "^4.1.5"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/umiddey/gateforge.git",
|
|
36
|
+
"directory": "packages/pack-workflow"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/umiddey/gateforge/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/umiddey/gateforge#readme"
|
|
42
|
+
}
|