@f-o-h/cli 0.1.6 → 0.1.7
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/foh.js
CHANGED
|
@@ -32640,7 +32640,7 @@ var StdioServerTransport = class {
|
|
|
32640
32640
|
};
|
|
32641
32641
|
|
|
32642
32642
|
// src/lib/cli-version.ts
|
|
32643
|
-
var CLI_VERSION = "0.1.
|
|
32643
|
+
var CLI_VERSION = "0.1.7";
|
|
32644
32644
|
|
|
32645
32645
|
// src/commands/mcp-serve.ts
|
|
32646
32646
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
@@ -36362,6 +36362,7 @@ var import_path8 = require("path");
|
|
|
36362
36362
|
var import_fs9 = require("fs");
|
|
36363
36363
|
var import_path7 = require("path");
|
|
36364
36364
|
var IMPROVEMENT_SOURCE_TYPES = [
|
|
36365
|
+
"external_agent_run",
|
|
36365
36366
|
"setup_failure",
|
|
36366
36367
|
"proof_failure",
|
|
36367
36368
|
"replay_failure",
|
|
@@ -36373,6 +36374,8 @@ var IMPROVEMENT_DECISIONS = [
|
|
|
36373
36374
|
"ignore",
|
|
36374
36375
|
"fix_docs",
|
|
36375
36376
|
"fix_config",
|
|
36377
|
+
"fix_cli",
|
|
36378
|
+
"fix_api",
|
|
36376
36379
|
"fix_runtime",
|
|
36377
36380
|
"add_test"
|
|
36378
36381
|
];
|
|
@@ -36408,6 +36411,7 @@ function parseEnum(raw, allowed, label) {
|
|
|
36408
36411
|
function inferSourceType(artifact) {
|
|
36409
36412
|
const schema2 = nonEmpty2(getPath2(artifact, "schema_version")) || "";
|
|
36410
36413
|
const status = nonEmpty2(getPath2(artifact, "status")) || "";
|
|
36414
|
+
if (schema2 === "external_agent_run.v1") return "external_agent_run";
|
|
36411
36415
|
if (schema2.includes("knowledge_query") || nonEmpty2(getPath2(artifact, "failure_packet.schema_version"))?.includes("knowledge_query")) {
|
|
36412
36416
|
return "knowledge_miss";
|
|
36413
36417
|
}
|
|
@@ -36419,6 +36423,8 @@ function inferSourceType(artifact) {
|
|
|
36419
36423
|
function inferReasonCode(artifact) {
|
|
36420
36424
|
const direct = nonEmpty2(getPath2(artifact, "reason_code"));
|
|
36421
36425
|
if (direct) return direct;
|
|
36426
|
+
const failureReason = nonEmpty2(getPath2(artifact, "failure_reason_code"));
|
|
36427
|
+
if (failureReason) return failureReason;
|
|
36422
36428
|
const nested = nonEmpty2(getPath2(artifact, "failure_packet.reason_code"));
|
|
36423
36429
|
if (nested) return nested;
|
|
36424
36430
|
const checks = getPath2(artifact, "checks");
|
|
@@ -36432,6 +36438,7 @@ function inferReasonCode(artifact) {
|
|
|
36432
36438
|
return nonEmpty2(getPath2(artifact, "status"));
|
|
36433
36439
|
}
|
|
36434
36440
|
function inferPromotionDecision(sourceType) {
|
|
36441
|
+
if (sourceType === "external_agent_run") return "fix_docs";
|
|
36435
36442
|
if (sourceType === "knowledge_miss") return "fix_docs";
|
|
36436
36443
|
if (sourceType === "setup_failure" || sourceType === "proof_failure" || sourceType === "live_proof_failure") return "fix_config";
|
|
36437
36444
|
if (sourceType === "replay_failure" || sourceType === "runtime_miss") return "add_test";
|
|
@@ -36473,6 +36480,9 @@ function defaultNextCommands(input) {
|
|
|
36473
36480
|
if (input.sourceType === "knowledge_miss" && input.ids.agent_id) {
|
|
36474
36481
|
commands.push(`foh knowledge query --agent ${input.ids.agent_id} --text "<question>" --explain --json`);
|
|
36475
36482
|
}
|
|
36483
|
+
if (input.sourceType === "external_agent_run" && input.sourceArtifactPath) {
|
|
36484
|
+
commands.push(`foh bug improve --from external-agent-run --file ${input.sourceArtifactPath} --json`);
|
|
36485
|
+
}
|
|
36476
36486
|
if (input.sourceArtifactPath) {
|
|
36477
36487
|
commands.push(`foh bug report --out test-results/bug-report.from-improvement.json --command "investigate ${input.reasonCode}" --request-url https://front-of-house-api.stldocs.app/api --response-status 500 --next-check "Review ${(0, import_path7.basename)(input.sourceArtifactPath)}" --json`);
|
|
36478
36488
|
}
|
|
@@ -36835,18 +36845,20 @@ function registerBug(program3) {
|
|
|
36835
36845
|
throw e;
|
|
36836
36846
|
}
|
|
36837
36847
|
});
|
|
36838
|
-
bug.command("improve").description("Write a redacted failure-to-improvement packet from
|
|
36848
|
+
bug.command("improve").description("Write a redacted failure-to-improvement packet from an external-agent/setup/proof/replay/knowledge/runtime artifact").option("--from <type>", "Source artifact type alias, for example external-agent-run").option("--file <path>", "Source JSON artifact alias for --from-file").option("--from-file <path>", "Source JSON artifact to convert into an improvement packet").option("--out <path>", "Output JSON file path for improvement packet").option("--source-type <type>", "external_agent_run|setup_failure|proof_failure|replay_failure|knowledge_miss|runtime_miss|live_proof_failure").option("--reason-code <code>", "Deterministic failure reason code").option("--recommendation <decision>", "ignore|fix_docs|fix_config|fix_cli|fix_api|fix_runtime|add_test").option("--evidence-summary <text>", "Compact redacted evidence summary").option("--source-command <text>", "Command or operation that produced the source artifact").option("--org <id>", "Org ID for boundary check and packet IDs").option("--agent <id>", "Agent ID to attach").option("--conversation <id>", "Conversation ID to attach").option("--trace <id>", "Trace ID to attach").option("--correlation <id>", "Correlation ID to attach").option("--proof-artifact <path>", "Proof artifact path to attach").option(
|
|
36839
36849
|
"--next-command <text>",
|
|
36840
36850
|
"Deterministic next command (repeat this flag for multiple commands)",
|
|
36841
36851
|
(value, previous = []) => [...previous, value],
|
|
36842
36852
|
[]
|
|
36843
36853
|
).option("--json", "Output as JSON").action(async (opts) => withCommandErrorHandling(async () => {
|
|
36844
|
-
const
|
|
36854
|
+
const sourcePath = opts.fromFile ?? opts.file;
|
|
36855
|
+
const sourceType = opts.sourceType ?? (typeof opts.from === "string" ? opts.from.replaceAll("-", "_") : void 0);
|
|
36856
|
+
const sourceArtifact = readSourceArtifact(sourcePath);
|
|
36845
36857
|
const outPath = String(opts.out || defaultImprovementArtifactPath());
|
|
36846
36858
|
const packet = buildImprovementPacket({
|
|
36847
36859
|
sourceArtifact,
|
|
36848
|
-
sourceArtifactPath:
|
|
36849
|
-
sourceType
|
|
36860
|
+
sourceArtifactPath: sourcePath,
|
|
36861
|
+
sourceType,
|
|
36850
36862
|
reasonCode: opts.reasonCode,
|
|
36851
36863
|
evidenceSummary: opts.evidenceSummary,
|
|
36852
36864
|
promotionDecision: opts.recommendation,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "external_agent_run.v1",
|
|
3
|
+
"run_id": "2026-05-04-codex-001",
|
|
4
|
+
"status": "fail",
|
|
5
|
+
"failure_reason_code": "docs_widget_proof_path_unclear",
|
|
6
|
+
"model_provider": "openai",
|
|
7
|
+
"model_name": "codex",
|
|
8
|
+
"agent_shell": "vscode-terminal",
|
|
9
|
+
"workspace_type": "clean-no-repo",
|
|
10
|
+
"prompt_version": "blank-setup.v1",
|
|
11
|
+
"prompt_path": "Docs/operations/external-agent-feedback-loop.md#blank-setupv1",
|
|
12
|
+
"started_at": "2026-05-04T09:00:00.000Z",
|
|
13
|
+
"ended_at": "2026-05-04T09:30:00.000Z",
|
|
14
|
+
"manual_intervention_count": 1,
|
|
15
|
+
"manual_interventions": [
|
|
16
|
+
{
|
|
17
|
+
"at": "2026-05-04T09:12:00.000Z",
|
|
18
|
+
"summary": "Human pointed the agent from generic docs to the CLI install guide."
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"environment": {
|
|
22
|
+
"os": "windows",
|
|
23
|
+
"node_version": "v24.11.1",
|
|
24
|
+
"npm_version": "10.x",
|
|
25
|
+
"foh_cli_version": "0.1.6"
|
|
26
|
+
},
|
|
27
|
+
"public_entrypoints": [
|
|
28
|
+
"https://frontofhouse.okii.uk",
|
|
29
|
+
"https://frontofhouse.okii.uk/llms.txt",
|
|
30
|
+
"npx --yes @f-o-h/cli@latest"
|
|
31
|
+
],
|
|
32
|
+
"commands_run": [
|
|
33
|
+
"npx --yes @f-o-h/cli@latest --version",
|
|
34
|
+
"npx --yes @f-o-h/cli@latest setup --help",
|
|
35
|
+
"npx --yes @f-o-h/cli@latest prove --help"
|
|
36
|
+
],
|
|
37
|
+
"docs_pages_used": [
|
|
38
|
+
"https://frontofhouse.okii.uk/guides/cli-install-and-upgrade",
|
|
39
|
+
"https://frontofhouse.okii.uk/guides/error-handling-and-debugging"
|
|
40
|
+
],
|
|
41
|
+
"artifacts": {
|
|
42
|
+
"terminal_transcript": "terminal-transcript.txt",
|
|
43
|
+
"proof_bundle": null,
|
|
44
|
+
"replay_packet": null,
|
|
45
|
+
"knowledge_packet": null,
|
|
46
|
+
"improvement_packet": "improvement-packet.json",
|
|
47
|
+
"notes": "notes.md"
|
|
48
|
+
},
|
|
49
|
+
"summary": "Agent installed the CLI but could not identify the shortest widget proof path without human direction.",
|
|
50
|
+
"next_commands": [
|
|
51
|
+
"foh bug improve --from external-agent-run --file run.json --out improvement-packet.json --json"
|
|
52
|
+
]
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://frontofhouse.okii.uk/schemas/external-agent-run.schema.json",
|
|
4
|
+
"title": "FOH External Agent Run",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"schema_version",
|
|
8
|
+
"run_id",
|
|
9
|
+
"status",
|
|
10
|
+
"model_provider",
|
|
11
|
+
"model_name",
|
|
12
|
+
"prompt_version",
|
|
13
|
+
"started_at",
|
|
14
|
+
"manual_intervention_count",
|
|
15
|
+
"environment",
|
|
16
|
+
"public_entrypoints",
|
|
17
|
+
"commands_run",
|
|
18
|
+
"docs_pages_used",
|
|
19
|
+
"artifacts"
|
|
20
|
+
],
|
|
21
|
+
"properties": {
|
|
22
|
+
"schema_version": { "const": "external_agent_run.v1" },
|
|
23
|
+
"run_id": { "type": "string", "minLength": 1 },
|
|
24
|
+
"status": { "type": "string", "enum": ["pass", "hold", "fail"] },
|
|
25
|
+
"failure_reason_code": { "type": ["string", "null"] },
|
|
26
|
+
"model_provider": { "type": "string", "minLength": 1 },
|
|
27
|
+
"model_name": { "type": "string", "minLength": 1 },
|
|
28
|
+
"agent_shell": { "type": "string" },
|
|
29
|
+
"workspace_type": { "type": "string" },
|
|
30
|
+
"prompt_version": { "type": "string", "minLength": 1 },
|
|
31
|
+
"prompt_path": { "type": "string" },
|
|
32
|
+
"started_at": { "type": "string" },
|
|
33
|
+
"ended_at": { "type": ["string", "null"] },
|
|
34
|
+
"manual_intervention_count": { "type": "integer", "minimum": 0 },
|
|
35
|
+
"manual_interventions": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"at": { "type": "string" },
|
|
41
|
+
"summary": { "type": "string" }
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"environment": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["os", "foh_cli_version"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"os": { "type": "string", "minLength": 1 },
|
|
51
|
+
"node_version": { "type": ["string", "null"] },
|
|
52
|
+
"npm_version": { "type": ["string", "null"] },
|
|
53
|
+
"foh_cli_version": { "type": "string", "minLength": 1 }
|
|
54
|
+
},
|
|
55
|
+
"additionalProperties": true
|
|
56
|
+
},
|
|
57
|
+
"public_entrypoints": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"minItems": 1,
|
|
60
|
+
"items": { "type": "string", "minLength": 1 }
|
|
61
|
+
},
|
|
62
|
+
"commands_run": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": { "type": "string" }
|
|
65
|
+
},
|
|
66
|
+
"docs_pages_used": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": { "type": "string" }
|
|
69
|
+
},
|
|
70
|
+
"artifacts": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"terminal_transcript": { "type": ["string", "null"] },
|
|
74
|
+
"proof_bundle": { "type": ["string", "null"] },
|
|
75
|
+
"replay_packet": { "type": ["string", "null"] },
|
|
76
|
+
"knowledge_packet": { "type": ["string", "null"] },
|
|
77
|
+
"improvement_packet": { "type": ["string", "null"] },
|
|
78
|
+
"notes": { "type": ["string", "null"] }
|
|
79
|
+
},
|
|
80
|
+
"additionalProperties": true
|
|
81
|
+
},
|
|
82
|
+
"summary": { "type": "string" },
|
|
83
|
+
"next_commands": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": { "type": "string" }
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"additionalProperties": true,
|
|
89
|
+
"allOf": [
|
|
90
|
+
{
|
|
91
|
+
"if": { "properties": { "status": { "enum": ["hold", "fail"] } }, "required": ["status"] },
|
|
92
|
+
"then": { "required": ["failure_reason_code"] }
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"source_type": {
|
|
20
20
|
"type": "string",
|
|
21
21
|
"enum": [
|
|
22
|
+
"external_agent_run",
|
|
22
23
|
"setup_failure",
|
|
23
24
|
"proof_failure",
|
|
24
25
|
"replay_failure",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"reason_code": { "type": "string", "minLength": 1 },
|
|
31
32
|
"promotion_decision": {
|
|
32
33
|
"type": "string",
|
|
33
|
-
"enum": ["ignore", "fix_docs", "fix_config", "fix_runtime", "add_test"]
|
|
34
|
+
"enum": ["ignore", "fix_docs", "fix_config", "fix_cli", "fix_api", "fix_runtime", "add_test"]
|
|
34
35
|
},
|
|
35
36
|
"ids": {
|
|
36
37
|
"type": "object",
|
|
@@ -74,3 +75,4 @@
|
|
|
74
75
|
},
|
|
75
76
|
"additionalProperties": false
|
|
76
77
|
}
|
|
78
|
+
|