@oneie/cli 4.0.3 → 4.0.5
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/dist/package.json +3 -3
- package/dist/src/compiler.js +9 -4
- package/dist/src/fn.js +5 -8
- package/dist/src/workflow.js +32 -0
- package/package.json +3 -3
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneie/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "ONE agent CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"commander": "^12.0.0",
|
|
23
|
-
"@oneie/sdk": "^0.14.
|
|
23
|
+
"@oneie/sdk": "^0.14.12"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@oneie/evals": "
|
|
26
|
+
"@oneie/evals": "^0.1.1",
|
|
27
27
|
"@types/node": "^25.6.0",
|
|
28
28
|
"tsx": "^4.0.0",
|
|
29
29
|
"typescript": "^5.4.0",
|
package/dist/src/compiler.js
CHANGED
|
@@ -255,9 +255,14 @@ export async function compileNode(dir, agencySlug, opts) {
|
|
|
255
255
|
// human bits {id,label,tags,description,[[stages]]}; the rest is derived deterministically:
|
|
256
256
|
// stage.slot numeric order (the wall loads ORDER BY slot) → the stage index
|
|
257
257
|
// stage.tag full namespaced tag lifecycle:<id>:<stageId> (LifecycleStage.tag)
|
|
258
|
-
// stage.subSteps
|
|
259
|
-
//
|
|
260
|
-
//
|
|
258
|
+
// stage.subSteps always empty — TOML has no sub-step authoring surface
|
|
259
|
+
// stage.enter_when optional TOML field, straight through (null when absent) — the
|
|
260
|
+
// C7 rule engine grammar (an exact event name or a conversion-stage
|
|
261
|
+
// category, e.g. "purchase"/"intent"); the compiler does not validate
|
|
262
|
+
// it against event-vocabulary.ts (that package isn't a CLI dependency),
|
|
263
|
+
// so an author who wants the stage to self-populate from real traffic
|
|
264
|
+
// must use a value the web app's isValidEnterWhen() accepts — a bad
|
|
265
|
+
// value just leaves the stage manual-only (evaluate() never matches it).
|
|
261
266
|
// stage.goal / principle / band plain string fields, straight through if present
|
|
262
267
|
// stage.levers parseToml has no nested array-of-tables, so a lever is one string per
|
|
263
268
|
// entry in a bracket list: levers = ["page:/pricing", "agent:one"] —
|
|
@@ -280,7 +285,7 @@ export async function compileNode(dir, agencySlug, opts) {
|
|
|
280
285
|
tag: `lifecycle:${id}:${stageId}`,
|
|
281
286
|
slot: i,
|
|
282
287
|
subSteps: [],
|
|
283
|
-
enter_when: null,
|
|
288
|
+
enter_when: s.enter_when ? String(s.enter_when) : null,
|
|
284
289
|
...(s.goal ? { goal: String(s.goal) } : {}),
|
|
285
290
|
...(s.principle ? { principle: String(s.principle) } : {}),
|
|
286
291
|
...(s.band ? { band: String(s.band) } : {}),
|
package/dist/src/fn.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { FN_MAP, FN_MAP_VERSION } from '@oneie/sdk/generated/fn-map';
|
|
3
|
+
// The allowlist is ONE source (`@oneie/sdk/fn-allowlist`) shared by web, MCP, CLI
|
|
4
|
+
// and channels — never a literal copied per surface.
|
|
5
|
+
import { FN_ALLOWLIST, isAllowedFn } from '@oneie/sdk/fn-allowlist';
|
|
3
6
|
const DEFAULT_API = process.env.ONEIE_BASE_URL ?? process.env.ONE_API_URL ?? 'https://api.one.ie';
|
|
4
|
-
const ALLOWLIST = new Set([
|
|
5
|
-
'actionable_hypotheses', 'active_frontiers', 'active_objectives',
|
|
6
|
-
'actor_classification', 'actors_by_kind', 'actors_by_tag', 'actors_for',
|
|
7
|
-
'attractive_tasks', 'blocked_tasks', 'cheapest_provider', 'exploratory_tasks',
|
|
8
|
-
'highways', 'optimal_route', 'promising_frontiers', 'suggest_route', 'total_contribution',
|
|
9
|
-
]);
|
|
10
7
|
function apiKey() {
|
|
11
8
|
return process.env.ONEIE_API_KEY ?? process.env.ONE_API_KEY ?? '';
|
|
12
9
|
}
|
|
@@ -32,7 +29,7 @@ export function fnCmd() {
|
|
|
32
29
|
.command('list')
|
|
33
30
|
.description('List all allowlisted functions')
|
|
34
31
|
.action(() => {
|
|
35
|
-
const rows =
|
|
32
|
+
const rows = FN_ALLOWLIST.map((name) => {
|
|
36
33
|
const entry = FN_MAP[name];
|
|
37
34
|
const params = entry?.params.map((p) => p.name).join(', ') ?? '';
|
|
38
35
|
return ` ${name.padEnd(28)}${params ? `(${params})` : '()'} → ${entry?.returnKind ?? '?'}`;
|
|
@@ -46,7 +43,7 @@ export function fnCmd() {
|
|
|
46
43
|
.option('--workspace <slug>', 'Workspace slug')
|
|
47
44
|
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
48
45
|
.action(async (name, opts) => {
|
|
49
|
-
if (!
|
|
46
|
+
if (!isAllowedFn(name)) {
|
|
50
47
|
process.stderr.write(`error: '${name}' is not in the allowlist. Run 'one fn list' to see available functions.\n`);
|
|
51
48
|
process.exit(1);
|
|
52
49
|
}
|
package/dist/src/workflow.js
CHANGED
|
@@ -78,6 +78,38 @@ export function workflowCmd() {
|
|
|
78
78
|
const r = await call(opts.api, opts.slug, 'workflow:run', { workflowId: id });
|
|
79
79
|
out(cmd, { ok: !!r.runId, ...r });
|
|
80
80
|
});
|
|
81
|
+
cmd.command('validate <id> <file>')
|
|
82
|
+
.description('Validate a diff-JSON file against a workflow (§9 gate, never persists)')
|
|
83
|
+
.requiredOption('--slug <slug>', 'Workspace slug')
|
|
84
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
85
|
+
.action(async (id, file, opts) => {
|
|
86
|
+
if (!existsSync(file)) {
|
|
87
|
+
out(cmd, { ok: false, error: `not found: ${file}` });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const diff = JSON.parse(readFileSync(file, 'utf8'));
|
|
91
|
+
const r = await call(opts.api, opts.slug, 'workflow:validate', { workflowId: id, diff });
|
|
92
|
+
out(cmd, { ok: !!r.ok, ...r });
|
|
93
|
+
});
|
|
94
|
+
cmd.command('resolve <runId> <stepId>')
|
|
95
|
+
.description('Resolve a suspended human step in a run (--decision approved|rejected)')
|
|
96
|
+
.requiredOption('--slug <slug>', 'Workspace slug')
|
|
97
|
+
.option('--decision <d>', 'approved | rejected')
|
|
98
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
99
|
+
.action(async (runId, stepId, opts) => {
|
|
100
|
+
const r = await call(opts.api, opts.slug, 'human:resolve', { runId, stepId, ...(opts.decision ? { decision: opts.decision } : {}) });
|
|
101
|
+
out(cmd, { ok: !!r.ok, ...r });
|
|
102
|
+
});
|
|
103
|
+
cmd.command('logs <id>')
|
|
104
|
+
.description("List recent runs of a workflow; --run <runId> for one run's step-event timeline")
|
|
105
|
+
.requiredOption('--slug <slug>', 'Workspace slug')
|
|
106
|
+
.option('--run <runId>', "Return this run's event timeline")
|
|
107
|
+
.option('--limit <n>', 'Max runs to list', (v) => parseInt(v, 10))
|
|
108
|
+
.option('--api <url>', 'API base URL', DEFAULT_API)
|
|
109
|
+
.action(async (id, opts) => {
|
|
110
|
+
const r = await call(opts.api, opts.slug, 'workflow:runs', { workflowId: id, ...(opts.run ? { runId: opts.run } : {}), ...(opts.limit ? { limit: opts.limit } : {}) });
|
|
111
|
+
out(cmd, { ok: !r.error, ...r });
|
|
112
|
+
});
|
|
81
113
|
return cmd;
|
|
82
114
|
}
|
|
83
115
|
// out() mirrors agent.ts — human `✓ k=v` or --json. W3: reuse the shared helper if
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneie/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "ONE agent CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"commander": "^12.0.0",
|
|
23
|
-
"@oneie/sdk": "^0.14.
|
|
23
|
+
"@oneie/sdk": "^0.14.12"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@oneie/evals": "
|
|
26
|
+
"@oneie/evals": "^0.1.1",
|
|
27
27
|
"@types/node": "^25.6.0",
|
|
28
28
|
"tsx": "^4.0.0",
|
|
29
29
|
"typescript": "^5.4.0",
|