appduct 0.11.1 → 0.13.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/README.md +43 -38
- package/dist/bin.js +50 -36
- package/dist/cli/command-options.d.ts +7 -17
- package/dist/cli/result-types.d.ts +11 -8
- package/dist/cli/routes/daemon/index.js +12 -16
- package/dist/cli/routes/daemon/run.js +216 -46
- package/dist/cli/routes/daemon/start.js +18 -16
- package/dist/cli/routes/daemon/status.js +18 -16
- package/dist/cli/routes/daemon/stop.js +18 -16
- package/dist/cli/routes/doctor.js +12 -16
- package/dist/cli/routes/events/index.d.ts +9 -0
- package/dist/cli/routes/events/index.js +842 -0
- package/dist/cli/routes/events/shared-options.d.ts +12 -0
- package/dist/cli/routes/events/shared-options.js +102 -0
- package/dist/cli/routes/events/since.d.ts +6 -0
- package/dist/cli/routes/events/since.js +1977 -0
- package/dist/cli/routes/events/tail.d.ts +6 -0
- package/dist/cli/routes/{events.js → events/tail.js} +184 -162
- package/dist/cli/routes/init.js +14 -18
- package/dist/cli/routes/keygen.js +13 -16
- package/dist/cli/routes/mcp.js +193 -175
- package/dist/cli/routes/sessions/index.d.ts +7 -0
- package/dist/cli/routes/sessions/index.js +843 -0
- package/dist/cli/routes/sessions/link.d.ts +4 -0
- package/dist/cli/routes/{link.js → sessions/link.js} +19 -17
- package/dist/cli/routes/sessions/ls.d.ts +4 -0
- package/dist/cli/routes/{ls.js → sessions/ls.js} +19 -17
- package/dist/cli/routes/sessions/revoke.d.ts +4 -0
- package/dist/cli/routes/{revoke.js → sessions/revoke.js} +20 -18
- package/dist/cli/routes/tools/call.d.ts +4 -0
- package/dist/cli/routes/{invoke.js → tools/call.js} +21 -19
- package/dist/cli/routes/tools/describe.d.ts +6 -0
- package/dist/cli/routes/tools/describe.js +1837 -0
- package/dist/cli/routes/tools/index.d.ts +6 -0
- package/dist/cli/routes/tools/index.js +843 -0
- package/dist/cli/routes/tools/ls.d.ts +4 -0
- package/dist/cli/routes/{tools.js → tools/ls.js} +46 -73
- package/dist/cli/routes/tools/shared-options.d.ts +16 -0
- package/dist/cli/routes/tools/shared-options.js +122 -0
- package/dist/client/app-client.d.ts +96 -37
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.js +183 -139
- package/dist/commands/events.d.ts +31 -13
- package/dist/commands/invoke.d.ts +1 -1
- package/dist/commands/link.d.ts +1 -1
- package/dist/commands/ls.d.ts +1 -1
- package/dist/commands/revoke.d.ts +1 -1
- package/dist/commands/tools.d.ts +12 -13
- package/dist/daemon/config.d.ts +5 -2
- package/dist/daemon/daemon.d.ts +3 -0
- package/dist/daemon/event-bus.d.ts +36 -4
- package/dist/daemon/events-log.d.ts +31 -0
- package/dist/daemon/memory-append-only-file.d.ts +17 -0
- package/dist/daemon/node-append-only-file.d.ts +9 -0
- package/dist/daemon/rpc-errors.d.ts +1 -1
- package/dist/daemon/state-dir.d.ts +2 -0
- package/dist/errors.d.ts +1 -1
- package/dist/events/index.d.ts +60 -0
- package/dist/index.js +62 -39
- package/dist/link.d.ts +1 -1
- package/dist/mcp/app-tools.d.ts +3 -2
- package/dist/mcp/connect-tool.d.ts +1 -1
- package/dist/mcp/events-tool.d.ts +28 -34
- package/dist/native-scheme.d.ts +1 -1
- package/dist/output.d.ts +29 -6
- package/dist/rpc/client.d.ts +1 -1
- package/dist/scheme.d.ts +4 -4
- package/package.json +2 -2
- package/dist/cli/routes/events.d.ts +0 -3
- package/dist/cli/routes/invoke.d.ts +0 -3
- package/dist/cli/routes/link.d.ts +0 -3
- package/dist/cli/routes/ls.d.ts +0 -3
- package/dist/cli/routes/revoke.d.ts +0 -3
- package/dist/cli/routes/tools.d.ts +0 -3
|
@@ -49,6 +49,7 @@ var getStateDirPaths = (stateDir) => {
|
|
|
49
49
|
socketPath: join(stateDir, "daemon.sock"),
|
|
50
50
|
pidFilePath: join(stateDir, "daemon.pid"),
|
|
51
51
|
logFilePath: join(stateDir, "daemon.log"),
|
|
52
|
+
eventsLogPath: join(stateDir, "events.log"),
|
|
52
53
|
keyPath: join(stateDir, "key.pem"),
|
|
53
54
|
configPath: join(stateDir, "config.json"),
|
|
54
55
|
auditDir: join(stateDir, "audit"),
|
|
@@ -84,6 +85,7 @@ var KNOWN_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
|
|
|
84
85
|
"eventBufferSize",
|
|
85
86
|
"auditRetentionDays",
|
|
86
87
|
"daemonLogMaxBytes",
|
|
88
|
+
"eventsLogMaxBytes",
|
|
87
89
|
"policy",
|
|
88
90
|
"advertisedIp",
|
|
89
91
|
"scheme",
|
|
@@ -143,6 +145,7 @@ var defaultConfig = (paths) => {
|
|
|
143
145
|
eventBufferSize: 256,
|
|
144
146
|
auditRetentionDays: DEFAULT_AUDIT_RETENTION_DAYS,
|
|
145
147
|
daemonLogMaxBytes: DEFAULT_DAEMON_LOG_MAX_BYTES,
|
|
148
|
+
eventsLogMaxBytes: 10 * 1024 * 1024,
|
|
146
149
|
restartDaemonOnVersionMismatch: false,
|
|
147
150
|
policy: {
|
|
148
151
|
default: "allow",
|
|
@@ -205,6 +208,9 @@ var loadConfig = async (paths, options = {}) => {
|
|
|
205
208
|
if (parsed.daemonLogMaxBytes !== void 0) {
|
|
206
209
|
config.daemonLogMaxBytes = requirePositiveInteger(parsed.daemonLogMaxBytes, "daemonLogMaxBytes");
|
|
207
210
|
}
|
|
211
|
+
if (parsed.eventsLogMaxBytes !== void 0) {
|
|
212
|
+
config.eventsLogMaxBytes = requirePositiveInteger(parsed.eventsLogMaxBytes, "eventsLogMaxBytes");
|
|
213
|
+
}
|
|
208
214
|
if (parsed.restartDaemonOnVersionMismatch !== void 0) {
|
|
209
215
|
config.restartDaemonOnVersionMismatch = requireBoolean(
|
|
210
216
|
parsed.restartDaemonOnVersionMismatch,
|
|
@@ -1159,9 +1165,6 @@ var renderLsData = (colors, data, now) => {
|
|
|
1159
1165
|
...rows.map((row) => ` ${row.map((cell, index) => cell.padEnd(widths[index])).join(" ")}`)
|
|
1160
1166
|
];
|
|
1161
1167
|
};
|
|
1162
|
-
var isToolsListing = (data) => {
|
|
1163
|
-
return typeof data === "object" && data !== null && Array.isArray(data.tools);
|
|
1164
|
-
};
|
|
1165
1168
|
var isToolGroupsListing = (data) => {
|
|
1166
1169
|
return typeof data === "object" && data !== null && Array.isArray(data.groups) && !Array.isArray(data.tools);
|
|
1167
1170
|
};
|
|
@@ -1179,7 +1182,7 @@ var renderEmptyToolsLine = (data) => {
|
|
|
1179
1182
|
}
|
|
1180
1183
|
if (data.group !== void 0) {
|
|
1181
1184
|
const match = data.filter === void 0 ? "" : ` match ${JSON.stringify(data.filter)}`;
|
|
1182
|
-
return ` No tools in group ${JSON.stringify(data.group)}${match}. Run \`appduct tools --groups\` to see the session's groups.`;
|
|
1185
|
+
return ` No tools in group ${JSON.stringify(data.group)}${match}. Run \`appduct tools ls --groups\` to see the session's groups.`;
|
|
1183
1186
|
}
|
|
1184
1187
|
return data.filter === void 0 ? " No tools registered." : ` No tools match ${JSON.stringify(data.filter)}.`;
|
|
1185
1188
|
};
|
|
@@ -1261,7 +1264,7 @@ var renderToolSummaryTable = (colors, data) => {
|
|
|
1261
1264
|
...grouped ? renderGroupedToolLines(colors, data.tools) : data.tools.flatMap((tool) => renderToolSummaryLines(tool, " ")),
|
|
1262
1265
|
...renderTruncationLine(data),
|
|
1263
1266
|
"",
|
|
1264
|
-
"Run `appduct tools <name>` for a tool's full schema."
|
|
1267
|
+
"Run `appduct tools describe <name>` for a tool's full schema."
|
|
1265
1268
|
];
|
|
1266
1269
|
};
|
|
1267
1270
|
var renderToolDetail = (colors, tool, flags) => {
|
|
@@ -1313,16 +1316,13 @@ var renderToolGroups = (colors, data) => {
|
|
|
1313
1316
|
colors.green("Groups"),
|
|
1314
1317
|
...data.groups.map((entry) => ` ${label(entry).padEnd(width)} ${String(entry.total).padStart(countWidth)}`),
|
|
1315
1318
|
"",
|
|
1316
|
-
`${data.total} tool${data.total === 1 ? "" : "s"} in total. ` + (hasAnyGroup(data.groups) ? "Run `appduct tools --group <name>` to list one group's tools." : "No tool declares a group.")
|
|
1319
|
+
`${data.total} tool${data.total === 1 ? "" : "s"} in total. ` + (hasAnyGroup(data.groups) ? "Run `appduct tools ls --group <name>` to list one group's tools." : "No tool declares a group.")
|
|
1317
1320
|
];
|
|
1318
1321
|
};
|
|
1319
|
-
var
|
|
1322
|
+
var renderToolsListData = (colors, data, flags, full) => {
|
|
1320
1323
|
if (isToolGroupsListing(data)) {
|
|
1321
1324
|
return renderToolGroups(colors, data);
|
|
1322
1325
|
}
|
|
1323
|
-
if (!isToolsListing(data)) {
|
|
1324
|
-
return renderToolDetail(colors, data, flags);
|
|
1325
|
-
}
|
|
1326
1326
|
return full ? renderToolsFullListing(colors, data, flags) : renderToolSummaryTable(colors, data);
|
|
1327
1327
|
};
|
|
1328
1328
|
var renderInvokeData = (colors, data, flags) => {
|
|
@@ -1508,15 +1508,17 @@ var renderSuccessData = (colors, command, data, options) => {
|
|
|
1508
1508
|
return renderInitData(colors, data, flags);
|
|
1509
1509
|
case "keygen":
|
|
1510
1510
|
return renderKeygenData(colors, data, flags);
|
|
1511
|
-
case "link":
|
|
1511
|
+
case "sessions link":
|
|
1512
1512
|
return renderLinkData(colors, data, flags, options.qr);
|
|
1513
|
-
case "ls":
|
|
1513
|
+
case "sessions ls":
|
|
1514
1514
|
return renderLsData(colors, data, options.now ?? /* @__PURE__ */ new Date());
|
|
1515
|
-
case "tools":
|
|
1516
|
-
return
|
|
1517
|
-
case "
|
|
1515
|
+
case "tools ls":
|
|
1516
|
+
return renderToolsListData(colors, data, flags, options.full);
|
|
1517
|
+
case "tools describe":
|
|
1518
|
+
return renderToolDetail(colors, data, flags);
|
|
1519
|
+
case "tools call":
|
|
1518
1520
|
return renderInvokeData(colors, data, flags);
|
|
1519
|
-
case "revoke":
|
|
1521
|
+
case "sessions revoke":
|
|
1520
1522
|
return renderRevokeData(colors, data);
|
|
1521
1523
|
case "daemon run":
|
|
1522
1524
|
return renderDaemonRunData(colors, data, flags);
|
|
@@ -575,9 +575,6 @@ var renderLsData = (colors, data, now) => {
|
|
|
575
575
|
...rows.map((row) => ` ${row.map((cell, index) => cell.padEnd(widths[index])).join(" ")}`)
|
|
576
576
|
];
|
|
577
577
|
};
|
|
578
|
-
var isToolsListing = (data) => {
|
|
579
|
-
return typeof data === "object" && data !== null && Array.isArray(data.tools);
|
|
580
|
-
};
|
|
581
578
|
var isToolGroupsListing = (data) => {
|
|
582
579
|
return typeof data === "object" && data !== null && Array.isArray(data.groups) && !Array.isArray(data.tools);
|
|
583
580
|
};
|
|
@@ -595,7 +592,7 @@ var renderEmptyToolsLine = (data) => {
|
|
|
595
592
|
}
|
|
596
593
|
if (data.group !== void 0) {
|
|
597
594
|
const match = data.filter === void 0 ? "" : ` match ${JSON.stringify(data.filter)}`;
|
|
598
|
-
return ` No tools in group ${JSON.stringify(data.group)}${match}. Run \`appduct tools --groups\` to see the session's groups.`;
|
|
595
|
+
return ` No tools in group ${JSON.stringify(data.group)}${match}. Run \`appduct tools ls --groups\` to see the session's groups.`;
|
|
599
596
|
}
|
|
600
597
|
return data.filter === void 0 ? " No tools registered." : ` No tools match ${JSON.stringify(data.filter)}.`;
|
|
601
598
|
};
|
|
@@ -677,7 +674,7 @@ var renderToolSummaryTable = (colors, data) => {
|
|
|
677
674
|
...grouped ? renderGroupedToolLines(colors, data.tools) : data.tools.flatMap((tool) => renderToolSummaryLines(tool, " ")),
|
|
678
675
|
...renderTruncationLine(data),
|
|
679
676
|
"",
|
|
680
|
-
"Run `appduct tools <name>` for a tool's full schema."
|
|
677
|
+
"Run `appduct tools describe <name>` for a tool's full schema."
|
|
681
678
|
];
|
|
682
679
|
};
|
|
683
680
|
var renderToolDetail = (colors, tool, flags) => {
|
|
@@ -729,16 +726,13 @@ var renderToolGroups = (colors, data) => {
|
|
|
729
726
|
colors.green("Groups"),
|
|
730
727
|
...data.groups.map((entry) => ` ${label(entry).padEnd(width)} ${String(entry.total).padStart(countWidth)}`),
|
|
731
728
|
"",
|
|
732
|
-
`${data.total} tool${data.total === 1 ? "" : "s"} in total. ` + (hasAnyGroup(data.groups) ? "Run `appduct tools --group <name>` to list one group's tools." : "No tool declares a group.")
|
|
729
|
+
`${data.total} tool${data.total === 1 ? "" : "s"} in total. ` + (hasAnyGroup(data.groups) ? "Run `appduct tools ls --group <name>` to list one group's tools." : "No tool declares a group.")
|
|
733
730
|
];
|
|
734
731
|
};
|
|
735
|
-
var
|
|
732
|
+
var renderToolsListData = (colors, data, flags, full) => {
|
|
736
733
|
if (isToolGroupsListing(data)) {
|
|
737
734
|
return renderToolGroups(colors, data);
|
|
738
735
|
}
|
|
739
|
-
if (!isToolsListing(data)) {
|
|
740
|
-
return renderToolDetail(colors, data, flags);
|
|
741
|
-
}
|
|
742
736
|
return full ? renderToolsFullListing(colors, data, flags) : renderToolSummaryTable(colors, data);
|
|
743
737
|
};
|
|
744
738
|
var renderInvokeData = (colors, data, flags) => {
|
|
@@ -924,15 +918,17 @@ var renderSuccessData = (colors, command, data, options) => {
|
|
|
924
918
|
return renderInitData(colors, data, flags);
|
|
925
919
|
case "keygen":
|
|
926
920
|
return renderKeygenData(colors, data, flags);
|
|
927
|
-
case "link":
|
|
921
|
+
case "sessions link":
|
|
928
922
|
return renderLinkData(colors, data, flags, options.qr);
|
|
929
|
-
case "ls":
|
|
923
|
+
case "sessions ls":
|
|
930
924
|
return renderLsData(colors, data, options.now ?? /* @__PURE__ */ new Date());
|
|
931
|
-
case "tools":
|
|
932
|
-
return
|
|
933
|
-
case "
|
|
925
|
+
case "tools ls":
|
|
926
|
+
return renderToolsListData(colors, data, flags, options.full);
|
|
927
|
+
case "tools describe":
|
|
928
|
+
return renderToolDetail(colors, data, flags);
|
|
929
|
+
case "tools call":
|
|
934
930
|
return renderInvokeData(colors, data, flags);
|
|
935
|
-
case "revoke":
|
|
931
|
+
case "sessions revoke":
|
|
936
932
|
return renderRevokeData(colors, data);
|
|
937
933
|
case "daemon run":
|
|
938
934
|
return renderDaemonRunData(colors, data, flags);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route for `appduct events` — itself a router over the events verbs, so `events tail` loads only
|
|
3
|
+
* `tail.ts` (issue #96). cac matches only the noun (`cli/create-cli.ts`), so the verb arrives here
|
|
4
|
+
* as the first positional rather than as a cac command of its own.
|
|
5
|
+
*
|
|
6
|
+
* `ls` is reserved for the catalog issue #95 adds; until it lands, `events ls` falls through to
|
|
7
|
+
* `unknown` below like any other unrecognized verb, naming `tail`/`since` as the ones that exist.
|
|
8
|
+
*/
|
|
9
|
+
export declare const route: import("../../router.js").Route;
|