turnzero 0.37.0 → 0.38.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/dist/turnzero-cloud.mjs +52 -40
- package/package.json +4 -4
package/dist/turnzero-cloud.mjs
CHANGED
|
@@ -43,9 +43,9 @@ var UPLOAD_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
|
|
|
43
43
|
var uploadFileName = (id) => `${id}.zip`;
|
|
44
44
|
var UPLOAD_ENVIRONMENT = "development";
|
|
45
45
|
var COMMAND_ENVIRONMENTS = Object.freeze(["development", "production"]);
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
46
|
+
var DEPLOY_ACTION = "deploy";
|
|
47
|
+
var ACCOUNT_ACTIONS_PATH = "/api/v1/";
|
|
48
|
+
var TZCLOUD_ACTIONS_PATH = "/api/tzcloud/v1/";
|
|
49
49
|
var COMMAND_ACTION_SURFACE = Object.freeze({
|
|
50
50
|
add_test_end_users: "tzcloud",
|
|
51
51
|
check_deploy: "tzcloud",
|
|
@@ -76,6 +76,12 @@ var COMMAND_ACTION_SURFACE = Object.freeze({
|
|
|
76
76
|
start: "account"
|
|
77
77
|
});
|
|
78
78
|
var toolNameOf = (action) => COMMAND_ACTION_SURFACE[action] === "account" ? action : `${COMMAND_ACTION_SURFACE[action]}_${action}`;
|
|
79
|
+
var surfaceAddressOf = (origin, surface, action) => {
|
|
80
|
+
if (surface === "account") return `${origin}${ACCOUNT_ACTIONS_PATH}${action}`;
|
|
81
|
+
const estate = estateOfPlane(origin);
|
|
82
|
+
return estate !== null ? `${ESTATE_ORIGINS[estate].tzcloud}/v1/${action}` : `${origin}${TZCLOUD_ACTIONS_PATH}${action}`;
|
|
83
|
+
};
|
|
84
|
+
var actionAddressOf = (origin, action) => surfaceAddressOf(origin, COMMAND_ACTION_SURFACE[action], action);
|
|
79
85
|
var progressPathOf = (upload) => `${DEPLOY_PROGRESS_PREFIX}${upload}/progress`;
|
|
80
86
|
var PROGRESS_PAUSE_SECONDS = 2;
|
|
81
87
|
var PROGRESS_READ_BOUND_SECONDS = 60;
|
|
@@ -112,7 +118,6 @@ var computerLoginAddressOf = (origin, login2) => {
|
|
|
112
118
|
var DEPLOY_SUBCOMMAND = "deploy";
|
|
113
119
|
var CHECK_SUBCOMMAND = "check";
|
|
114
120
|
var CHECK_ACTION = "check_deploy";
|
|
115
|
-
var CHECK_ACTION_PATH = "/api/v1/actions/check_deploy";
|
|
116
121
|
var HASH_SUBCOMMAND = "hash";
|
|
117
122
|
var DEPLOY_OPTION = Object.freeze({ env: "--env", upload: "--upload", path: "--path", origin: "--origin", application: "--application" });
|
|
118
123
|
var CHECK_OPTION = { application: "--application", path: "--path", origin: "--origin" };
|
|
@@ -223,7 +228,6 @@ var LIBRARY_SUBCOMMAND = "library";
|
|
|
223
228
|
var LIBRARY_ACTS = Object.freeze(["take"]);
|
|
224
229
|
var LIBRARY_OPTION = Object.freeze({ entry: "--entry", path: DEPLOY_OPTION.path, origin: DEPLOY_OPTION.origin });
|
|
225
230
|
var LIBRARY_READ_ACTION = "read_library";
|
|
226
|
-
var LIBRARY_READ_PATH = actionPathOf(LIBRARY_READ_ACTION);
|
|
227
231
|
var LIBRARY_READ_CHUNK = 16e3;
|
|
228
232
|
var LIBRARY_ENTRY_NAME_FORM = /^[a-z0-9][a-z0-9_-]*(\/[a-z0-9][a-z0-9_-]*)?$/;
|
|
229
233
|
var libraryTakeLineOf = (call) => commandLineOf(call.origin, LIBRARY_SUBCOMMAND, {
|
|
@@ -351,11 +355,11 @@ var TZMESH_OPTION = {
|
|
|
351
355
|
public: "--public"
|
|
352
356
|
};
|
|
353
357
|
var TZMESH_ESTATES = Object.freeze(["production", "development"]);
|
|
354
|
-
var
|
|
355
|
-
production: Object.freeze({ plane: DEFAULT_COMMAND_ORIGIN, wire: "https://tzmesh.turnzero.ai" }),
|
|
356
|
-
development: Object.freeze({ plane: DEVELOPMENT_COMMAND_ORIGIN, wire: "https://tzmesh.dev.turnzero.ai" })
|
|
358
|
+
var ESTATE_ORIGINS = Object.freeze({
|
|
359
|
+
production: Object.freeze({ plane: DEFAULT_COMMAND_ORIGIN, tzcloud: "https://tzcloud.turnzero.ai", wire: "https://tzmesh.turnzero.ai", site: "https://tzmesh.ai" }),
|
|
360
|
+
development: Object.freeze({ plane: DEVELOPMENT_COMMAND_ORIGIN, tzcloud: "https://tzcloud.dev.turnzero.ai", wire: "https://tzmesh.dev.turnzero.ai", site: "https://tzmesh.dev.turnzero.ai" })
|
|
357
361
|
});
|
|
358
|
-
var
|
|
362
|
+
var estateOfPlane = (origin) => TZMESH_ESTATES.find((estate) => ESTATE_ORIGINS[estate].plane === origin) ?? null;
|
|
359
363
|
var TZMESH_MINT_GRANT = "tzmesh";
|
|
360
364
|
var TZMESH_COMMAND_LABEL = "turnzero command";
|
|
361
365
|
var TZMESH_MINT_DAYS = 1;
|
|
@@ -526,9 +530,9 @@ function compareWireVersions(a, b) {
|
|
|
526
530
|
|
|
527
531
|
// src/turnzero_cloud_command/plane_wire.ts
|
|
528
532
|
var PLANE_WIRE_NEEDED = Object.freeze({
|
|
529
|
-
action_payloads: "2026-11-
|
|
530
|
-
management_api: "2026-11-
|
|
531
|
-
wire_errors: "2026-11-
|
|
533
|
+
action_payloads: "2026-11-05.2",
|
|
534
|
+
management_api: "2026-11-05.3",
|
|
535
|
+
wire_errors: "2026-11-05.2"
|
|
532
536
|
});
|
|
533
537
|
|
|
534
538
|
// src/turnzero_cloud_command/version.ts
|
|
@@ -1287,7 +1291,7 @@ var postAction = async (io2, origin, action, bearer, userAgent, body) => {
|
|
|
1287
1291
|
const controller = new AbortController();
|
|
1288
1292
|
const cancel = io2.schedule(TOKEN_CALL_BOUND_SECONDS * 1e3, () => controller.abort());
|
|
1289
1293
|
try {
|
|
1290
|
-
const response = await io2.fetch(
|
|
1294
|
+
const response = await io2.fetch(actionAddressOf(origin, action), {
|
|
1291
1295
|
method: "POST",
|
|
1292
1296
|
headers: { authorization: `Bearer ${bearer}`, "user-agent": userAgent, "content-type": "application/json" },
|
|
1293
1297
|
body: JSON.stringify(body),
|
|
@@ -4056,7 +4060,7 @@ var postOnce = async (io2, origin, bearer, userAgent, body) => {
|
|
|
4056
4060
|
const controller = new AbortController();
|
|
4057
4061
|
const cancel = io2.schedule(DEPLOY_CALL_BOUND_SECONDS * 1e3, () => controller.abort());
|
|
4058
4062
|
try {
|
|
4059
|
-
const response = await io2.fetch(
|
|
4063
|
+
const response = await io2.fetch(actionAddressOf(origin, DEPLOY_ACTION), {
|
|
4060
4064
|
method: "POST",
|
|
4061
4065
|
headers: { authorization: `Bearer ${bearer}`, "user-agent": userAgent, "content-type": "application/json" },
|
|
4062
4066
|
body: JSON.stringify(body),
|
|
@@ -4353,7 +4357,7 @@ async function deployRun(named, io2, flags) {
|
|
|
4353
4357
|
io2.print(`${UPLOADED_LINE_HEAD}${zipped.zip.length} bytes as upload ${upload}`);
|
|
4354
4358
|
let started;
|
|
4355
4359
|
try {
|
|
4356
|
-
const response = await io2.fetch(
|
|
4360
|
+
const response = await io2.fetch(actionAddressOf(origin, DEPLOY_ACTION), {
|
|
4357
4361
|
method: "POST",
|
|
4358
4362
|
headers: { ...headers, "content-type": "application/json" },
|
|
4359
4363
|
body: JSON.stringify(commandStartBodyOf(options.application, upload, environment, commit)),
|
|
@@ -4574,7 +4578,7 @@ var postCheck = async (io2, origin, bearer, userAgent, body) => {
|
|
|
4574
4578
|
const controller = new AbortController();
|
|
4575
4579
|
const cancel = io2.schedule(CHECK_CALL_BOUND_SECONDS * 1e3, () => controller.abort());
|
|
4576
4580
|
try {
|
|
4577
|
-
const response = await io2.fetch(
|
|
4581
|
+
const response = await io2.fetch(actionAddressOf(origin, CHECK_ACTION), {
|
|
4578
4582
|
method: "POST",
|
|
4579
4583
|
headers: { authorization: `Bearer ${bearer}`, "user-agent": userAgent, "content-type": "application/json" },
|
|
4580
4584
|
body: JSON.stringify(body),
|
|
@@ -5052,7 +5056,7 @@ async function secret(call, io2) {
|
|
|
5052
5056
|
const unknown = secretUnknownSentence(options.act);
|
|
5053
5057
|
let answered;
|
|
5054
5058
|
try {
|
|
5055
|
-
const request = io2.fetch(
|
|
5059
|
+
const request = io2.fetch(actionAddressOf(sent.origin, action), {
|
|
5056
5060
|
method: "POST",
|
|
5057
5061
|
headers: { authorization: `Bearer ${credential.credential}`, "user-agent": agent.userAgent, "content-type": "application/json" },
|
|
5058
5062
|
body: JSON.stringify({
|
|
@@ -5460,7 +5464,7 @@ var postSignIn = async (io2, origin, bearer, userAgent, body) => {
|
|
|
5460
5464
|
const controller = new AbortController();
|
|
5461
5465
|
const cancel = io2.schedule(SESSION_CALL_BOUND_SECONDS * 1e3, () => controller.abort());
|
|
5462
5466
|
try {
|
|
5463
|
-
const response = await io2.fetch(
|
|
5467
|
+
const response = await io2.fetch(actionAddressOf(origin, SIGN_IN_TEST_END_USER_ACTION), {
|
|
5464
5468
|
method: "POST",
|
|
5465
5469
|
headers: { authorization: `Bearer ${bearer}`, "user-agent": userAgent, "content-type": "application/json" },
|
|
5466
5470
|
body: JSON.stringify(body),
|
|
@@ -5983,7 +5987,7 @@ var postReadStatus = async (io2, origin, bearer, userAgent, application) => {
|
|
|
5983
5987
|
const controller = new AbortController();
|
|
5984
5988
|
const cancel = io2.schedule(READ_STATUS_BOUND_SECONDS * 1e3, () => controller.abort());
|
|
5985
5989
|
try {
|
|
5986
|
-
const response = await io2.fetch(
|
|
5990
|
+
const response = await io2.fetch(actionAddressOf(origin, READ_STATUS_ACTION), {
|
|
5987
5991
|
method: "POST",
|
|
5988
5992
|
headers: { authorization: `Bearer ${bearer}`, "user-agent": userAgent, "content-type": "application/json" },
|
|
5989
5993
|
body: JSON.stringify({ application }),
|
|
@@ -6432,7 +6436,7 @@ var readOf = async (io2, origin, bearer, userAgent, body, what) => {
|
|
|
6432
6436
|
const response = await readAgain(
|
|
6433
6437
|
io2,
|
|
6434
6438
|
what,
|
|
6435
|
-
() => io2.fetch(
|
|
6439
|
+
() => io2.fetch(actionAddressOf(origin, LIBRARY_READ_ACTION), {
|
|
6436
6440
|
method: "POST",
|
|
6437
6441
|
headers: { authorization: `Bearer ${bearer}`, "user-agent": userAgent, "content-type": "application/json" },
|
|
6438
6442
|
body: JSON.stringify(body),
|
|
@@ -7686,7 +7690,7 @@ var unreachedLine = (origin, error) => {
|
|
|
7686
7690
|
async function remint(io2, origin, credential, userAgent, application, name, verifier = null) {
|
|
7687
7691
|
let response;
|
|
7688
7692
|
try {
|
|
7689
|
-
response = await io2.fetch(
|
|
7693
|
+
response = await io2.fetch(actionAddressOf(origin, PROVISION_ACTION), {
|
|
7690
7694
|
method: "POST",
|
|
7691
7695
|
headers: { authorization: `Bearer ${credential}`, "user-agent": userAgent, "content-type": "application/json" },
|
|
7692
7696
|
body: JSON.stringify({ name, application, environment: PROVISION_ENVIRONMENT, ...SECRET_REPLACE_MEMBER, ...verifier !== null ? { [CODE_VERIFIER_MEMBER]: verifier } : {} }),
|
|
@@ -10699,7 +10703,7 @@ var tzmeshOptionsOf = (call, io2) => {
|
|
|
10699
10703
|
if ("refusal" in origin) return origin;
|
|
10700
10704
|
if (!FIRST_PARTY_COMMAND_ORIGINS.includes(origin.origin)) return { refusal: tzmeshOriginRefusal(closing) };
|
|
10701
10705
|
const namedEstate = call.named[TZMESH_OPTION.tzmeshEstate];
|
|
10702
|
-
const estate = namedEstate === void 0 ?
|
|
10706
|
+
const estate = namedEstate === void 0 ? estateOfPlane(origin.origin) : TZMESH_ESTATES.find((entry) => entry === namedEstate) ?? null;
|
|
10703
10707
|
if (estate === null) return { refusal: `${TZMESH_OPTION.tzmeshEstate} names the estate the agent is registered at, ${TZMESH_ESTATES.join(" or ")}. ${closing}` };
|
|
10704
10708
|
return {
|
|
10705
10709
|
name,
|
|
@@ -10783,9 +10787,10 @@ var PRINTED_NAME_FORM = /^[A-Za-z0-9_.:/@-]{1,160}$/;
|
|
|
10783
10787
|
var agentWords = (agent) => agent.handle !== null ? agent.handle : `with id ${agent.id}`;
|
|
10784
10788
|
var registeredLineOf = (agent, wire) => `${REGISTERED_LINE_HEAD}agent ${agent.handle ?? "with no handle"}, id ${agent.id}, at ${wire}, its secret printed nowhere`;
|
|
10785
10789
|
var WRITTEN_LINE = `${WRITTEN_LINE_HEAD}the agent's secret, alone on one line, into the file ${TZMESH_OPTION.toFile} names, readable by its owner alone`;
|
|
10786
|
-
var
|
|
10787
|
-
var
|
|
10788
|
-
var
|
|
10790
|
+
var personDeletesAt = (estate) => `${ESTATE_ORIGINS[estate].site}/me under Hosted agents, open the agent's Manage keys, choose Unregister agent, then confirm.`;
|
|
10791
|
+
var registerUnknownSentence = (estate) => `Whether the agent was registered is unknown: tzmesh_list_participants from your tool shows it. Your person can delete it at ${personDeletesAt(estate)}`;
|
|
10792
|
+
var agentStandsSentence = (agent, estate) => `The agent ${agentWords(agent)} stands with no secret kept. Your person can delete it and free its name at ${personDeletesAt(estate)}`;
|
|
10793
|
+
var storeUnknownSentence = (secretName, agent, estate) => `Whether the secret was stored is unknown: tzcloud_list_secrets from your tool shows when ${secretName} was last written. Where it was not written, your person can delete the agent ${agentWords(agent)} at ${personDeletesAt(estate)}`;
|
|
10789
10794
|
var TOKEN_LEFT = `list_tokens from your tool shows the run's token by its label, ${TZMESH_COMMAND_LABEL}, and revoke_token ends it; it expires within a day either way.`;
|
|
10790
10795
|
var tokenStandsSentence = (id) => `The run's token, ${id}, was not revoked, so it works until it expires within a day: revoke_token from your tool with id ${id} ends it, and list_tokens shows whether it stands.`;
|
|
10791
10796
|
var revocationBearerRefused = (origin) => `This computer's token for ${origin} was refused as the bearer of the revocation.`;
|
|
@@ -10891,10 +10896,10 @@ var setUpAgent = async (io2, wire, secret2, userAgent, options, ended) => {
|
|
|
10891
10896
|
return { signing };
|
|
10892
10897
|
};
|
|
10893
10898
|
var firstStoreStandsSentence = (secretName) => `${secretName} now holds the deleted agent's secret, which works nowhere, until the line runs again.`;
|
|
10894
|
-
var signingUnknownSentence = (signingName, agent) => `Whether the webhook's signing secret was stored is unknown: tzcloud_list_secrets from your tool shows when ${signingName} was last written. Where it was not written,
|
|
10895
|
-
var unfinishableSentence = (agent) => `The agent ${agentWords(agent)} cannot be finished, since its webhook's signing secret ended with the run
|
|
10899
|
+
var signingUnknownSentence = (signingName, agent, estate) => `Whether the webhook's signing secret was stored is unknown: tzcloud_list_secrets from your tool shows when ${signingName} was last written. Where it was not written, your person can delete the agent ${agentWords(agent)} at ${personDeletesAt(estate)} Then run the line again.`;
|
|
10900
|
+
var unfinishableSentence = (agent, estate) => `The agent ${agentWords(agent)} cannot be finished, since its webhook's signing secret ended with the run. Your person can delete it at ${personDeletesAt(estate)} Then run the line again.`;
|
|
10896
10901
|
var firstStoreUnknownSentence = (secretName) => `Whether ${secretName} was written is unknown: tzcloud_list_secrets from your tool shows when it was last written. Where it was, it holds the deleted agent's secret, which works nowhere, until the line runs again.`;
|
|
10897
|
-
var unfinishedStandsSentence = (agent, kept2) => `${kept2.known ? `${kept2.name} holds the secret of the agent ${agentWords(agent)}.` : `Whether ${kept2.name} holds the secret of the agent ${agentWords(agent)} is unknown: tzcloud_list_secrets from your tool shows when it was last written.`} ${unfinishableSentence(agent)}`;
|
|
10902
|
+
var unfinishedStandsSentence = (agent, kept2, estate) => `${kept2.known ? `${kept2.name} holds the secret of the agent ${agentWords(agent)}.` : `Whether ${kept2.name} holds the secret of the agent ${agentWords(agent)} is unknown: tzcloud_list_secrets from your tool shows when it was last written.`} ${unfinishableSentence(agent, estate)}`;
|
|
10898
10903
|
var revokeRunToken = async (io2, plane, bearer, id, userAgent) => {
|
|
10899
10904
|
const answered = await postAction(io2, plane, REVOKE_TOKEN_ACTION, bearer, userAgent, revocationBodyOf(id));
|
|
10900
10905
|
let lines;
|
|
@@ -10924,19 +10929,19 @@ var endedLineOf = (stage, plane, agent, options) => {
|
|
|
10924
10929
|
case "minted":
|
|
10925
10930
|
return `The run was ended after its exchange minted the run's token, before the register. ${TOKEN_LEFT}`;
|
|
10926
10931
|
case "registering":
|
|
10927
|
-
return `The run was ended during the register. ${
|
|
10932
|
+
return `The run was ended during the register. ${registerUnknownSentence(options.estate)} ${TOKEN_LEFT}`;
|
|
10928
10933
|
case "registered":
|
|
10929
|
-
return agent === null ? `The run was ended after the register. ${
|
|
10934
|
+
return agent === null ? `The run was ended after the register. ${registerUnknownSentence(options.estate)} ${TOKEN_LEFT}` : "secret" in route ? options.webhook !== null ? `The run was ended after the register, while its secret was being stored. ${unfinishableSentence(agent, options.estate)} ${TOKEN_LEFT}` : `The run was ended after the register, while its secret was being stored. ${storeUnknownSentence(route.secret, agent, options.estate)} ${TOKEN_LEFT}` : `The run was ended after the register, before its secret was written. ${agentStandsSentence(agent, options.estate)} ${TOKEN_LEFT}`;
|
|
10930
10935
|
case "setting up":
|
|
10931
|
-
return agent === null ? `The run was ended after the register. ${
|
|
10936
|
+
return agent === null ? `The run was ended after the register. ${registerUnknownSentence(options.estate)} ${TOKEN_LEFT}` : `The run was ended while the agent's webhook or channels were being set. tzmesh_list_participants from your tool shows the agent and its webhook. ${agentStandsSentence(agent, options.estate)} ${TOKEN_LEFT}`;
|
|
10932
10937
|
case "storing signing":
|
|
10933
|
-
return agent === null || options.webhook === null ? `The run was ended after the register. ${
|
|
10938
|
+
return agent === null || options.webhook === null ? `The run was ended after the register. ${registerUnknownSentence(options.estate)} ${TOKEN_LEFT}` : `The run was ended while the webhook's signing secret was being stored. ${signingUnknownSentence(options.webhook.secretName, agent, options.estate)} ${TOKEN_LEFT}`;
|
|
10934
10939
|
case "stored":
|
|
10935
10940
|
return `The run was ended after the agent's secret was kept, before the run's token was revoked. ${TOKEN_LEFT}`;
|
|
10936
10941
|
}
|
|
10937
10942
|
};
|
|
10938
10943
|
var completing = async (io2, options, mint, tokens, userAgent) => {
|
|
10939
|
-
const { plane, wire } =
|
|
10944
|
+
const { plane, wire } = ESTATE_ORIGINS[options.estate];
|
|
10940
10945
|
const route = options.route;
|
|
10941
10946
|
const tag = runTagOf();
|
|
10942
10947
|
const stage = { now: "unsent", ended: false };
|
|
@@ -10957,7 +10962,7 @@ var completing = async (io2, options, mint, tokens, userAgent) => {
|
|
|
10957
10962
|
for (const line of deleted.lines) io2.print(line);
|
|
10958
10963
|
if (deleted.deleted) {
|
|
10959
10964
|
if (kept2 !== null) io2.print(kept2.known ? firstStoreStandsSentence(kept2.name) : firstStoreUnknownSentence(kept2.name));
|
|
10960
|
-
} else io2.print(kept2 === null ? agentStandsSentence(standing) : unfinishedStandsSentence(standing, kept2));
|
|
10965
|
+
} else io2.print(kept2 === null ? agentStandsSentence(standing, options.estate) : unfinishedStandsSentence(standing, kept2, options.estate));
|
|
10961
10966
|
return revokedThen(minted, deleted.unknown ? whenUnknown : COMMAND_STATUS.failed);
|
|
10962
10967
|
};
|
|
10963
10968
|
const storeNamed = async (name, value) => {
|
|
@@ -11015,7 +11020,7 @@ var completing = async (io2, options, mint, tokens, userAgent) => {
|
|
|
11015
11020
|
}
|
|
11016
11021
|
if ("unknown" in registered) {
|
|
11017
11022
|
for (const line of registered.unknown) io2.print(line);
|
|
11018
|
-
io2.print(
|
|
11023
|
+
io2.print(registerUnknownSentence(options.estate));
|
|
11019
11024
|
return revokedThen(minted, COMMAND_STATUS.unknown);
|
|
11020
11025
|
}
|
|
11021
11026
|
if ("standing" in registered) {
|
|
@@ -11062,7 +11067,7 @@ var completing = async (io2, options, mint, tokens, userAgent) => {
|
|
|
11062
11067
|
if (stored !== "stored") {
|
|
11063
11068
|
for (const line of stored.unknown) io2.print(line);
|
|
11064
11069
|
if (options.webhook !== null) return deletedThen(minted, agent, COMMAND_STATUS.unknown, { name: route.secret, known: false });
|
|
11065
|
-
io2.print(storeUnknownSentence(route.secret, agent));
|
|
11070
|
+
io2.print(storeUnknownSentence(route.secret, agent, options.estate));
|
|
11066
11071
|
return revokedThen(minted, COMMAND_STATUS.unknown);
|
|
11067
11072
|
}
|
|
11068
11073
|
if (options.webhook !== null && signing !== null) {
|
|
@@ -11072,7 +11077,7 @@ var completing = async (io2, options, mint, tokens, userAgent) => {
|
|
|
11072
11077
|
if (kept2 === "refused") return deletedThen(minted, agent, COMMAND_STATUS.failed, { name: route.secret, known: true });
|
|
11073
11078
|
if (kept2 !== "stored") {
|
|
11074
11079
|
for (const line of kept2.unknown) io2.print(line);
|
|
11075
|
-
io2.print(signingUnknownSentence(options.webhook.secretName, agent));
|
|
11080
|
+
io2.print(signingUnknownSentence(options.webhook.secretName, agent, options.estate));
|
|
11076
11081
|
return revokedThen(minted, COMMAND_STATUS.unknown);
|
|
11077
11082
|
}
|
|
11078
11083
|
}
|
|
@@ -11098,7 +11103,7 @@ async function tzmeshRegister(call, io2) {
|
|
|
11098
11103
|
io2.print(tzmeshMintedTokenRefusal(closing));
|
|
11099
11104
|
return COMMAND_STATUS.nothing_started;
|
|
11100
11105
|
}
|
|
11101
|
-
const { plane } =
|
|
11106
|
+
const { plane } = ESTATE_ORIGINS[options.estate];
|
|
11102
11107
|
const tokens = readComputerTokens(io2, plane, "secret" in options.route ? options.origin : null, closing);
|
|
11103
11108
|
if ("status" in tokens) return tokens.status;
|
|
11104
11109
|
io2.hide(tokens.mint.token, REDACTED_TOKEN);
|
|
@@ -11129,7 +11134,14 @@ async function tzmeshRegister(call, io2) {
|
|
|
11129
11134
|
return firstAct(io2, plane, "tzmesh", io2.print, null, completingOptionsOf(options));
|
|
11130
11135
|
}
|
|
11131
11136
|
var TZMESH_READS = `this computer's token for each address it sends to, and the verifier its first act keeps, from its credential file. It never reads a minted token from ${MINTED_TOKEN_VARIABLE}, and refuses the run where that variable is set`;
|
|
11132
|
-
var
|
|
11137
|
+
var tzmeshAfterOwnError = (call) => {
|
|
11138
|
+
const named = call.named[TZMESH_OPTION.tzmeshEstate];
|
|
11139
|
+
const origin = call.named[TZMESH_OPTION.origin];
|
|
11140
|
+
const estate = TZMESH_ESTATES.find((entry) => entry === named) ?? (typeof origin === "string" ? estateOfPlane(origin) : null);
|
|
11141
|
+
const page = (entry) => `${ESTATE_ORIGINS[entry].site}/me`;
|
|
11142
|
+
const where = estate !== null ? page(estate) : `${page("production")} for an agent on production or ${page("development")} for one on development`;
|
|
11143
|
+
return `whether the run's token was minted, the agent registered, or its secret kept is unknown. list_tokens from your tool shows the token by its label, turnzero command, and revoke_token ends it. tzmesh_list_participants shows the agent. Your person can delete it at ${where} under Hosted agents, open the agent's Manage keys, choose Unregister agent, then confirm`;
|
|
11144
|
+
};
|
|
11133
11145
|
var TZMESH_FIRST_ACT_AFTER_OWN_ERROR = "a request may now be pending in this computer's credential file, and nothing was sent";
|
|
11134
11146
|
var TZMESH_ROW = Object.freeze({
|
|
11135
11147
|
name: TZMESH_SUBCOMMAND,
|
|
@@ -11153,7 +11165,7 @@ var TZMESH_ROW = Object.freeze({
|
|
|
11153
11165
|
`For an agent a Turn Zero Cloud application hosts, the same run sets it up. ${TZMESH_OPTION.webhookOrigin} sets its webhook at that application's origin, and ${TZMESH_OPTION.webhookSecret} names where the webhook's signing secret is stored. ${TZMESH_OPTION.join} joins its channels. Its description, title, and ${TZMESH_OPTION.public} go into the register. Where a step fails, follow the recovery the run prints before running the line again.`,
|
|
11154
11166
|
`The run reads this computer's token for each address it sends to: the ${TZMESH_OPTION.tzmeshEstate} platform's, to revoke the run's token, and under ${TZMESH_OPTION.secret} the ${TZMESH_OPTION.origin} platform's, to store the secret. Authorize this computer at each first.`
|
|
11155
11167
|
],
|
|
11156
|
-
afterOwnError: (call) => call.named[TZMESH_OPTION.mint] !== void 0 ?
|
|
11168
|
+
afterOwnError: (call) => call.named[TZMESH_OPTION.mint] !== void 0 ? tzmeshAfterOwnError(call) : TZMESH_FIRST_ACT_AFTER_OWN_ERROR,
|
|
11157
11169
|
run: tzmeshRegister
|
|
11158
11170
|
});
|
|
11159
11171
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turnzero",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deploy and run AI-built apps with Turn Zero Cloud hosting and backend services.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"node": ">=24"
|
|
9
9
|
},
|
|
10
10
|
"plane_wire": {
|
|
11
|
-
"action_payloads": "2026-11-
|
|
12
|
-
"management_api": "2026-11-
|
|
13
|
-
"wire_errors": "2026-11-
|
|
11
|
+
"action_payloads": "2026-11-05.2",
|
|
12
|
+
"management_api": "2026-11-05.3",
|
|
13
|
+
"wire_errors": "2026-11-05.2"
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
16
|
"turnzero": "dist/turnzero-cloud.mjs"
|