@letra-ai/cli 0.6.1 → 0.6.2
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/{chunk-4QDEU6KP.js → chunk-DMOLJWWW.js} +595 -39
- package/dist/{chunk-ELBTIPYN.js → chunk-H64RC3YS.js} +2 -4
- package/dist/{chunk-BTPFUKHG.js → chunk-L6YKDTAQ.js} +1 -1
- package/dist/{chunk-IEFSLCJL.js → chunk-OIHMDOIN.js} +491 -2
- package/dist/{chunk-KGQLHMGZ.js → chunk-URUC6ZZP.js} +300 -13
- package/dist/client/assets/index-EyRsq1SH.css +1 -0
- package/dist/client/assets/index-WfKR7Xp6.js +232 -0
- package/dist/client/index.html +2 -2
- package/dist/{fallback-UXSZ4LNR.js → fallback-MQLGS4KL.js} +1 -2
- package/dist/{flow-serve-MTB6KZMR.js → flow-serve-G5MSSB3G.js} +4 -5
- package/dist/{generate-N22QOXUF.js → generate-UPFERQMD.js} +1 -1
- package/dist/harness/default/v0.2.0/flows/flow-main.yaml +3 -1
- package/dist/harness/default/v0.2.0/gates/human-approved.yaml +3 -3
- package/dist/harness/default/v0.2.0/gates/spec-approved.yaml +3 -3
- package/dist/index.js +34 -17
- package/dist/{push-5JEYSXBY.js → push-VJRSQGUD.js} +1 -1
- package/dist/{server-FUP3APZA.js → server-P6GKRWDX.js} +17 -9
- package/dist/service-2JN2KI4D.js +29 -0
- package/dist/{sitrep-DJXTP3JO.js → sitrep-OKNZJICV.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-MSF44WWE.js +0 -443
- package/dist/chunk-QIVKP3EY.js +0 -362
- package/dist/client/assets/index-BuABgOyz.js +0 -232
- package/dist/client/assets/index-CpseCZh9.css +0 -1
- package/dist/service-OGF7BMCQ.js +0 -21
package/dist/client/index.html
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
rel="stylesheet"
|
|
17
17
|
/>
|
|
18
18
|
<title>Letra. Da intenção à entrega</title>
|
|
19
|
-
<script type="module" crossorigin src="./assets/index-
|
|
20
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
19
|
+
<script type="module" crossorigin src="./assets/index-WfKR7Xp6.js"></script>
|
|
20
|
+
<link rel="stylesheet" crossorigin href="./assets/index-EyRsq1SH.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<div id="root"></div>
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
FlowServer,
|
|
4
4
|
flowServeAction
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-4QDEU6KP.js";
|
|
5
|
+
} from "./chunk-URUC6ZZP.js";
|
|
6
|
+
import "./chunk-H64RC3YS.js";
|
|
7
|
+
import "./chunk-L6YKDTAQ.js";
|
|
8
|
+
import "./chunk-DMOLJWWW.js";
|
|
10
9
|
import "./chunk-BKAUN5QH.js";
|
|
11
10
|
import "./chunk-JMIC5NKB.js";
|
|
12
11
|
import "./chunk-EDD55PWL.js";
|
|
@@ -186,7 +186,9 @@ stages:
|
|
|
186
186
|
description: Security agent analyzes vulnerabilities and dependencies.
|
|
187
187
|
agents:
|
|
188
188
|
- security
|
|
189
|
-
|
|
189
|
+
# Security checks run automatically; the final transition to Done is
|
|
190
|
+
# released only by the human-approved gate handled by the UI/API.
|
|
191
|
+
gate: human-approved
|
|
190
192
|
preferredExecutor: opencode
|
|
191
193
|
phases:
|
|
192
194
|
initialState: scan
|
|
@@ -5,6 +5,6 @@ blocking: true
|
|
|
5
5
|
blocksHandoff: true
|
|
6
6
|
description: Final human approval before marking item as done.
|
|
7
7
|
decisions:
|
|
8
|
-
approve:
|
|
9
|
-
request-changes:
|
|
10
|
-
reject:
|
|
8
|
+
approve: done
|
|
9
|
+
request-changes: code
|
|
10
|
+
reject: backlog
|
|
@@ -5,6 +5,6 @@ blocking: true
|
|
|
5
5
|
blocksHandoff: true
|
|
6
6
|
description: Human approves the spec before implementation begins.
|
|
7
7
|
decisions:
|
|
8
|
-
approve:
|
|
9
|
-
request-changes:
|
|
10
|
-
reject:
|
|
8
|
+
approve: code
|
|
9
|
+
request-changes: design
|
|
10
|
+
reject: backlog
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
activityOperation,
|
|
3
4
|
validate
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OIHMDOIN.js";
|
|
5
6
|
import {
|
|
6
7
|
buildActivityContext,
|
|
7
8
|
flowServeAction,
|
|
@@ -9,17 +10,14 @@ import {
|
|
|
9
10
|
pulse_default,
|
|
10
11
|
sync_default,
|
|
11
12
|
validateSpecStructure
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-URUC6ZZP.js";
|
|
13
14
|
import {
|
|
14
15
|
GateChecker,
|
|
15
16
|
writeFocusWithRecommendations
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
resolveActiveFlow
|
|
19
|
-
} from "./chunk-MSF44WWE.js";
|
|
17
|
+
} from "./chunk-H64RC3YS.js";
|
|
20
18
|
import {
|
|
21
19
|
sitrep_default
|
|
22
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-L6YKDTAQ.js";
|
|
23
21
|
import {
|
|
24
22
|
DEFAULT_HARNESS_VERSION,
|
|
25
23
|
DiagnosticEngine,
|
|
@@ -27,10 +25,11 @@ import {
|
|
|
27
25
|
generateAdapters,
|
|
28
26
|
loadHarness,
|
|
29
27
|
loadWorkflow,
|
|
28
|
+
resolveActiveFlow,
|
|
30
29
|
resolveHarnessRoot,
|
|
31
30
|
saveWorkflow,
|
|
32
31
|
writeWorkflow
|
|
33
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-DMOLJWWW.js";
|
|
34
33
|
import {
|
|
35
34
|
logEntry,
|
|
36
35
|
pruneSessionLog,
|
|
@@ -2032,10 +2031,11 @@ function flowCommand() {
|
|
|
2032
2031
|
cmd.command("import <file>").description("Import workflow from a JSON file").action((file) => {
|
|
2033
2032
|
flowImportAction(void 0, file);
|
|
2034
2033
|
});
|
|
2035
|
-
cmd.command("serve").option("--port <number>", "Port to listen on", "3000").option("--open", "Open browser automatically").description("Start local web server with live board").action((options) => {
|
|
2034
|
+
cmd.command("serve").option("--port <number>", "Port to listen on", "3000").option("--open", "Open browser automatically").option("--autopilot", "Enable deterministic semiautonomous dispatcher (human gates still block)").description("Start local web server with live board").action((options) => {
|
|
2036
2035
|
flowServeAction(void 0, {
|
|
2037
2036
|
port: options.port ? Number(options.port) : void 0,
|
|
2038
|
-
open: options.open
|
|
2037
|
+
open: options.open,
|
|
2038
|
+
autopilot: options.autopilot
|
|
2039
2039
|
});
|
|
2040
2040
|
});
|
|
2041
2041
|
cmd.command("visualize").option("--output <file>", "Save diagram to file").description("Generate Mermaid diagram of workflow").action((options) => {
|
|
@@ -2653,7 +2653,7 @@ import { resolve as resolve21 } from "path";
|
|
|
2653
2653
|
import { Command as Command8 } from "commander";
|
|
2654
2654
|
function directionCommand() {
|
|
2655
2655
|
return new Command8("direction").description("Read the current harness direction through the degraded CLI fallback").option("--json", "Output the complete structured snapshot").action(async (options) => {
|
|
2656
|
-
const { resolveFallbackDirection } = await import("./fallback-
|
|
2656
|
+
const { resolveFallbackDirection } = await import("./fallback-MQLGS4KL.js");
|
|
2657
2657
|
const direction = resolveFallbackDirection(resolve21(process.cwd()));
|
|
2658
2658
|
if (options.json) {
|
|
2659
2659
|
process.stdout.write(`${JSON.stringify(direction, null, 2)}
|
|
@@ -2673,7 +2673,7 @@ import { Command as Command9 } from "commander";
|
|
|
2673
2673
|
function mcpCommand() {
|
|
2674
2674
|
const command = new Command9("mcp").description("Expose Letra harness capabilities through MCP");
|
|
2675
2675
|
command.command("serve").option("--stdio", "Use the local stdio transport").description("Start the local read-only Letra MCP server").action(async () => {
|
|
2676
|
-
const { startLetraMcpServer } = await import("./server-
|
|
2676
|
+
const { startLetraMcpServer } = await import("./server-P6GKRWDX.js");
|
|
2677
2677
|
await startLetraMcpServer(resolve22(process.cwd()));
|
|
2678
2678
|
});
|
|
2679
2679
|
return command;
|
|
@@ -2693,21 +2693,38 @@ function operationCommand() {
|
|
|
2693
2693
|
const command = new Command10("operation").description(
|
|
2694
2694
|
"Execute controlled harness operations with structured JSON results"
|
|
2695
2695
|
);
|
|
2696
|
+
command.command("event <item-id>").requiredOption("--status <status>", "started, heartbeat, succeeded ou failed").requiredOption("--executor <executor-id>", "Executor externo").requiredOption("--expected-revision <revision>", "Direction revision returned by Letra").requiredOption("--reason <reason>", "Reason for the operation").option("--actor <actor>", "Identidade do actor", "agent:codex").option("--message <message>", "Mensagem do evento").option("--recovery <recovery>", "retry, release, handoff ou human").option("--error-code <code>", "C\xF3digo da falha").action(async (itemId, options) => {
|
|
2697
|
+
const { recordExecutionEvent } = await import("./service-2JN2KI4D.js");
|
|
2698
|
+
printJson(await recordExecutionEvent(resolve23(process.cwd()), { itemId, status: options.status, executorId: options.executor, expectedRevision: options.expectedRevision, reason: options.reason, actor: options.actor, message: options.message, recovery: options.recovery, errorCode: options.errorCode }));
|
|
2699
|
+
});
|
|
2700
|
+
command.command("claim <item-id>").requiredOption("--executor <executor-id>", "Executor externo").requiredOption("--capability <capability>", "Capability usada").requiredOption("--expected-revision <revision>", "Direction revision returned by Letra").requiredOption("--reason <reason>", "Reason for the operation").option("--actor <actor>", "Identidade do actor", "agent:codex").option("--ttl <minutes>", "TTL do claim em minutos", (value) => Number(value), 30).action(async (itemId, options) => {
|
|
2701
|
+
const { claimOperation } = await import("./service-2JN2KI4D.js");
|
|
2702
|
+
printJson(await claimOperation(resolve23(process.cwd()), { itemId, executorId: options.executor, capability: options.capability, expectedRevision: options.expectedRevision, reason: options.reason, actor: options.actor, ttlMinutes: options.ttl }));
|
|
2703
|
+
});
|
|
2696
2704
|
command.command("validate").requiredOption("--expected-revision <revision>", "Direction revision returned by Letra").requiredOption("--reason <reason>", "Reason for the operation").action(async (options) => {
|
|
2697
|
-
const { runValidationOperation } = await import("./service-
|
|
2705
|
+
const { runValidationOperation } = await import("./service-2JN2KI4D.js");
|
|
2698
2706
|
printJson(await runValidationOperation(resolve23(process.cwd()), options));
|
|
2699
2707
|
});
|
|
2708
|
+
command.command("activity [item-id]").action((itemId) => printJson(activityOperation(resolve23(process.cwd()), itemId)));
|
|
2709
|
+
command.command("evidence <item-id>").requiredOption("--executor <executor-id>", "Executor externo").requiredOption("--expected-revision <revision>", "Direction revision").requiredOption("--reason <reason>", "Reason").requiredOption("--kind <kind>", "diff, file, command, test ou artifact").requiredOption("--value <value>", "Valor/path").requiredOption("--source <source>", "Origem observada").option("--actor <actor>", "Actor", "agent:codex").action(async (itemId, options) => {
|
|
2710
|
+
const { submitEvidenceOperation } = await import("./service-2JN2KI4D.js");
|
|
2711
|
+
printJson(await submitEvidenceOperation(resolve23(process.cwd()), { itemId, executorId: options.executor, expectedRevision: options.expectedRevision, reason: options.reason, actor: options.actor, evidence: [{ kind: options.kind, value: options.value, source: options.source }] }));
|
|
2712
|
+
});
|
|
2713
|
+
command.command("handoff <item-id>").requiredOption("--to <actor>", "Destino").requiredOption("--executor <executor-id>", "Executor").requiredOption("--summary <summary>", "Resumo").requiredOption("--expected-revision <revision>", "Direction revision").requiredOption("--reason <reason>", "Reason").option("--actor <actor>", "Actor", "agent:codex").action(async (itemId, options) => {
|
|
2714
|
+
const { requestHandoffOperation } = await import("./service-2JN2KI4D.js");
|
|
2715
|
+
printJson(await requestHandoffOperation(resolve23(process.cwd()), { itemId, to: options.to, executorId: options.executor, summary: options.summary, evidence: [], expectedRevision: options.expectedRevision, reason: options.reason, actor: options.actor }));
|
|
2716
|
+
});
|
|
2700
2717
|
command.command("complete-ac <ac-id>").requiredOption("--expected-revision <revision>", "Direction revision returned by Letra").requiredOption("--reason <reason>", "Reason for completing the criterion").addOption(
|
|
2701
2718
|
new Option("--evidence <evidence>", "Regression evidence").argParser(collectEvidence).default([])
|
|
2702
2719
|
).action(
|
|
2703
2720
|
async (acId, options) => {
|
|
2704
|
-
const { completeAcOperation } = await import("./service-
|
|
2721
|
+
const { completeAcOperation } = await import("./service-2JN2KI4D.js");
|
|
2705
2722
|
printJson(completeAcOperation(resolve23(process.cwd()), { acId, ...options }));
|
|
2706
2723
|
}
|
|
2707
2724
|
);
|
|
2708
2725
|
command.command("request-transition <item-id>").requiredOption("--to <stage-id>", "Target stage ID").requiredOption("--expected-revision <revision>", "Direction revision returned by Letra").requiredOption("--reason <reason>", "Reason for requesting the transition").action(
|
|
2709
2726
|
async (itemId, options) => {
|
|
2710
|
-
const { requestTransitionOperation } = await import("./service-
|
|
2727
|
+
const { requestTransitionOperation } = await import("./service-2JN2KI4D.js");
|
|
2711
2728
|
printJson(
|
|
2712
2729
|
await requestTransitionOperation(resolve23(process.cwd()), {
|
|
2713
2730
|
itemId,
|
|
@@ -3766,7 +3783,7 @@ program.command("setup [path]").option("--port <number>", "Port for the web UI",
|
|
|
3766
3783
|
Starting web UI on port ${port}...
|
|
3767
3784
|
`);
|
|
3768
3785
|
const root = resolve30(process.cwd(), path ?? ".");
|
|
3769
|
-
const { FlowServer } = await import("./flow-serve-
|
|
3786
|
+
const { FlowServer } = await import("./flow-serve-G5MSSB3G.js");
|
|
3770
3787
|
const server = new FlowServer(root, port);
|
|
3771
3788
|
try {
|
|
3772
3789
|
await server.start();
|
|
@@ -3807,7 +3824,7 @@ program.addCommand(directionCommand());
|
|
|
3807
3824
|
program.addCommand(mcpCommand());
|
|
3808
3825
|
program.addCommand(operationCommand());
|
|
3809
3826
|
program.addCommand(decisionCommand());
|
|
3810
|
-
program.command("push [path]").option("--dry-run", "Show what would be pushed without writing").description("Sync workspace artifacts to target repository").action((path, options) => import("./push-
|
|
3827
|
+
program.command("push [path]").option("--dry-run", "Show what would be pushed without writing").description("Sync workspace artifacts to target repository").action((path, options) => import("./push-VJRSQGUD.js").then((m) => m.push(path, options)));
|
|
3811
3828
|
program.addCommand(flowCommand());
|
|
3812
3829
|
program.addCommand(focus_default());
|
|
3813
3830
|
program.addCommand(health_default());
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
activityOperation,
|
|
4
|
+
claimOperation,
|
|
3
5
|
completeAcOperation,
|
|
6
|
+
recordExecutionEvent,
|
|
7
|
+
requestHandoffOperation,
|
|
4
8
|
requestTransitionOperation,
|
|
5
|
-
runValidationOperation
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "./chunk-
|
|
9
|
+
runValidationOperation,
|
|
10
|
+
submitEvidenceOperation
|
|
11
|
+
} from "./chunk-OIHMDOIN.js";
|
|
12
|
+
import "./chunk-H64RC3YS.js";
|
|
9
13
|
import {
|
|
14
|
+
createWorkspaceBoundary,
|
|
10
15
|
loadHarnessForWorkflow,
|
|
16
|
+
loadWorkflow,
|
|
11
17
|
resolveActiveFlowFor,
|
|
12
18
|
resolveAgentDirection
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
createWorkspaceBoundary,
|
|
16
|
-
loadWorkflow
|
|
17
|
-
} from "./chunk-4QDEU6KP.js";
|
|
19
|
+
} from "./chunk-DMOLJWWW.js";
|
|
18
20
|
import {
|
|
19
21
|
logEntry
|
|
20
22
|
} from "./chunk-BKAUN5QH.js";
|
|
@@ -229,6 +231,12 @@ function createLetraMcpServer(root) {
|
|
|
229
231
|
})
|
|
230
232
|
)
|
|
231
233
|
);
|
|
234
|
+
server.registerTool("get_context", { description: "Retorna contexto operacional can\xF4nico.", annotations: readOnlyAnnotations }, async () => jsonText(auditRead("context")));
|
|
235
|
+
server.registerTool("get_activity", { description: "Retorna atividade operacional vigente.", inputSchema: { itemId: z.string().optional() }, annotations: readOnlyAnnotations }, async ({ itemId }) => jsonText(activityOperation(workspaceRoot, itemId)));
|
|
236
|
+
server.registerTool("claim", { description: "Solicita claim exclusivo.", inputSchema: { itemId: z.string(), executorId: z.string(), capability: z.string(), expectedRevision, reason, ttlMinutes: z.number().optional() }, annotations: mutationAnnotations }, async (input) => jsonText(await claimOperation(workspaceRoot, { ...input, actor: clientIdentity().actor })));
|
|
237
|
+
server.registerTool("execution_event", { description: "Registra started, heartbeat, succeeded ou failed.", inputSchema: { itemId: z.string(), status: z.enum(["started", "heartbeat", "succeeded", "failed"]), executorId: z.string(), expectedRevision, reason, message: z.string().optional(), recovery: z.enum(["retry", "release", "handoff", "human"]).optional(), errorCode: z.string().optional() }, annotations: mutationAnnotations }, async (input) => jsonText(await recordExecutionEvent(workspaceRoot, { ...input, actor: clientIdentity().actor })));
|
|
238
|
+
server.registerTool("submit_evidence", { description: "Registra evid\xEAncia estruturada confinada.", inputSchema: { itemId: z.string(), executorId: z.string(), expectedRevision, reason, evidence: z.array(z.object({ kind: z.enum(["diff", "file", "command", "test", "artifact"]), value: z.string(), source: z.string(), observedAt: z.string().optional(), sha256: z.string().optional(), exitCode: z.number().optional() })) }, annotations: mutationAnnotations }, async (input) => jsonText(await submitEvidenceOperation(workspaceRoot, { ...input, actor: clientIdentity().actor })));
|
|
239
|
+
server.registerTool("request_handoff", { description: "Solicita handoff at\xF4mico.", inputSchema: { itemId: z.string(), to: z.string(), executorId: z.string(), summary: z.string(), evidence: z.array(z.string()), expectedRevision, reason }, annotations: mutationAnnotations }, async (input) => jsonText(await requestHandoffOperation(workspaceRoot, { ...input, actor: clientIdentity().actor })));
|
|
232
240
|
server.registerResource(
|
|
233
241
|
"direction",
|
|
234
242
|
"letra://direction",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
activityOperation,
|
|
4
|
+
claimOperation,
|
|
5
|
+
completeAcOperation,
|
|
6
|
+
recordExecutionEvent,
|
|
7
|
+
requestHandoffOperation,
|
|
8
|
+
requestTransitionOperation,
|
|
9
|
+
runValidationOperation,
|
|
10
|
+
submitEvidenceOperation
|
|
11
|
+
} from "./chunk-OIHMDOIN.js";
|
|
12
|
+
import "./chunk-H64RC3YS.js";
|
|
13
|
+
import "./chunk-DMOLJWWW.js";
|
|
14
|
+
import "./chunk-BKAUN5QH.js";
|
|
15
|
+
import "./chunk-JMIC5NKB.js";
|
|
16
|
+
import "./chunk-EDD55PWL.js";
|
|
17
|
+
import "./chunk-MJ2QXNH6.js";
|
|
18
|
+
import "./chunk-6HSUVCTR.js";
|
|
19
|
+
import "./chunk-PDX44BCA.js";
|
|
20
|
+
export {
|
|
21
|
+
activityOperation,
|
|
22
|
+
claimOperation,
|
|
23
|
+
completeAcOperation,
|
|
24
|
+
recordExecutionEvent,
|
|
25
|
+
requestHandoffOperation,
|
|
26
|
+
requestTransitionOperation,
|
|
27
|
+
runValidationOperation,
|
|
28
|
+
submitEvidenceOperation
|
|
29
|
+
};
|