@maiaos/cli 0.1.0-canary.30 → 0.1.0-canary.31
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/bin/maia.cdx.json +19 -19
- package/dist/bin/maia.mjs +1 -1
- package/dist/command-line/index.d.ts +1 -1
- package/dist/command-line/index.js +1 -1
- package/dist/command-line/rows.d.ts +1 -0
- package/dist/command-line/rows.js +3 -0
- package/dist/command-receipt/command.js +1 -1
- package/dist/session/output/human.js +3 -2
- package/dist/terminal/output/compact-list.d.ts +1 -0
- package/dist/terminal/output/compact-list.js +3 -0
- package/dist/terminal/output/human.js +2 -2
- package/package.json +4 -4
|
@@ -2,6 +2,6 @@ export { type CliDependencies, type CliServices, type CommandContext, type Comma
|
|
|
2
2
|
export { argumentsAreBounded, type ArgumentToken, CliArgumentError, missingArgument, parseArguments, type ParsedArguments, type ParsedOptions, parseOptions, parseOptionsWith, readBoundedStdin, readCursor, readDuration, readExpectedRevision, readGlobalValue, readPageSize, readRevisionOption, readWaitTimeoutSeconds, recoverStdin, requireNoArguments, requirePositionals, tokenizeArguments, unknownCommand, } from "./input/index.js";
|
|
3
3
|
export { decodeJsonText, jsonLine } from "./json.js";
|
|
4
4
|
export { type CliCommandOutput, type CliErrorOutput, type CliIo, type CliResolution, type CliSuccessOutput, type CliSuccessResult, exitCodeOf, type NodeResultPresenter, reportError, writeNodeResult, writeSuccess, } from "./output.js";
|
|
5
|
-
export { block, cell, type CliTable, fields, formatRows, tab, withNextPage, } from "./rows.js";
|
|
5
|
+
export { block, cell, type CliTable, fields, formatRows, tab, withNextPage, withPrunedHistory, } from "./rows.js";
|
|
6
6
|
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, type TwoPhaseMode, } from "./two-phase.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,6 +2,6 @@ export { LOCAL_NODE, } from "./context.js";
|
|
|
2
2
|
export { argumentsAreBounded, CliArgumentError, missingArgument, parseArguments, parseOptions, parseOptionsWith, readBoundedStdin, readCursor, readDuration, readExpectedRevision, readGlobalValue, readPageSize, readRevisionOption, readWaitTimeoutSeconds, recoverStdin, requireNoArguments, requirePositionals, tokenizeArguments, unknownCommand, } from "./input/index.js";
|
|
3
3
|
export { decodeJsonText, jsonLine } from "./json.js";
|
|
4
4
|
export { exitCodeOf, reportError, writeNodeResult, writeSuccess, } from "./output.js";
|
|
5
|
-
export { block, cell, fields, formatRows, tab, withNextPage, } from "./rows.js";
|
|
5
|
+
export { block, cell, fields, formatRows, tab, withNextPage, withPrunedHistory, } from "./rows.js";
|
|
6
6
|
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, } from "./two-phase.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -8,5 +8,6 @@ export type CliTable = {
|
|
|
8
8
|
readonly headers: readonly string[];
|
|
9
9
|
};
|
|
10
10
|
export declare const formatRows: <TValue>(items: readonly TValue[], format: (value: TValue) => string, text?: CliTable | string) => string;
|
|
11
|
+
export declare const withPrunedHistory: (text: string, oldest?: string) => string;
|
|
11
12
|
export declare const withNextPage: (text: string, nextCursor?: string) => string;
|
|
12
13
|
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -37,5 +37,8 @@ export const formatRows = (items, format, text) => {
|
|
|
37
37
|
? align([text.headers, ...lines.map((line) => line.split("\t"))])
|
|
38
38
|
: `${lines.join("\n")}\n`;
|
|
39
39
|
};
|
|
40
|
+
export const withPrunedHistory = (text, oldest) => oldest === undefined
|
|
41
|
+
? text
|
|
42
|
+
: `earlier history pruned; oldest retained cursor ${oldest}\n${text}`;
|
|
40
43
|
export const withNextPage = (text, nextCursor) => nextCursor === undefined ? text : `${text}next: --after ${nextCursor}\n`;
|
|
41
44
|
//# sourceMappingURL=rows.js.map
|
|
@@ -53,7 +53,7 @@ export const runReceiptShow = (tokens, context) => Effect.gen(function* () {
|
|
|
53
53
|
command: "receipt.show",
|
|
54
54
|
result: value,
|
|
55
55
|
}),
|
|
56
|
-
toText: ({ result: { receipt } }) => `${receipt.receiptId}\t${receipt.state}\t${receipt.target.type}:${receipt.target.id}\n`,
|
|
56
|
+
toText: ({ result: { eventsPruned, receipt } }) => `${receipt.receiptId}\t${receipt.state}\t${receipt.target.type}:${receipt.target.id}${eventsPruned === true ? "\tevents-pruned" : ""}\n`,
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
//# sourceMappingURL=command.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cell, fields, formatRows, tab, writeNodeResult, } from "../../command-line/index.js";
|
|
1
|
+
import { cell, fields, formatRows, tab, withPrunedHistory, writeNodeResult, } from "../../command-line/index.js";
|
|
2
2
|
import { formatSessionDiff } from "./diff.js";
|
|
3
3
|
import { formatFailure, formatSessionEvents } from "./failure.js";
|
|
4
4
|
import { formatSessionObservation } from "./observe.js";
|
|
@@ -45,6 +45,7 @@ const formatLifecycle = ({ revision, sessionId, state, }) => `${fields([
|
|
|
45
45
|
const formatSessions = (result) => result.items.length === 0 ? "No Sessions.\n" : formatSessionList(result);
|
|
46
46
|
const formatInboxAck = ({ delivery, deliveryRecord, mailboxRevision, }) => `${tab([deliveryRecord.deliveryId, delivery, mailboxRevision])}\n`;
|
|
47
47
|
const formatMessageSend = ({ delivery, deliveryId, sequence, }) => `${tab([deliveryId, delivery, sequence])}\n`;
|
|
48
|
+
const formatEventsPage = ({ items, oldestRetainedCursor, }) => withPrunedHistory(formatSessionEvents(items), oldestRetainedCursor);
|
|
48
49
|
export const formatSessionResult = (result) => {
|
|
49
50
|
switch (result.command) {
|
|
50
51
|
case "session.agent-permission.confirm":
|
|
@@ -56,7 +57,7 @@ export const formatSessionResult = (result) => {
|
|
|
56
57
|
case "session.diff":
|
|
57
58
|
return formatCodingSession(result);
|
|
58
59
|
case "session.events.list":
|
|
59
|
-
return
|
|
60
|
+
return formatEventsPage(result.result);
|
|
60
61
|
case "session.inbox.ack":
|
|
61
62
|
return formatInboxAck(result.result);
|
|
62
63
|
case "session.inbox.check":
|
|
@@ -120,6 +120,7 @@ export type CliTerminalEventsResult<TAudience extends CliOutputAudience = "json"
|
|
|
120
120
|
readonly headCursor: TerminalEventsListResult["headTerminalCursor"];
|
|
121
121
|
readonly items: readonly CliTerminalEvent<TAudience>[];
|
|
122
122
|
readonly nextCursor?: TerminalEventsListResult["nextTerminalCursor"];
|
|
123
|
+
readonly oldestRetainedCursor?: TerminalEventsListResult["oldestRetainedCursor"];
|
|
123
124
|
readonly terminalId: TerminalEventsListResult["terminalId"];
|
|
124
125
|
};
|
|
125
126
|
type CliTerminalChunk = {
|
|
@@ -132,6 +132,9 @@ export const projectTerminalEventsResult = (value, audience = "json") => ({
|
|
|
132
132
|
...(value.nextTerminalCursor === undefined
|
|
133
133
|
? {}
|
|
134
134
|
: { nextCursor: value.nextTerminalCursor }),
|
|
135
|
+
...(value.oldestRetainedCursor === undefined
|
|
136
|
+
? {}
|
|
137
|
+
: { oldestRetainedCursor: value.oldestRetainedCursor }),
|
|
135
138
|
terminalId: value.terminalId,
|
|
136
139
|
});
|
|
137
140
|
export const projectTerminalChunk = (chunk) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cell, formatRows, jsonLine, writeNodeResult, } from "../../command-line/index.js";
|
|
1
|
+
import { cell, formatRows, jsonLine, withPrunedHistory, writeNodeResult, } from "../../command-line/index.js";
|
|
2
2
|
const isHumanLiveTerminal = (terminal) => terminal.state !== "unavailable" && "capability" in terminal;
|
|
3
3
|
const formatTerminalProjection = (terminal) => {
|
|
4
4
|
if (terminal.state === "unavailable") {
|
|
@@ -21,7 +21,7 @@ const formatTerminalEvent = (event) => {
|
|
|
21
21
|
}
|
|
22
22
|
return `${cell(event.cursor)}\t${cell(event.type)}`;
|
|
23
23
|
};
|
|
24
|
-
export const formatTerminalEvents = (result) => formatRows(result.items, formatTerminalEvent);
|
|
24
|
+
export const formatTerminalEvents = (result) => withPrunedHistory(formatRows(result.items, formatTerminalEvent), result.oldestRetainedCursor);
|
|
25
25
|
export const formatTerminalRead = (result) => (result.gap === undefined
|
|
26
26
|
? ""
|
|
27
27
|
: `gap\t${result.gap.reason}\t${cell(result.gap.oldestAvailableCursor)}\n`) +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maiaos/cli",
|
|
3
|
-
"version": "0.1.0-canary.
|
|
3
|
+
"version": "0.1.0-canary.31",
|
|
4
4
|
"description": "The maia CLI and MCP server: start, drive, observe and stop swarms of Claude Code and Codex agents from a terminal, a script or another agent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maia",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@earendil-works/pi-tui": "1.0.0",
|
|
66
66
|
"@effect/platform-node-shared": "4.0.0",
|
|
67
|
-
"@maiaos/agent": "0.1.0-canary.
|
|
68
|
-
"@maiaos/client-core": "0.1.0-canary.
|
|
69
|
-
"@maiaos/sdk": "0.1.0-canary.
|
|
67
|
+
"@maiaos/agent": "0.1.0-canary.31",
|
|
68
|
+
"@maiaos/client-core": "0.1.0-canary.31",
|
|
69
|
+
"@maiaos/sdk": "0.1.0-canary.31",
|
|
70
70
|
"effect": "4.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|