@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/bin.cjs
CHANGED
|
@@ -325,7 +325,7 @@ function createFetchTransport(opts) {
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
// src/version.ts
|
|
328
|
-
var VERSION = "1.8.
|
|
328
|
+
var VERSION = "1.8.1";
|
|
329
329
|
var USER_AGENT = `idapt-cli/${VERSION}`;
|
|
330
330
|
function canOpenBrowser(env, isTty) {
|
|
331
331
|
if (!isTty) return false;
|
|
@@ -1515,11 +1515,6 @@ var computerEnvVarResponseSchema = zod.z.object({
|
|
|
1515
1515
|
file_id: zod.z.string().nullish(),
|
|
1516
1516
|
created_at: zod.z.string()
|
|
1517
1517
|
}).meta({ id: "ComputerEnvVar" });
|
|
1518
|
-
zod.z.object({
|
|
1519
|
-
port: zod.z.number(),
|
|
1520
|
-
protocol: zod.z.enum(["tcp", "udp"]),
|
|
1521
|
-
source: zod.z.string().nullish()
|
|
1522
|
-
}).meta({ id: "ComputerFirewallRule" });
|
|
1523
1518
|
var computerPortResponseSchema = zod.z.object({
|
|
1524
1519
|
port: zod.z.number(),
|
|
1525
1520
|
protocol: zod.z.string(),
|
|
@@ -1609,16 +1604,6 @@ var envSyncResultSchema = zod.z.object({
|
|
|
1609
1604
|
),
|
|
1610
1605
|
extra_on_disk: zod.z.array(zod.z.string())
|
|
1611
1606
|
}).meta({ id: "EnvSyncResult" });
|
|
1612
|
-
var firewallResultSchema = zod.z.object({
|
|
1613
|
-
rules: zod.z.array(
|
|
1614
|
-
zod.z.object({
|
|
1615
|
-
port: zod.z.number(),
|
|
1616
|
-
protocol: zod.z.string()
|
|
1617
|
-
})
|
|
1618
|
-
),
|
|
1619
|
-
query_status: zod.z.string(),
|
|
1620
|
-
query_error: zod.z.string().nullish()
|
|
1621
|
-
}).meta({ id: "FirewallResult" });
|
|
1622
1607
|
var computerPortsResultSchema = zod.z.object({
|
|
1623
1608
|
ports: zod.z.array(computerPortResponseSchema),
|
|
1624
1609
|
discovery_status: zod.z.string(),
|
|
@@ -1715,14 +1700,6 @@ var createUserEnvVarRequestSchema = zod.z.union([
|
|
|
1715
1700
|
)
|
|
1716
1701
|
})
|
|
1717
1702
|
]);
|
|
1718
|
-
var addFirewallRuleRequestSchema = zod.z.object({
|
|
1719
|
-
port: zod.z.number().int().min(1).max(65535).describe("Port to open."),
|
|
1720
|
-
protocol: zod.z.enum(["tcp", "udp"]).default("tcp")
|
|
1721
|
-
});
|
|
1722
|
-
var removeFirewallRuleRequestSchema = zod.z.object({
|
|
1723
|
-
port: zod.z.coerce.number().int().describe("Port of the rule to remove."),
|
|
1724
|
-
protocol: zod.z.enum(["tcp", "udp"]).optional()
|
|
1725
|
-
});
|
|
1726
1703
|
var patchComputerPortRequestSchema = zod.z.object({
|
|
1727
1704
|
port: zod.z.number().int().min(1).max(65535),
|
|
1728
1705
|
protocol: zod.z.string(),
|
|
@@ -2100,47 +2077,7 @@ var computerCommands = [
|
|
|
2100
2077
|
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`.",
|
|
2101
2078
|
errors: [403, 409, 500, 503]
|
|
2102
2079
|
}),
|
|
2103
|
-
// ----
|
|
2104
|
-
cmd({
|
|
2105
|
-
resource: "computer",
|
|
2106
|
-
verb: "firewall",
|
|
2107
|
-
method: "GET",
|
|
2108
|
-
path: "/computers/:id/firewall",
|
|
2109
|
-
response: firewallResultSchema,
|
|
2110
|
-
permission: P,
|
|
2111
|
-
responseKind: "single",
|
|
2112
|
-
tags: TAGS,
|
|
2113
|
-
summary: "List firewall rules.",
|
|
2114
|
-
description: "Query iptables rules (cloud computers only).",
|
|
2115
|
-
errors: [403]
|
|
2116
|
-
}),
|
|
2117
|
-
cmd({
|
|
2118
|
-
resource: "computer",
|
|
2119
|
-
verb: "firewall-add",
|
|
2120
|
-
method: "POST",
|
|
2121
|
-
path: "/computers/:id/firewall",
|
|
2122
|
-
request: addFirewallRuleRequestSchema,
|
|
2123
|
-
response: firewallResultSchema,
|
|
2124
|
-
permission: W,
|
|
2125
|
-
responseKind: "single",
|
|
2126
|
-
tags: TAGS,
|
|
2127
|
-
summary: "Add a firewall rule.",
|
|
2128
|
-
errors: [403, 409, 500]
|
|
2129
|
-
}),
|
|
2130
|
-
cmd({
|
|
2131
|
-
resource: "computer",
|
|
2132
|
-
verb: "firewall-remove",
|
|
2133
|
-
method: "DELETE",
|
|
2134
|
-
path: "/computers/:id/firewall",
|
|
2135
|
-
argLocation: "query",
|
|
2136
|
-
request: removeFirewallRuleRequestSchema,
|
|
2137
|
-
response: firewallResultSchema,
|
|
2138
|
-
permission: W,
|
|
2139
|
-
responseKind: "single",
|
|
2140
|
-
tags: TAGS,
|
|
2141
|
-
summary: "Remove a firewall rule.",
|
|
2142
|
-
errors: [403, 409, 500]
|
|
2143
|
-
}),
|
|
2080
|
+
// ---- ports --------------------------------------------------------------
|
|
2144
2081
|
cmd({
|
|
2145
2082
|
resource: "computer",
|
|
2146
2083
|
verb: "ports",
|
|
@@ -2591,25 +2528,6 @@ var computerCommands = [
|
|
|
2591
2528
|
public: false,
|
|
2592
2529
|
tags: TAGS,
|
|
2593
2530
|
summary: "Close a computer's public tunnel for a port."
|
|
2594
|
-
}),
|
|
2595
|
-
// `firewall-edit` is the agent's add-OR-remove verb (it carries a
|
|
2596
|
-
// `firewall_action` sub-action) — distinct from the discrete public
|
|
2597
|
-
// `firewall-add` (POST) / `firewall-remove` (DELETE). agent-internal.
|
|
2598
|
-
cmd({
|
|
2599
|
-
resource: "computer",
|
|
2600
|
-
verb: "firewall-edit",
|
|
2601
|
-
method: "POST",
|
|
2602
|
-
path: "/computers/:id/firewall-edit",
|
|
2603
|
-
request: zod.z.object({
|
|
2604
|
-
firewall_action: zod.z.enum(["add", "remove"]),
|
|
2605
|
-
port: zod.z.coerce.number().int().min(1).max(65535),
|
|
2606
|
-
protocol: zod.z.enum(["tcp", "udp"]).optional()
|
|
2607
|
-
}),
|
|
2608
|
-
permission: W,
|
|
2609
|
-
responseKind: "single",
|
|
2610
|
-
public: false,
|
|
2611
|
-
tags: TAGS,
|
|
2612
|
-
summary: "Add or remove a firewall rule (agent add-or-remove verb)."
|
|
2613
2531
|
})
|
|
2614
2532
|
];
|
|
2615
2533
|
var computerPlaybook = {
|
|
@@ -2617,14 +2535,14 @@ var computerPlaybook = {
|
|
|
2617
2535
|
instructions: `Computers are remote machines. \`computer list\`/\`get\`; lifecycle via
|
|
2618
2536
|
\`start\`/\`stop\`/\`hibernate\`/\`archive\`. Run commands with \`computer exec <id> --command \u2026\`
|
|
2619
2537
|
(long-running \u2014 use --background). Transfer files with \`computer download <id> --path \u2026\`
|
|
2620
|
-
and \`computer upload\`. Manage \`
|
|
2538
|
+
and \`computer upload\`. Manage \`ports\`/\`users\` and Docker \`apps\`
|
|
2621
2539
|
(\`app-run\`, \`app-start\`/\`stop\`, \`app-logs\`, \`app-exec\`).
|
|
2622
2540
|
|
|
2623
2541
|
A computer lives in ONE home workspace (full control). Share its LOCAL INFERENCE
|
|
2624
2542
|
ONLY into other workspaces with \`computer link <id> --workspace-id <ws>\` (never
|
|
2625
2543
|
shares shell / files / tunnels); \`computer links <id>\` lists the shares and
|
|
2626
|
-
\`computer unlink <id> --workspace-id <ws>\` revokes one.
|
|
2627
|
-
the \`idapt up\`
|
|
2544
|
+
\`computer unlink <id> --workspace-id <ws>\` revokes one. Register a new machine with
|
|
2545
|
+
the \`idapt up\` daemon flow (defaults to your personal
|
|
2628
2546
|
workspace).`
|
|
2629
2547
|
};
|
|
2630
2548
|
var listQuery = zod.z.object({
|
|
@@ -2654,6 +2572,8 @@ var agentResponseSchema = zod.z.object({
|
|
|
2654
2572
|
compaction_preserved_max_tokens: zod.z.number().nullish(),
|
|
2655
2573
|
compaction_msg_percent: zod.z.number().nullish(),
|
|
2656
2574
|
compaction_msg_max_tokens: zod.z.number().nullish(),
|
|
2575
|
+
compaction_trigger_type: zod.z.enum(["percent", "tokens"]).nullish(),
|
|
2576
|
+
compaction_trigger_value: zod.z.number().nullish(),
|
|
2657
2577
|
source_template_resource_id: zod.z.string().nullish(),
|
|
2658
2578
|
memory_folder: zod.z.string().nullish(),
|
|
2659
2579
|
default_model_id: zod.z.string().nullish(),
|
|
@@ -2964,7 +2884,9 @@ var agentCompactionFields = {
|
|
|
2964
2884
|
compaction_preserved_percent: zod.z.number().min(0).max(100).nullish(),
|
|
2965
2885
|
compaction_preserved_max_tokens: zod.z.number().min(0).max(5e5).nullish(),
|
|
2966
2886
|
compaction_msg_percent: zod.z.number().min(0).max(100).nullish(),
|
|
2967
|
-
compaction_msg_max_tokens: zod.z.number().min(0).max(5e5).nullish()
|
|
2887
|
+
compaction_msg_max_tokens: zod.z.number().min(0).max(5e5).nullish(),
|
|
2888
|
+
compaction_trigger_type: zod.z.enum(["percent", "tokens"]).nullish(),
|
|
2889
|
+
compaction_trigger_value: zod.z.number().int().min(0).nullish()
|
|
2968
2890
|
};
|
|
2969
2891
|
var createAgentRequestSchema = zod.z.object({
|
|
2970
2892
|
name: zod.z.string().min(1).max(80),
|
|
@@ -6414,9 +6336,12 @@ function argLines(spec) {
|
|
|
6414
6336
|
}
|
|
6415
6337
|
return lines;
|
|
6416
6338
|
}
|
|
6417
|
-
function renderHelp(spec) {
|
|
6339
|
+
function renderHelp(spec, options = {}) {
|
|
6418
6340
|
const lines = [];
|
|
6419
|
-
|
|
6341
|
+
const command = options.command ?? spec.command;
|
|
6342
|
+
const summary = options.summary ?? spec.summary;
|
|
6343
|
+
const resource = options.resource ?? spec.resource;
|
|
6344
|
+
lines.push(`idapt ${command} \u2014 ${summary}`);
|
|
6420
6345
|
lines.push("");
|
|
6421
6346
|
lines.push(` ${spec.method} /api/v1${spec.path}`);
|
|
6422
6347
|
if (spec.async) lines.push(" (long-running \u2014 supports --background)");
|
|
@@ -6431,7 +6356,7 @@ function renderHelp(spec) {
|
|
|
6431
6356
|
lines.push(spec.help);
|
|
6432
6357
|
}
|
|
6433
6358
|
lines.push("");
|
|
6434
|
-
lines.push(`Playbook: idapt instructions ${
|
|
6359
|
+
lines.push(`Playbook: idapt instructions ${resource}`);
|
|
6435
6360
|
return lines.join("\n");
|
|
6436
6361
|
}
|
|
6437
6362
|
function renderInstructions(resource) {
|
|
@@ -6700,9 +6625,6 @@ var VERB_OVERRIDES = {
|
|
|
6700
6625
|
"computer file-download": "computer download",
|
|
6701
6626
|
"computer upload-dir": "computer upload",
|
|
6702
6627
|
"computer download-dir": "computer download",
|
|
6703
|
-
"computer firewall-view": "computer firewall",
|
|
6704
|
-
// NB: `firewall-edit` is identity (its own add-or-remove route) — it must NOT
|
|
6705
|
-
// map to `firewall-add`, or `--firewall-action remove` would silently ADD.
|
|
6706
6628
|
"computer user-list": "computer users",
|
|
6707
6629
|
"computer user-create": "computer create-user",
|
|
6708
6630
|
"computer user-delete": "computer delete-user",
|