wicked-core-ts 0.1.0 → 0.2.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/index.d.ts +63 -0
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -20,6 +20,11 @@ export interface LaunchOptions {
|
|
|
20
20
|
humanConfirm?: string
|
|
21
21
|
/** The id of a registered repo to run within (creates an isolated worktree). Omit for a repo-less run. */
|
|
22
22
|
repoRef?: string
|
|
23
|
+
/**
|
|
24
|
+
* A registered `WorkflowDef` id (`feature` | `bug` | `migration` or a drop-in). When set, planning
|
|
25
|
+
* is data-driven from the def's phases; omit for the free-text planner.
|
|
26
|
+
*/
|
|
27
|
+
workflow?: string
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* A handle to a wicked-core runtime. Construct with [`Core::spawn`] (production engine: real
|
|
@@ -95,6 +100,48 @@ export declare class Core {
|
|
|
95
100
|
registerRepo(name: string, rootPath: string): Promise<string>
|
|
96
101
|
/** List every registered repository, as a JSON array of `RepoEntry` objects. */
|
|
97
102
|
listRepos(): Promise<string>
|
|
103
|
+
/** All registered governance policies, as a JSON array of `Policy` objects. */
|
|
104
|
+
listPolicies(): Promise<string>
|
|
105
|
+
/** All conformance rules on the store (Pattern + Policy types), as a JSON array. */
|
|
106
|
+
listConformanceRules(): Promise<string>
|
|
107
|
+
/** All conformance claims (governance decisions) on the store, as a JSON array. */
|
|
108
|
+
listConformanceClaims(): Promise<string>
|
|
109
|
+
/**
|
|
110
|
+
* Upsert a governance policy. `policy_json` is a JSON-serialized `Policy` object
|
|
111
|
+
* (fields: id, kind, applies_to, effect, trigger, severity, criteria, rule, obligations).
|
|
112
|
+
* Validates server-side (fails closed on deny_unknown_fields + required fields). Idempotent
|
|
113
|
+
* on stable id — calling twice with the same id and payload is a no-op.
|
|
114
|
+
*/
|
|
115
|
+
upsertPolicy(policyJson: string): Promise<string>
|
|
116
|
+
/**
|
|
117
|
+
* Upsert a conformance rule. `rule_json` is a JSON-serialized `ConformanceRule` object
|
|
118
|
+
* (fields: id, rule_type, statement, severity, confidence, targets, provenance).
|
|
119
|
+
* Validates server-side (INV-C1/C2/C4). Idempotent on stable id.
|
|
120
|
+
*/
|
|
121
|
+
upsertConformanceRule(ruleJson: string): Promise<string>
|
|
122
|
+
/**
|
|
123
|
+
* Register (or replace) a workflow definition in the actor's runtime registry. `json` is a
|
|
124
|
+
* JSON-serialised `WorkflowDef` object (fields: id, description, phases — see the wicked-core
|
|
125
|
+
* workflow schema). Validates server-side (id + ≥1 phase required); rejects invalid JSON or a
|
|
126
|
+
* structurally invalid def. Returns the registered workflow id. Idempotent on id — calling
|
|
127
|
+
* twice replaces the first registration. The def is immediately visible to the next `launchRun`
|
|
128
|
+
* call; no process restart required.
|
|
129
|
+
*/
|
|
130
|
+
registerWorkflow(json: string): Promise<string>
|
|
131
|
+
/**
|
|
132
|
+
* Recall which conformance rules apply to the given `query_json` (a JSON-serialized
|
|
133
|
+
* `RuleQuery` — fields: language, layer, framework, severity, rule_type; all optional).
|
|
134
|
+
* An empty or whitespace `query_json` is treated as an all-rules query (no facet filters).
|
|
135
|
+
* Opens a read-only connection — does not block the single-writer actor. Returns a JSON
|
|
136
|
+
* array of `ConformanceRule` objects, severity-first then id.
|
|
137
|
+
*/
|
|
138
|
+
recallRulesPreview(queryJson: string): Promise<string>
|
|
139
|
+
/**
|
|
140
|
+
* Front-half coverage gate report — JSON-serialized `CoverageReport`, or the JSON literal
|
|
141
|
+
* `null` when the store has no domain-model nodes yet. Opens a read-only connection so it
|
|
142
|
+
* never blocks the single-writer actor.
|
|
143
|
+
*/
|
|
144
|
+
getCoverageReport(): Promise<string>
|
|
98
145
|
/**
|
|
99
146
|
* Open a PTY terminal session running `cmd` (or the login shell if omitted) in `cwd`, sized
|
|
100
147
|
* `cols`x`rows`. `governed=false` is a loud, opt-in UNGOVERNED operator shell that bypasses the
|
|
@@ -120,6 +167,22 @@ export declare class Core {
|
|
|
120
167
|
* `terminalExited` event is emitted. Rejects on an unknown id.
|
|
121
168
|
*/
|
|
122
169
|
closeTerminal(id: string): Promise<string>
|
|
170
|
+
/**
|
|
171
|
+
* Inject an operator message into one or all active PTY workers for a run.
|
|
172
|
+
*
|
|
173
|
+
* `target` is either `"all"` (write to every PTY session for the run) or a CLI key string
|
|
174
|
+
* (write only to that CLI's session). ACP-backed sessions have no PTY and are skipped with a
|
|
175
|
+
* warning. Fires [`CoreEvent::WorkerMessageInjected`] for each successful write.
|
|
176
|
+
*/
|
|
177
|
+
injectWorkerMessage(runId: string, message: string, target: string): Promise<unknown>
|
|
178
|
+
/**
|
|
179
|
+
* Stop the current worker for `ord` in run `run_id` and re-dispatch it.
|
|
180
|
+
*
|
|
181
|
+
* `newCli` is either a CLI key string (re-dispatch immediately to that CLI) or `null` (re-run
|
|
182
|
+
* the council and let it pick). Returns `"ok"` when the command has been queued; the
|
|
183
|
+
* [`CoreEvent::UnitReassigned`] event confirms the reassignment.
|
|
184
|
+
*/
|
|
185
|
+
reassignUnit(runId: string, ord: number, newCli?: string | undefined | null): Promise<unknown>
|
|
123
186
|
}
|
|
124
187
|
/**
|
|
125
188
|
* A live event subscription returned by [`Core::subscribe`]. Owns the FIFO pump thread + its
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-core-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Node/TypeScript bindings (napi-rs) for wicked-core: drive the in-process orchestration engine from JS/TS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"smoke:all": "node smoke.mjs && node smoke-lifecycle.mjs && node smoke-terminal.mjs"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"wicked-core-ts-darwin-arm64": "0.
|
|
45
|
-
"wicked-core-ts-darwin-x64": "0.
|
|
46
|
-
"wicked-core-ts-linux-arm64-gnu": "0.
|
|
47
|
-
"wicked-core-ts-linux-x64-gnu": "0.
|
|
48
|
-
"wicked-core-ts-win32-x64-msvc": "0.
|
|
44
|
+
"wicked-core-ts-darwin-arm64": "0.2.0",
|
|
45
|
+
"wicked-core-ts-darwin-x64": "0.2.0",
|
|
46
|
+
"wicked-core-ts-linux-arm64-gnu": "0.2.0",
|
|
47
|
+
"wicked-core-ts-linux-x64-gnu": "0.2.0",
|
|
48
|
+
"wicked-core-ts-win32-x64-msvc": "0.2.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@napi-rs/cli": "^2.18.4"
|