@lazehq/cli 0.1.46 → 0.1.47
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/laze.mjs +172 -16
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -35718,7 +35718,7 @@ function flagText({
|
|
|
35718
35718
|
}
|
|
35719
35719
|
|
|
35720
35720
|
// src/rules/cli-version.rules.ts
|
|
35721
|
-
var STAMPED = "0.1.
|
|
35721
|
+
var STAMPED = "0.1.47";
|
|
35722
35722
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35723
35723
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35724
35724
|
}
|
|
@@ -58515,6 +58515,12 @@ var messageSchemaDefinition = external_exports.object({
|
|
|
58515
58515
|
notInChannel: external_exports.array(notInChannelSchemaDefinition).optional()
|
|
58516
58516
|
});
|
|
58517
58517
|
var messageSchema = messageSchemaDefinition;
|
|
58518
|
+
var departedPersonSchemaDefinition = external_exports.object({
|
|
58519
|
+
id: idSchema4,
|
|
58520
|
+
name: external_exports.string(),
|
|
58521
|
+
/** When they left; null when chat learnt of it later, from the chat-departed-names task. */
|
|
58522
|
+
departedAt: external_exports.iso.datetime().nullable()
|
|
58523
|
+
});
|
|
58518
58524
|
var conversationSchemaDefinition = external_exports.object({
|
|
58519
58525
|
id: idSchema4,
|
|
58520
58526
|
workspaceId: workspaceIdSchema,
|
|
@@ -58543,7 +58549,12 @@ var conversationSchemaDefinition = external_exports.object({
|
|
|
58543
58549
|
/** Set when the conversation mirrors one outside Laze. */
|
|
58544
58550
|
mirror: conversationMirrorSchemaDefinition.nullable(),
|
|
58545
58551
|
/** For a `chat`, the agent it is with; null for every other kind. */
|
|
58546
|
-
agentId: idSchema4.nullish()
|
|
58552
|
+
agentId: idSchema4.nullish(),
|
|
58553
|
+
/**
|
|
58554
|
+
* Direct messages only: the people who left the workspace while in it, no longer members.
|
|
58555
|
+
* Spec: modules/chat/specs/departed-person-direct.feature. Absent means no one.
|
|
58556
|
+
*/
|
|
58557
|
+
departed: external_exports.array(departedPersonSchemaDefinition).optional()
|
|
58547
58558
|
});
|
|
58548
58559
|
var conversationSchema = conversationSchemaDefinition;
|
|
58549
58560
|
var conversationSummarySchemaDefinition = external_exports.object({
|
|
@@ -58981,7 +58992,9 @@ var signalActivityInputSchemaDefinition = external_exports.object({
|
|
|
58981
58992
|
contextTokens: external_exports.number().int().nonnegative().nullable().default(null),
|
|
58982
58993
|
contextWindow: external_exports.number().int().positive().nullable().default(null),
|
|
58983
58994
|
/** With `queued`: the conversation the agent is busy in, named only to people who see it. */
|
|
58984
|
-
elsewhere: idSchema4.nullable().default(null)
|
|
58995
|
+
elsewhere: idSchema4.nullable().default(null),
|
|
58996
|
+
/** With `thinking`: no turn has taken the message yet ("Waiting for <agent> to pick this up"). */
|
|
58997
|
+
waiting: external_exports.boolean().default(false)
|
|
58985
58998
|
});
|
|
58986
58999
|
var setAgentLimitInputSchemaDefinition = external_exports.object({
|
|
58987
59000
|
workspaceId: workspaceIdSchema,
|
|
@@ -60406,7 +60419,9 @@ var realtimePublicationSchemaDefinition = external_exports.discriminatedUnion("t
|
|
|
60406
60419
|
text: external_exports.string(),
|
|
60407
60420
|
contextTokens: external_exports.number().int().nonnegative().nullable(),
|
|
60408
60421
|
contextWindow: external_exports.number().int().positive().nullable(),
|
|
60409
|
-
elsewhere: external_exports.string().nullable().optional()
|
|
60422
|
+
elsewhere: external_exports.string().nullable().optional(),
|
|
60423
|
+
/** With `thinking`: no turn has taken the message yet; apps that miss it read thinking. */
|
|
60424
|
+
waiting: external_exports.boolean().optional()
|
|
60410
60425
|
}),
|
|
60411
60426
|
external_exports.object({
|
|
60412
60427
|
type: external_exports.literal("typing"),
|
|
@@ -61851,6 +61866,15 @@ var vaultAlertRaisedPayloadSchemaDefinition = external_exports.object({
|
|
|
61851
61866
|
// ../../modules/vault/contract/src/vault-reference-chip.ts
|
|
61852
61867
|
var VaultReferenceChipSlot = uiTokens("vault").component("referenceChip");
|
|
61853
61868
|
var VaultMessageFootSlot = uiTokens("vault").component("messageFoot");
|
|
61869
|
+
var REFERENCE = /\{\{vault:([A-Za-z0-9_][A-Za-z0-9_./:-]*)\}\}/g;
|
|
61870
|
+
function vaultReferenceNames({ text: text2 }) {
|
|
61871
|
+
return [...new Set([...text2.matchAll(REFERENCE)].map((match) => match[1] ?? ""))].filter(
|
|
61872
|
+
(name3) => name3 !== ""
|
|
61873
|
+
);
|
|
61874
|
+
}
|
|
61875
|
+
function vaultReferenceConnectionName({ name: name3 }) {
|
|
61876
|
+
return name3.split(".")[0] ?? name3;
|
|
61877
|
+
}
|
|
61854
61878
|
|
|
61855
61879
|
// ../../modules/vault/contract/src/vault-pending.ts
|
|
61856
61880
|
var connectionName2 = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/);
|
|
@@ -62149,6 +62173,73 @@ var vaultAwsSessionSchemaDefinition = external_exports.object({
|
|
|
62149
62173
|
expiration: external_exports.iso.datetime({ offset: true })
|
|
62150
62174
|
});
|
|
62151
62175
|
|
|
62176
|
+
// ../../modules/vault/contract/src/vault-placeholders.ts
|
|
62177
|
+
var PLACEHOLDER = /\{\{\s*vault:[^}]*\}\}/;
|
|
62178
|
+
function unusableFieldProblems({
|
|
62179
|
+
fields
|
|
62180
|
+
}) {
|
|
62181
|
+
return Object.entries(fields).flatMap(([field, value]) => {
|
|
62182
|
+
if (PLACEHOLDER.test(value)) return [`${field} holds a vault placeholder, not a value`];
|
|
62183
|
+
if (value.trim() === field) return [`${field} holds its own name, not a value`];
|
|
62184
|
+
return [];
|
|
62185
|
+
});
|
|
62186
|
+
}
|
|
62187
|
+
function referenceParts(name3) {
|
|
62188
|
+
const dot = name3.indexOf(".");
|
|
62189
|
+
if (dot === -1) return { connection: name3, field: null };
|
|
62190
|
+
return { connection: name3.slice(0, dot), field: name3.slice(dot + 1) };
|
|
62191
|
+
}
|
|
62192
|
+
function commandReferenceNames({ command }) {
|
|
62193
|
+
return [...new Set(command.flatMap((word3) => vaultReferenceNames({ text: word3 })))];
|
|
62194
|
+
}
|
|
62195
|
+
function referenceValue({
|
|
62196
|
+
name: name3,
|
|
62197
|
+
released
|
|
62198
|
+
}) {
|
|
62199
|
+
const { connection, field } = referenceParts(name3);
|
|
62200
|
+
const fields = released.get(connection);
|
|
62201
|
+
if (!fields) {
|
|
62202
|
+
return {
|
|
62203
|
+
refusal: `{{vault:${name3}}} names ${connection}, which this run does not release`
|
|
62204
|
+
};
|
|
62205
|
+
}
|
|
62206
|
+
const names = Object.keys(fields).toSorted();
|
|
62207
|
+
if (field !== null) {
|
|
62208
|
+
const value = fields[field];
|
|
62209
|
+
if (value === void 0) {
|
|
62210
|
+
return { refusal: `${connection} has no field ${field}; its fields are ${names.join(", ")}` };
|
|
62211
|
+
}
|
|
62212
|
+
return { value };
|
|
62213
|
+
}
|
|
62214
|
+
const only = names.length === 1 ? fields[names[0] ?? ""] : void 0;
|
|
62215
|
+
if (only === void 0) {
|
|
62216
|
+
return {
|
|
62217
|
+
refusal: `{{vault:${connection}}} holds ${names.length} values (${names.join(", ")}); write {{vault:${connection}.FIELD}} or read $FIELD from the environment`
|
|
62218
|
+
};
|
|
62219
|
+
}
|
|
62220
|
+
return { value: only };
|
|
62221
|
+
}
|
|
62222
|
+
function fillCommandReferences({
|
|
62223
|
+
command,
|
|
62224
|
+
released
|
|
62225
|
+
}) {
|
|
62226
|
+
const values = /* @__PURE__ */ new Map();
|
|
62227
|
+
for (const name3 of commandReferenceNames({ command })) {
|
|
62228
|
+
const filled = referenceValue({ name: name3, released });
|
|
62229
|
+
if ("refusal" in filled) return filled;
|
|
62230
|
+
values.set(name3, filled.value);
|
|
62231
|
+
}
|
|
62232
|
+
if (values.size === 0) return { command: [...command] };
|
|
62233
|
+
return {
|
|
62234
|
+
command: command.map(
|
|
62235
|
+
(word3) => word3.replace(
|
|
62236
|
+
/\{\{vault:([A-Za-z0-9_][A-Za-z0-9_./:-]*)\}\}/g,
|
|
62237
|
+
(whole, name3) => values.get(name3) ?? whole
|
|
62238
|
+
)
|
|
62239
|
+
)
|
|
62240
|
+
};
|
|
62241
|
+
}
|
|
62242
|
+
|
|
62152
62243
|
// ../../modules/agent/contract/src/agent-access.ts
|
|
62153
62244
|
var idSchema5 = external_exports.string().min(1).max(80);
|
|
62154
62245
|
var agentGranteeSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
@@ -63570,7 +63661,9 @@ var agentFaceSchemaDefinition = external_exports.object({
|
|
|
63570
63661
|
/** A short-lived link to its picture; null for a sloth. */
|
|
63571
63662
|
imageUrl: external_exports.string().nullable(),
|
|
63572
63663
|
/** Deleted for good: its old messages show a grey sloth. */
|
|
63573
|
-
gone: external_exports.boolean().default(false)
|
|
63664
|
+
gone: external_exports.boolean().default(false),
|
|
63665
|
+
/** How it runs and whose it is, "Laze models · Ada": tells agents sharing a name apart. */
|
|
63666
|
+
detail: external_exports.string().default("")
|
|
63574
63667
|
});
|
|
63575
63668
|
var agentFaceSchema = agentFaceSchemaDefinition;
|
|
63576
63669
|
var agentPresenceSchemaDefinition = external_exports.object({
|
|
@@ -76079,7 +76172,7 @@ var appUnpublish = async ({ context, args }) => {
|
|
|
76079
76172
|
context,
|
|
76080
76173
|
args,
|
|
76081
76174
|
value: app2,
|
|
76082
|
-
text: `${app2.name} is
|
|
76175
|
+
text: `${app2.name} is offline. Its data and versions stay; laze app publish brings it back.
|
|
76083
76176
|
`
|
|
76084
76177
|
});
|
|
76085
76178
|
};
|
|
@@ -80905,9 +80998,47 @@ async function vaultRun({
|
|
|
80905
80998
|
if (!connection || args.rest.length === 0) throw new CliUsageError(USAGE8);
|
|
80906
80999
|
if (!reason) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
80907
81000
|
${USAGE8}`);
|
|
81001
|
+
const foreign = commandReferenceNames({ command: args.rest }).find(
|
|
81002
|
+
(name3) => vaultReferenceConnectionName({ name: name3 }) !== connection
|
|
81003
|
+
);
|
|
81004
|
+
if (foreign !== void 0) {
|
|
81005
|
+
const named = vaultReferenceConnectionName({ name: foreign });
|
|
81006
|
+
context.err(
|
|
81007
|
+
`laze vault: the command names {{vault:${foreign}}}, but this run releases only ${connection}, not ${named}. Nothing was asked and the command did not run.
|
|
81008
|
+
`
|
|
81009
|
+
);
|
|
81010
|
+
return 1;
|
|
81011
|
+
}
|
|
80908
81012
|
const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
|
|
80909
81013
|
if ("exitCode" in released) return released.exitCode;
|
|
80910
|
-
|
|
81014
|
+
const prepared = preparedCommand({
|
|
81015
|
+
command: args.rest,
|
|
81016
|
+
released: /* @__PURE__ */ new Map([[connection, released.env]])
|
|
81017
|
+
});
|
|
81018
|
+
if ("refusal" in prepared) {
|
|
81019
|
+
context.err(`${prepared.refusal}
|
|
81020
|
+
`);
|
|
81021
|
+
return 1;
|
|
81022
|
+
}
|
|
81023
|
+
return context.runCommand({ command: prepared.command, env: released.env });
|
|
81024
|
+
}
|
|
81025
|
+
function preparedCommand({
|
|
81026
|
+
command,
|
|
81027
|
+
released
|
|
81028
|
+
}) {
|
|
81029
|
+
for (const [name3, fields] of released) {
|
|
81030
|
+
const [problem] = unusableFieldProblems({ fields });
|
|
81031
|
+
if (problem !== void 0) {
|
|
81032
|
+
return {
|
|
81033
|
+
refusal: `laze vault: ${name3}: ${problem}, so the command did not run. Ask its owner to save the real value on the vault page.`
|
|
81034
|
+
};
|
|
81035
|
+
}
|
|
81036
|
+
}
|
|
81037
|
+
const filled = fillCommandReferences({ command, released });
|
|
81038
|
+
if ("refusal" in filled) {
|
|
81039
|
+
return { refusal: `laze vault: ${filled.refusal}. The command did not run.` };
|
|
81040
|
+
}
|
|
81041
|
+
return filled;
|
|
80911
81042
|
}
|
|
80912
81043
|
|
|
80913
81044
|
// src/services/vault-share-commands.service.ts
|
|
@@ -86140,7 +86271,7 @@ import { dirname as dirname22, join as join24, resolve as resolve15 } from "node
|
|
|
86140
86271
|
// src/rules/vault-manifest.rules.ts
|
|
86141
86272
|
var VARIABLE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
86142
86273
|
var CONNECTION = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
86143
|
-
var
|
|
86274
|
+
var REFERENCE2 = /^\{\{vault:([A-Za-z0-9][A-Za-z0-9_/-]{0,127})\}\}$/;
|
|
86144
86275
|
function refOf(name3) {
|
|
86145
86276
|
return name3.split("/").at(-1) ?? name3;
|
|
86146
86277
|
}
|
|
@@ -86165,7 +86296,7 @@ function lineOf4({ line, where }) {
|
|
|
86165
86296
|
if (!VARIABLE.test(variable)) {
|
|
86166
86297
|
throw new CliUsageError(`${where}: not a variable name: ${variable}`);
|
|
86167
86298
|
}
|
|
86168
|
-
const reference =
|
|
86299
|
+
const reference = REFERENCE2.exec(value);
|
|
86169
86300
|
if (reference?.[1]) return { kind: "reference", variable, ref: refOf(reference[1]) };
|
|
86170
86301
|
return { kind: "plain", variable, value: unquoted(value) };
|
|
86171
86302
|
}
|
|
@@ -86523,6 +86654,23 @@ function wrappedCommandOf(args) {
|
|
|
86523
86654
|
if (!encoded) return ["(shell)"];
|
|
86524
86655
|
return [Buffer.from(encoded, "base64").toString("utf8").slice(0, 2e3)];
|
|
86525
86656
|
}
|
|
86657
|
+
async function releasedKeys({
|
|
86658
|
+
context,
|
|
86659
|
+
args,
|
|
86660
|
+
refs,
|
|
86661
|
+
reason,
|
|
86662
|
+
command
|
|
86663
|
+
}) {
|
|
86664
|
+
const byConnection = /* @__PURE__ */ new Map();
|
|
86665
|
+
if (refs.length === 0) return { released: /* @__PURE__ */ new Map(), byConnection };
|
|
86666
|
+
const outcome = await releaseBatch({ context, args, refs, reason, command: [...command] });
|
|
86667
|
+
if ("exitCode" in outcome) return outcome;
|
|
86668
|
+
for (const entry of outcome.entries) {
|
|
86669
|
+
const fields = outcome.released.get(entry.ref)?.fields;
|
|
86670
|
+
if (entry.connection && fields) byConnection.set(entry.connection.name, fields);
|
|
86671
|
+
}
|
|
86672
|
+
return { released: outcome.released, byConnection };
|
|
86673
|
+
}
|
|
86526
86674
|
async function vaultEnv2({
|
|
86527
86675
|
context,
|
|
86528
86676
|
args: given
|
|
@@ -86549,12 +86697,20 @@ ${ENV_USAGE}`);
|
|
|
86549
86697
|
const badReason = refusedReason({ context, reason });
|
|
86550
86698
|
if (badReason !== null) return badReason;
|
|
86551
86699
|
const refs = refsOf(lines2);
|
|
86552
|
-
|
|
86553
|
-
|
|
86554
|
-
|
|
86555
|
-
|
|
86556
|
-
|
|
86557
|
-
|
|
86700
|
+
const outcome = await releasedKeys({
|
|
86701
|
+
context,
|
|
86702
|
+
args,
|
|
86703
|
+
refs,
|
|
86704
|
+
reason,
|
|
86705
|
+
command: shell ? wrappedCommandOf(args) : args.rest
|
|
86706
|
+
});
|
|
86707
|
+
if ("exitCode" in outcome) return outcome.exitCode;
|
|
86708
|
+
const { released, byConnection } = outcome;
|
|
86709
|
+
const prepared = preparedCommand({ command: shell ? [] : args.rest, released: byConnection });
|
|
86710
|
+
if ("refusal" in prepared) {
|
|
86711
|
+
context.err(`${prepared.refusal}
|
|
86712
|
+
`);
|
|
86713
|
+
return 1;
|
|
86558
86714
|
}
|
|
86559
86715
|
const env = environmentOf({ lines: lines2, released });
|
|
86560
86716
|
if (shell) {
|
|
@@ -86563,7 +86719,7 @@ ${ENV_USAGE}`);
|
|
|
86563
86719
|
return 0;
|
|
86564
86720
|
}
|
|
86565
86721
|
const redact = [...released.values()].flatMap(({ fields }) => Object.values(fields));
|
|
86566
|
-
return context.runCommand({ command:
|
|
86722
|
+
return context.runCommand({ command: prepared.command, env, redact });
|
|
86567
86723
|
}
|
|
86568
86724
|
async function vaultAws({
|
|
86569
86725
|
context,
|
package/package.json
CHANGED