@pstdio/pocketcoder-cli 0.4.0 → 0.5.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 +1 -0
- package/dist/index.js +12 -10
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -40662,6 +40662,8 @@ function isYargsInstance(y) {
|
|
|
40662
40662
|
// ../../node_modules/.bun/yargs@17.7.2/node_modules/yargs/index.mjs
|
|
40663
40663
|
var Yargs = YargsFactory(esm_default);
|
|
40664
40664
|
var yargs_default = Yargs;
|
|
40665
|
+
// package.json
|
|
40666
|
+
var version2 = "0.5.0";
|
|
40665
40667
|
|
|
40666
40668
|
// src/command-tree-admin.ts
|
|
40667
40669
|
function group(parser2, name2, description, configure) {
|
|
@@ -40733,7 +40735,7 @@ function listOptions(command2) {
|
|
|
40733
40735
|
return command2.option("active", { type: "boolean", description: "Only show nonterminal workspaces" }).option("state", { type: "string", description: "Filter by state" }).option("template", { type: "string", description: "Filter by template name" }).option("external-id", { type: "string", description: "Filter by external ID" }).option("limit", { type: "string", description: "Maximum number of workspaces" }).option("json", { type: "boolean", description: "Print JSON" });
|
|
40734
40736
|
}
|
|
40735
40737
|
function createOptions(command2) {
|
|
40736
|
-
return command2.option("template", { type: "string", demandOption: true, description: "Template name" }).option("version", { type: "string", description: "Template version" }).option("external-id", { type: "string", description: "Caller identity and idempotency key" }).option("input", { type: "string", description: "Launch input as a JSON object" }).option("source", { type: "string", description: "Template-declared repository alias" }).option("revision", { type: "string", description: "Allowed Git branch, tag, or commit" }).option("wait", {
|
|
40738
|
+
return command2.version(false).option("template", { type: "string", demandOption: true, description: "Template name" }).option("version", { type: "string", description: "Template version" }).option("external-id", { type: "string", description: "Caller identity and idempotency key" }).option("input", { type: "string", description: "Launch input as a JSON object" }).option("source", { type: "string", description: "Template-declared repository alias" }).option("revision", { type: "string", description: "Allowed Git branch, tag, or commit" }).option("wait", {
|
|
40737
40739
|
type: "boolean",
|
|
40738
40740
|
description: "Wait until the workspace is ready or terminal"
|
|
40739
40741
|
}).option("wait-timeout-seconds", {
|
|
@@ -40787,7 +40789,7 @@ function createCli(argv) {
|
|
|
40787
40789
|
}).option("env-file", {
|
|
40788
40790
|
type: "string",
|
|
40789
40791
|
description: "Explicit environment file, relative to --workdir"
|
|
40790
|
-
}).help().alias("help", "h").version(
|
|
40792
|
+
}).help().alias("help", "h").version(version2).recommendCommands().showHelpOnFail(true).epilogue([
|
|
40791
40793
|
"Environment:",
|
|
40792
40794
|
" POCKETCODER_DATABASE_URL, POCKETCODER_DATABASE_SCHEMA (db/key/template commands)",
|
|
40793
40795
|
" POCKETCODER_URL, POCKETCODER_KEY (workspace and doctor commands)",
|
|
@@ -43105,9 +43107,9 @@ class KubernetesDriver {
|
|
|
43105
43107
|
if (this.sidecarsSupported)
|
|
43106
43108
|
return;
|
|
43107
43109
|
const output = await kubectl(this.kubectlBin, this.namespace, ["version", "-o", "json"]);
|
|
43108
|
-
const
|
|
43109
|
-
const major = Number(
|
|
43110
|
-
const minor = Number((
|
|
43110
|
+
const version3 = JSON.parse(output);
|
|
43111
|
+
const major = Number(version3.serverVersion?.major ?? 0);
|
|
43112
|
+
const minor = Number((version3.serverVersion?.minor ?? "0").replace(/\D.*$/, ""));
|
|
43111
43113
|
if (major < 1 || major === 1 && minor < 29) {
|
|
43112
43114
|
throw new Error("restricted workspaces require Kubernetes 1.29+ with SidecarContainers");
|
|
43113
43115
|
}
|
|
@@ -43785,15 +43787,15 @@ class MemoryTemplateStore extends MemoryStoreBase {
|
|
|
43785
43787
|
async listTemplates(names) {
|
|
43786
43788
|
return this.templates.filter((t) => !names || names.includes(t.name)).map((t) => ({ ...t }));
|
|
43787
43789
|
}
|
|
43788
|
-
async getTemplate(name2,
|
|
43789
|
-
if (
|
|
43790
|
-
return this.templates.find((t) => t.name === name2 && t.version ===
|
|
43790
|
+
async getTemplate(name2, version3) {
|
|
43791
|
+
if (version3) {
|
|
43792
|
+
return this.templates.find((t) => t.name === name2 && t.version === version3) ?? null;
|
|
43791
43793
|
}
|
|
43792
43794
|
const active = this.templates.filter((t) => t.name === name2 && t.status === "active");
|
|
43793
43795
|
return active[active.length - 1] ?? null;
|
|
43794
43796
|
}
|
|
43795
|
-
async setTemplateStatus(name2,
|
|
43796
|
-
const row = this.templates.find((t) => t.name === name2 && t.version ===
|
|
43797
|
+
async setTemplateStatus(name2, version3, status) {
|
|
43798
|
+
const row = this.templates.find((t) => t.name === name2 && t.version === version3);
|
|
43797
43799
|
if (row) {
|
|
43798
43800
|
row.status = status;
|
|
43799
43801
|
row.retiredAt = status === "retired" ? new Date : null;
|