@idapt/cli 1.8.0 → 1.8.1
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.cjs +16 -94
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +2 -2
- package/dist/{chunk-WNQCFPPN.js → chunk-ZCMZH43X.js} +17 -95
- package/dist/chunk-ZCMZH43X.js.map +1 -0
- package/dist/index.cjs +15 -93
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-WNQCFPPN.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -687,11 +687,6 @@ var computerEnvVarResponseSchema = zod.z.object({
|
|
|
687
687
|
file_id: zod.z.string().nullish(),
|
|
688
688
|
created_at: zod.z.string()
|
|
689
689
|
}).meta({ id: "ComputerEnvVar" });
|
|
690
|
-
zod.z.object({
|
|
691
|
-
port: zod.z.number(),
|
|
692
|
-
protocol: zod.z.enum(["tcp", "udp"]),
|
|
693
|
-
source: zod.z.string().nullish()
|
|
694
|
-
}).meta({ id: "ComputerFirewallRule" });
|
|
695
690
|
var computerPortResponseSchema = zod.z.object({
|
|
696
691
|
port: zod.z.number(),
|
|
697
692
|
protocol: zod.z.string(),
|
|
@@ -781,16 +776,6 @@ var envSyncResultSchema = zod.z.object({
|
|
|
781
776
|
),
|
|
782
777
|
extra_on_disk: zod.z.array(zod.z.string())
|
|
783
778
|
}).meta({ id: "EnvSyncResult" });
|
|
784
|
-
var firewallResultSchema = zod.z.object({
|
|
785
|
-
rules: zod.z.array(
|
|
786
|
-
zod.z.object({
|
|
787
|
-
port: zod.z.number(),
|
|
788
|
-
protocol: zod.z.string()
|
|
789
|
-
})
|
|
790
|
-
),
|
|
791
|
-
query_status: zod.z.string(),
|
|
792
|
-
query_error: zod.z.string().nullish()
|
|
793
|
-
}).meta({ id: "FirewallResult" });
|
|
794
779
|
var computerPortsResultSchema = zod.z.object({
|
|
795
780
|
ports: zod.z.array(computerPortResponseSchema),
|
|
796
781
|
discovery_status: zod.z.string(),
|
|
@@ -887,14 +872,6 @@ var createUserEnvVarRequestSchema = zod.z.union([
|
|
|
887
872
|
)
|
|
888
873
|
})
|
|
889
874
|
]);
|
|
890
|
-
var addFirewallRuleRequestSchema = zod.z.object({
|
|
891
|
-
port: zod.z.number().int().min(1).max(65535).describe("Port to open."),
|
|
892
|
-
protocol: zod.z.enum(["tcp", "udp"]).default("tcp")
|
|
893
|
-
});
|
|
894
|
-
var removeFirewallRuleRequestSchema = zod.z.object({
|
|
895
|
-
port: zod.z.coerce.number().int().describe("Port of the rule to remove."),
|
|
896
|
-
protocol: zod.z.enum(["tcp", "udp"]).optional()
|
|
897
|
-
});
|
|
898
875
|
var patchComputerPortRequestSchema = zod.z.object({
|
|
899
876
|
port: zod.z.number().int().min(1).max(65535),
|
|
900
877
|
protocol: zod.z.string(),
|
|
@@ -1272,47 +1249,7 @@ var computerCommands = [
|
|
|
1272
1249
|
description: "Operation discriminator on `op`; the response shape depends on `op`. Streaming upload + download have dedicated routes. Daemon-layer failures map to `internal_error`/`conflict`/`not_found`/`forbidden`.",
|
|
1273
1250
|
errors: [403, 409, 500, 503]
|
|
1274
1251
|
}),
|
|
1275
|
-
// ----
|
|
1276
|
-
cmd({
|
|
1277
|
-
resource: "computer",
|
|
1278
|
-
verb: "firewall",
|
|
1279
|
-
method: "GET",
|
|
1280
|
-
path: "/computers/:id/firewall",
|
|
1281
|
-
response: firewallResultSchema,
|
|
1282
|
-
permission: P,
|
|
1283
|
-
responseKind: "single",
|
|
1284
|
-
tags: TAGS,
|
|
1285
|
-
summary: "List firewall rules.",
|
|
1286
|
-
description: "Query iptables rules (cloud computers only).",
|
|
1287
|
-
errors: [403]
|
|
1288
|
-
}),
|
|
1289
|
-
cmd({
|
|
1290
|
-
resource: "computer",
|
|
1291
|
-
verb: "firewall-add",
|
|
1292
|
-
method: "POST",
|
|
1293
|
-
path: "/computers/:id/firewall",
|
|
1294
|
-
request: addFirewallRuleRequestSchema,
|
|
1295
|
-
response: firewallResultSchema,
|
|
1296
|
-
permission: W,
|
|
1297
|
-
responseKind: "single",
|
|
1298
|
-
tags: TAGS,
|
|
1299
|
-
summary: "Add a firewall rule.",
|
|
1300
|
-
errors: [403, 409, 500]
|
|
1301
|
-
}),
|
|
1302
|
-
cmd({
|
|
1303
|
-
resource: "computer",
|
|
1304
|
-
verb: "firewall-remove",
|
|
1305
|
-
method: "DELETE",
|
|
1306
|
-
path: "/computers/:id/firewall",
|
|
1307
|
-
argLocation: "query",
|
|
1308
|
-
request: removeFirewallRuleRequestSchema,
|
|
1309
|
-
response: firewallResultSchema,
|
|
1310
|
-
permission: W,
|
|
1311
|
-
responseKind: "single",
|
|
1312
|
-
tags: TAGS,
|
|
1313
|
-
summary: "Remove a firewall rule.",
|
|
1314
|
-
errors: [403, 409, 500]
|
|
1315
|
-
}),
|
|
1252
|
+
// ---- ports --------------------------------------------------------------
|
|
1316
1253
|
cmd({
|
|
1317
1254
|
resource: "computer",
|
|
1318
1255
|
verb: "ports",
|
|
@@ -1763,25 +1700,6 @@ var computerCommands = [
|
|
|
1763
1700
|
public: false,
|
|
1764
1701
|
tags: TAGS,
|
|
1765
1702
|
summary: "Close a computer's public tunnel for a port."
|
|
1766
|
-
}),
|
|
1767
|
-
// `firewall-edit` is the agent's add-OR-remove verb (it carries a
|
|
1768
|
-
// `firewall_action` sub-action) — distinct from the discrete public
|
|
1769
|
-
// `firewall-add` (POST) / `firewall-remove` (DELETE). agent-internal.
|
|
1770
|
-
cmd({
|
|
1771
|
-
resource: "computer",
|
|
1772
|
-
verb: "firewall-edit",
|
|
1773
|
-
method: "POST",
|
|
1774
|
-
path: "/computers/:id/firewall-edit",
|
|
1775
|
-
request: zod.z.object({
|
|
1776
|
-
firewall_action: zod.z.enum(["add", "remove"]),
|
|
1777
|
-
port: zod.z.coerce.number().int().min(1).max(65535),
|
|
1778
|
-
protocol: zod.z.enum(["tcp", "udp"]).optional()
|
|
1779
|
-
}),
|
|
1780
|
-
permission: W,
|
|
1781
|
-
responseKind: "single",
|
|
1782
|
-
public: false,
|
|
1783
|
-
tags: TAGS,
|
|
1784
|
-
summary: "Add or remove a firewall rule (agent add-or-remove verb)."
|
|
1785
1703
|
})
|
|
1786
1704
|
];
|
|
1787
1705
|
var computerPlaybook = {
|
|
@@ -1789,14 +1707,14 @@ var computerPlaybook = {
|
|
|
1789
1707
|
instructions: `Computers are remote machines. \`computer list\`/\`get\`; lifecycle via
|
|
1790
1708
|
\`start\`/\`stop\`/\`hibernate\`/\`archive\`. Run commands with \`computer exec <id> --command \u2026\`
|
|
1791
1709
|
(long-running \u2014 use --background). Transfer files with \`computer download <id> --path \u2026\`
|
|
1792
|
-
and \`computer upload\`. Manage \`
|
|
1710
|
+
and \`computer upload\`. Manage \`ports\`/\`users\` and Docker \`apps\`
|
|
1793
1711
|
(\`app-run\`, \`app-start\`/\`stop\`, \`app-logs\`, \`app-exec\`).
|
|
1794
1712
|
|
|
1795
1713
|
A computer lives in ONE home workspace (full control). Share its LOCAL INFERENCE
|
|
1796
1714
|
ONLY into other workspaces with \`computer link <id> --workspace-id <ws>\` (never
|
|
1797
1715
|
shares shell / files / tunnels); \`computer links <id>\` lists the shares and
|
|
1798
|
-
\`computer unlink <id> --workspace-id <ws>\` revokes one.
|
|
1799
|
-
the \`idapt up\`
|
|
1716
|
+
\`computer unlink <id> --workspace-id <ws>\` revokes one. Register a new machine with
|
|
1717
|
+
the \`idapt up\` daemon flow (defaults to your personal
|
|
1800
1718
|
workspace).`
|
|
1801
1719
|
};
|
|
1802
1720
|
var listQuery = zod.z.object({
|
|
@@ -1826,6 +1744,8 @@ var agentResponseSchema = zod.z.object({
|
|
|
1826
1744
|
compaction_preserved_max_tokens: zod.z.number().nullish(),
|
|
1827
1745
|
compaction_msg_percent: zod.z.number().nullish(),
|
|
1828
1746
|
compaction_msg_max_tokens: zod.z.number().nullish(),
|
|
1747
|
+
compaction_trigger_type: zod.z.enum(["percent", "tokens"]).nullish(),
|
|
1748
|
+
compaction_trigger_value: zod.z.number().nullish(),
|
|
1829
1749
|
source_template_resource_id: zod.z.string().nullish(),
|
|
1830
1750
|
memory_folder: zod.z.string().nullish(),
|
|
1831
1751
|
default_model_id: zod.z.string().nullish(),
|
|
@@ -2136,7 +2056,9 @@ var agentCompactionFields = {
|
|
|
2136
2056
|
compaction_preserved_percent: zod.z.number().min(0).max(100).nullish(),
|
|
2137
2057
|
compaction_preserved_max_tokens: zod.z.number().min(0).max(5e5).nullish(),
|
|
2138
2058
|
compaction_msg_percent: zod.z.number().min(0).max(100).nullish(),
|
|
2139
|
-
compaction_msg_max_tokens: zod.z.number().min(0).max(5e5).nullish()
|
|
2059
|
+
compaction_msg_max_tokens: zod.z.number().min(0).max(5e5).nullish(),
|
|
2060
|
+
compaction_trigger_type: zod.z.enum(["percent", "tokens"]).nullish(),
|
|
2061
|
+
compaction_trigger_value: zod.z.number().int().min(0).nullish()
|
|
2140
2062
|
};
|
|
2141
2063
|
var createAgentRequestSchema = zod.z.object({
|
|
2142
2064
|
name: zod.z.string().min(1).max(80),
|
|
@@ -5662,9 +5584,12 @@ function argLines(spec) {
|
|
|
5662
5584
|
}
|
|
5663
5585
|
return lines;
|
|
5664
5586
|
}
|
|
5665
|
-
function renderHelp(spec) {
|
|
5587
|
+
function renderHelp(spec, options = {}) {
|
|
5666
5588
|
const lines = [];
|
|
5667
|
-
|
|
5589
|
+
const command = options.command ?? spec.command;
|
|
5590
|
+
const summary = options.summary ?? spec.summary;
|
|
5591
|
+
const resource = options.resource ?? spec.resource;
|
|
5592
|
+
lines.push(`idapt ${command} \u2014 ${summary}`);
|
|
5668
5593
|
lines.push("");
|
|
5669
5594
|
lines.push(` ${spec.method} /api/v1${spec.path}`);
|
|
5670
5595
|
if (spec.async) lines.push(" (long-running \u2014 supports --background)");
|
|
@@ -5679,7 +5604,7 @@ function renderHelp(spec) {
|
|
|
5679
5604
|
lines.push(spec.help);
|
|
5680
5605
|
}
|
|
5681
5606
|
lines.push("");
|
|
5682
|
-
lines.push(`Playbook: idapt instructions ${
|
|
5607
|
+
lines.push(`Playbook: idapt instructions ${resource}`);
|
|
5683
5608
|
return lines.join("\n");
|
|
5684
5609
|
}
|
|
5685
5610
|
function renderInstructions(resource) {
|
|
@@ -6065,9 +5990,6 @@ var VERB_OVERRIDES = {
|
|
|
6065
5990
|
"computer file-download": "computer download",
|
|
6066
5991
|
"computer upload-dir": "computer upload",
|
|
6067
5992
|
"computer download-dir": "computer download",
|
|
6068
|
-
"computer firewall-view": "computer firewall",
|
|
6069
|
-
// NB: `firewall-edit` is identity (its own add-or-remove route) — it must NOT
|
|
6070
|
-
// map to `firewall-add`, or `--firewall-action remove` would silently ADD.
|
|
6071
5993
|
"computer user-list": "computer users",
|
|
6072
5994
|
"computer user-create": "computer create-user",
|
|
6073
5995
|
"computer user-delete": "computer delete-user",
|