@lazehq/cli 0.1.134 → 0.1.136
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 +127 -51
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -31893,6 +31893,15 @@ function isKeyMaterial(value) {
|
|
|
31893
31893
|
const c = charClasses(value);
|
|
31894
31894
|
return c.digit >= 2 && (c.lower >= 2 || c.upper >= 2);
|
|
31895
31895
|
}
|
|
31896
|
+
var VARIABLE_NAME = "[A-Za-z_][A-Za-z0-9_]*";
|
|
31897
|
+
var VARIABLE_REFERENCE = new RegExp(
|
|
31898
|
+
`^(?:\\$(${VARIABLE_NAME})|\\$\\{(${VARIABLE_NAME})\\}|%(${VARIABLE_NAME})%|\\$env:(${VARIABLE_NAME}))$`,
|
|
31899
|
+
"i"
|
|
31900
|
+
);
|
|
31901
|
+
function isVariableReference(value) {
|
|
31902
|
+
const name3 = VARIABLE_REFERENCE.exec(value)?.slice(1).find(Boolean);
|
|
31903
|
+
return name3 !== void 0 && !isKeyMaterial(name3);
|
|
31904
|
+
}
|
|
31896
31905
|
function isBasicAuthPayload(value) {
|
|
31897
31906
|
if (value.endsWith("=")) return true;
|
|
31898
31907
|
const c = charClasses(value);
|
|
@@ -32366,7 +32375,8 @@ function matchSlice({
|
|
|
32366
32375
|
}
|
|
32367
32376
|
const urlValues = urlValuesIn(text3);
|
|
32368
32377
|
const placed = urlValues.length === 0 ? found : inLinkValues({ text: text3, found, urlValues, ruleIds });
|
|
32369
|
-
|
|
32378
|
+
const values = placed.filter((match) => !isVariableReference(text3.slice(match.start, match.end)));
|
|
32379
|
+
return withoutOverlaps(values).map((match) => {
|
|
32370
32380
|
const value = text3.slice(match.start, match.end);
|
|
32371
32381
|
return {
|
|
32372
32382
|
value,
|
|
@@ -36960,7 +36970,7 @@ function shadowedLinkLineOf({ shadow }) {
|
|
|
36960
36970
|
}
|
|
36961
36971
|
|
|
36962
36972
|
// src/rules/cli-version.rules.ts
|
|
36963
|
-
var STAMPED = "0.1.
|
|
36973
|
+
var STAMPED = "0.1.136";
|
|
36964
36974
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36975
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36976
|
}
|
|
@@ -37534,7 +37544,8 @@ var SWITCHES = /* @__PURE__ */ new Set([
|
|
|
37534
37544
|
"all",
|
|
37535
37545
|
"resend",
|
|
37536
37546
|
"replace",
|
|
37537
|
-
"ask"
|
|
37547
|
+
"ask",
|
|
37548
|
+
"real-value"
|
|
37538
37549
|
]);
|
|
37539
37550
|
function parseArgs({ argv }) {
|
|
37540
37551
|
const words = [];
|
|
@@ -59688,6 +59699,12 @@ function uiTokens(owner) {
|
|
|
59688
59699
|
};
|
|
59689
59700
|
}
|
|
59690
59701
|
|
|
59702
|
+
// ../../packages/module/src/contract/read-audience.ts
|
|
59703
|
+
var AUDIENCE_KEYWORD = "x-laze-audience";
|
|
59704
|
+
function ownerOnly(schema) {
|
|
59705
|
+
return schema.meta({ [AUDIENCE_KEYWORD]: "owner" });
|
|
59706
|
+
}
|
|
59707
|
+
|
|
59691
59708
|
// ../../modules/api-key/contract/src/machine-key.ts
|
|
59692
59709
|
var MACHINE_PROOF_HEADER = "dpop";
|
|
59693
59710
|
var MACHINE_KEY_WARNING_HEADER = "x-laze-key-warning";
|
|
@@ -60218,7 +60235,9 @@ var vaultValueShapeSchemaDefinition = external_exports.object({
|
|
|
60218
60235
|
var vaultValueShapeSchema = vaultValueShapeSchemaDefinition;
|
|
60219
60236
|
var vaultBoundaryHandoutSchemaDefinition = external_exports.object({
|
|
60220
60237
|
connectionId: external_exports.string(),
|
|
60221
|
-
shapes: external_exports.record(external_exports.string(), vaultValueShapeSchema).optional()
|
|
60238
|
+
shapes: external_exports.record(external_exports.string(), vaultValueShapeSchema).optional(),
|
|
60239
|
+
/** The fields that hold a placeholder on the computer; the release's other fields are values. */
|
|
60240
|
+
fields: external_exports.array(external_exports.string()).optional()
|
|
60222
60241
|
});
|
|
60223
60242
|
var vaultBoundaryHandoutSchema = vaultBoundaryHandoutSchemaDefinition;
|
|
60224
60243
|
var vaultEgressHostSchemaDefinition = external_exports.object({
|
|
@@ -61049,12 +61068,16 @@ var vaultEgressReleaseInputSchemaDefinition = external_exports.object({
|
|
|
61049
61068
|
/** The run's P-256 public key, base64url; a sealed connection is released only to it. */
|
|
61050
61069
|
recipient: external_exports.string().max(200).optional(),
|
|
61051
61070
|
/** Set by a computer's egress proxy: a key it swaps comes back as shapes, not values. */
|
|
61052
|
-
placeholders: external_exports.boolean().default(false)
|
|
61071
|
+
placeholders: external_exports.boolean().default(false),
|
|
61072
|
+
/** `laze vault run --value` on a computer: the real value in place of the stand-in, if judged. */
|
|
61073
|
+
realValue: external_exports.boolean().default(false)
|
|
61053
61074
|
});
|
|
61054
61075
|
var vaultEgressReleaseInputSchema = vaultEgressReleaseInputSchemaDefinition;
|
|
61076
|
+
var vaultRunHandoutSchema = external_exports.enum(["placeholders", "real_value", "value"]);
|
|
61055
61077
|
var vaultEgressStatusInputSchemaDefinition = external_exports.object({
|
|
61056
61078
|
agentId: external_exports.string().min(1),
|
|
61057
|
-
requestId: external_exports.string().min(1)
|
|
61079
|
+
requestId: external_exports.string().min(1),
|
|
61080
|
+
handout: vaultRunHandoutSchema.default("value")
|
|
61058
61081
|
});
|
|
61059
61082
|
var vaultApprovalStateSchema = external_exports.enum([
|
|
61060
61083
|
"pending",
|
|
@@ -62507,7 +62530,7 @@ var vaultSessionSchemaDefinition = external_exports.object({
|
|
|
62507
62530
|
});
|
|
62508
62531
|
var vaultSessionSchema = vaultSessionSchemaDefinition;
|
|
62509
62532
|
var vaultSessionReleaseInputSchemaDefinition = external_exports.object({
|
|
62510
|
-
...vaultEgressReleaseInputSchema.omit({ agentId: true, placeholders: true }).shape,
|
|
62533
|
+
...vaultEgressReleaseInputSchema.omit({ agentId: true, placeholders: true, realValue: true }).shape,
|
|
62511
62534
|
session: vaultSessionSchema
|
|
62512
62535
|
});
|
|
62513
62536
|
var vaultSessionStatusInputSchemaDefinition = external_exports.object({
|
|
@@ -65696,7 +65719,9 @@ var approvalNoticeSchema = external_exports.object({
|
|
|
65696
65719
|
/** The chat message holding the card, or the feed when there is none. */
|
|
65697
65720
|
path: external_exports.string().startsWith("/").max(1024),
|
|
65698
65721
|
/** The person's Notifications count, from chat: the iPhone's icon badge shows it. */
|
|
65699
|
-
badge: external_exports.number().int().nonnegative().optional()
|
|
65722
|
+
badge: external_exports.number().int().nonnegative().optional(),
|
|
65723
|
+
/** The connector it asks for, as a picture: its logo, or the vault ring for a plain key. */
|
|
65724
|
+
avatar: noticeAvatarSchemaDefinition.optional()
|
|
65700
65725
|
});
|
|
65701
65726
|
var feedNoticeSchema = external_exports.object({
|
|
65702
65727
|
workspaceId: workspaceIdSchema2,
|
|
@@ -71632,7 +71657,7 @@ var agentSchemaDefinition = external_exports.object({
|
|
|
71632
71657
|
/** `<roster>:<seed>`, `file:<file id>`, or empty for the sloth drawn from its id. */
|
|
71633
71658
|
avatar: external_exports.string().max(AGENT_AVATAR_MAX).default(""),
|
|
71634
71659
|
/** A Laze agent's SOUL.md. */
|
|
71635
|
-
instructions: external_exports.string().default(""),
|
|
71660
|
+
instructions: ownerOnly(external_exports.string().default("")),
|
|
71636
71661
|
/** A Laze models agent's level: the one picked, or what Default resolves to. */
|
|
71637
71662
|
modelLevel: agentModelLevelSchema.nullable().default(null),
|
|
71638
71663
|
/** True when `modelLevel` is what Default resolves to, not a level someone picked. */
|
|
@@ -71648,9 +71673,9 @@ var agentSchemaDefinition = external_exports.object({
|
|
|
71648
71673
|
/** The thinking effort it runs at; null for its model's default. */
|
|
71649
71674
|
effort: external_exports.string().nullable().default(null),
|
|
71650
71675
|
/** The models its harness listed for its login when it last started; null before then. */
|
|
71651
|
-
harnessModels: harnessModelsSchema.nullable().default(null),
|
|
71676
|
+
harnessModels: ownerOnly(harnessModelsSchema.nullable().default(null)),
|
|
71652
71677
|
/** The GitHub identity a Laze agent works as; null when it has none. */
|
|
71653
|
-
github: agentGithubSchema.nullable().default(null),
|
|
71678
|
+
github: ownerOnly(agentGithubSchema.nullable().default(null)),
|
|
71654
71679
|
/** Out of usage (its login or its Laze models budget) until this time; null when it can work. */
|
|
71655
71680
|
limitedUntil: external_exports.iso.datetime().nullable().default(null),
|
|
71656
71681
|
/** Why it is limited: "usage" (its login; also when absent) or "budget" (Laze models). */
|
|
@@ -71659,17 +71684,17 @@ var agentSchemaDefinition = external_exports.object({
|
|
|
71659
71684
|
pausedAt: external_exports.iso.datetime().nullable().default(null),
|
|
71660
71685
|
/** Who paused it and the reason they gave; null when it runs or no reason was given. */
|
|
71661
71686
|
pausedByUserId: external_exports.string().nullable().default(null),
|
|
71662
|
-
pauseReason: external_exports.string().nullable().default(null),
|
|
71687
|
+
pauseReason: ownerOnly(external_exports.string().nullable().default(null)),
|
|
71663
71688
|
/** The owner's own machine the agent's turns run on; null for a Laze sandbox. */
|
|
71664
|
-
host: agentHostSchemaDefinition.nullable().default(null),
|
|
71689
|
+
host: ownerOnly(agentHostSchemaDefinition.nullable().default(null)),
|
|
71665
71690
|
/** The Laze computer it runs on, as compute names it; null for its owner's default computer. */
|
|
71666
|
-
computerKey: external_exports.string().nullable().default(null),
|
|
71691
|
+
computerKey: ownerOnly(external_exports.string().nullable().default(null)),
|
|
71667
71692
|
/** The login pool a Claude Code or Codex agent draws from; null for its owner's own logins. */
|
|
71668
|
-
loginPoolId: external_exports.string().nullable().default(null),
|
|
71693
|
+
loginPoolId: ownerOnly(external_exports.string().nullable().default(null)),
|
|
71669
71694
|
/** The login it runs on now, "On Work Max"; null before its first turn and on other harnesses. */
|
|
71670
|
-
login: agentLoginSchema.nullable().default(null),
|
|
71695
|
+
login: ownerOnly(agentLoginSchema.nullable().default(null)),
|
|
71671
71696
|
/** The session a connected agent listens in; null until its CLI first names one. */
|
|
71672
|
-
session: agentSessionSchemaDefinition.nullable().optional(),
|
|
71697
|
+
session: ownerOnly(agentSessionSchemaDefinition.nullable().optional()),
|
|
71673
71698
|
/** How the background setup after creating it went. */
|
|
71674
71699
|
setup: agentSetupStateSchema.optional(),
|
|
71675
71700
|
/** `support` for the locked Laze Support agent; absent reads as `standard`. */
|
|
@@ -72117,6 +72142,7 @@ var agentTurnTokenSchemaDefinition = external_exports.object({
|
|
|
72117
72142
|
var {
|
|
72118
72143
|
agentId: _agentId,
|
|
72119
72144
|
placeholders: _placeholders,
|
|
72145
|
+
realValue: _realValue,
|
|
72120
72146
|
...releaseShape
|
|
72121
72147
|
} = vaultEgressReleaseInputSchema.shape;
|
|
72122
72148
|
var agentVaultReleaseInputSchemaDefinition = external_exports.object({
|
|
@@ -73128,7 +73154,7 @@ var AGENT_MCP_TOOLS = [
|
|
|
73128
73154
|
name: "support_read_thread",
|
|
73129
73155
|
operationId: "supportAgentThread",
|
|
73130
73156
|
readOnly: true,
|
|
73131
|
-
description: "Laze Support only: read the support thread your turn names,
|
|
73157
|
+
description: "Laze Support only: read the support thread your turn names: its text, voice notes' words, and its newest pictures to look at."
|
|
73132
73158
|
},
|
|
73133
73159
|
{
|
|
73134
73160
|
name: "support_answer",
|
|
@@ -85457,16 +85483,18 @@ async function handedOut({
|
|
|
85457
85483
|
() => void 0
|
|
85458
85484
|
);
|
|
85459
85485
|
context.err(
|
|
85460
|
-
`laze vault: ${Object.keys(fields).join(", ")} of ${name3} ${Object.keys(fields).length === 1 ? "holds" : "hold"} a stand-in; Laze's proxy puts the key in only on sites approved for it. A command that needs the value itself (signing, a database)
|
|
85486
|
+
`laze vault: ${Object.keys(fields).join(", ")} of ${name3} ${Object.keys(fields).length === 1 ? "holds" : "hold"} a stand-in; Laze's proxy puts the key in only on sites approved for it. A command that needs the value itself (signing, SSH, a database) can ask for it with laze vault run --real-value.
|
|
85461
85487
|
`
|
|
85462
85488
|
);
|
|
85463
85489
|
}
|
|
85464
85490
|
|
|
85465
85491
|
// src/services/vault-commands.service.ts
|
|
85466
|
-
var USAGE3 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
|
|
85492
|
+
var USAGE3 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] [--real-value] -- <command> [args...]
|
|
85467
85493
|
Runs the command with the connection's values in its environment, on a Laze agent's computer,
|
|
85468
85494
|
on a machine it runs on, where a connected agent runs, or signed in as yourself, where it asks
|
|
85469
85495
|
as the calling Claude Code, Codex, Kanban or terminal session.
|
|
85496
|
+
--real-value on a Laze computer: the key's real value, not the stand-in, for a command that
|
|
85497
|
+
signs or connects with it itself (SSH, a database, AWS); the vault judges each ask
|
|
85470
85498
|
--channel <id> the conversation whose turn it runs in, when the agent answers in several
|
|
85471
85499
|
--as <name> the session's name on the card when signed in as yourself (or LAZE_SESSION_NAME)`;
|
|
85472
85500
|
var POLL_MS = 3e3;
|
|
@@ -85636,13 +85664,22 @@ function leaseHolds({
|
|
|
85636
85664
|
const ends = release2.sealed?.leaseEndsAt;
|
|
85637
85665
|
return ends !== void 0 && Temporal3.Instant.from(ends).epochMilliseconds > nowMs2;
|
|
85638
85666
|
}
|
|
85667
|
+
function standInFieldsOf({
|
|
85668
|
+
env,
|
|
85669
|
+
boundary
|
|
85670
|
+
}) {
|
|
85671
|
+
const named = boundary.fields;
|
|
85672
|
+
if (!named) return { ...env };
|
|
85673
|
+
return Object.fromEntries(Object.entries(env).filter(([field]) => named.includes(field)));
|
|
85674
|
+
}
|
|
85639
85675
|
async function vaultRelease({
|
|
85640
85676
|
context,
|
|
85641
85677
|
args,
|
|
85642
85678
|
connection,
|
|
85643
85679
|
reason: reason2,
|
|
85644
85680
|
command,
|
|
85645
|
-
value = false
|
|
85681
|
+
value = false,
|
|
85682
|
+
realValue = false
|
|
85646
85683
|
}) {
|
|
85647
85684
|
const deadline = deadlineOf({ args, nowMs: context.nowMs() });
|
|
85648
85685
|
const env = context.environment.inherited;
|
|
@@ -85660,7 +85697,8 @@ async function vaultRelease({
|
|
|
85660
85697
|
reason: reason2,
|
|
85661
85698
|
command,
|
|
85662
85699
|
recipient: run4.publicKey,
|
|
85663
|
-
...value && { value: true }
|
|
85700
|
+
...value && { value: true },
|
|
85701
|
+
...realValue && { realValue: true }
|
|
85664
85702
|
});
|
|
85665
85703
|
let release2;
|
|
85666
85704
|
try {
|
|
@@ -85786,11 +85824,20 @@ ${USAGE3}`);
|
|
|
85786
85824
|
);
|
|
85787
85825
|
return 1;
|
|
85788
85826
|
}
|
|
85789
|
-
const
|
|
85827
|
+
const realValue = args.flags["real-value"] === true;
|
|
85828
|
+
const released = await vaultRelease({
|
|
85829
|
+
context,
|
|
85830
|
+
args,
|
|
85831
|
+
connection,
|
|
85832
|
+
reason: reason2,
|
|
85833
|
+
command: args.rest,
|
|
85834
|
+
realValue
|
|
85835
|
+
});
|
|
85790
85836
|
if ("exitCode" in released) return released.exitCode;
|
|
85791
85837
|
if (released.boundary) {
|
|
85792
85838
|
const { connectionId } = released.boundary;
|
|
85793
|
-
|
|
85839
|
+
const fields = standInFieldsOf({ env: released.env, boundary: released.boundary });
|
|
85840
|
+
await handedOut({ context, name: connection, connectionId, fields });
|
|
85794
85841
|
}
|
|
85795
85842
|
const prepared = preparedCommand({
|
|
85796
85843
|
command: args.rest,
|
|
@@ -92634,42 +92681,44 @@ var machineDefinition = external_exports.object({
|
|
|
92634
92681
|
requesterUserId: idSchema26,
|
|
92635
92682
|
renterAgentId: idSchema26.nullable(),
|
|
92636
92683
|
channelId: idSchema26.nullable(),
|
|
92637
|
-
ipAddress: external_exports.string().nullable(),
|
|
92638
|
-
sites: external_exports.array(machineSiteDefinition),
|
|
92684
|
+
ipAddress: ownerOnly(external_exports.string().nullable()),
|
|
92685
|
+
sites: ownerOnly(external_exports.array(machineSiteDefinition)),
|
|
92639
92686
|
/** Members and agents the owner shared the machine with, beyond the owner's own agents. */
|
|
92640
|
-
grants: external_exports.array(machineGrantDefinition),
|
|
92687
|
+
grants: ownerOnly(external_exports.array(machineGrantDefinition)),
|
|
92641
92688
|
/** Set while the owner has the screen open; the agent waits until then. */
|
|
92642
92689
|
inHumanUse: external_exports.boolean(),
|
|
92643
92690
|
/** The spend cap for one `budgetPeriod`, at list price. */
|
|
92644
|
-
budgetUsd: external_exports.number().nonnegative(),
|
|
92691
|
+
budgetUsd: ownerOnly(external_exports.number().nonnegative()),
|
|
92645
92692
|
budgetPeriod: machineBudgetPeriodSchema,
|
|
92646
92693
|
/** What the machine cost so far in the current budget period. */
|
|
92647
|
-
periodCostUsd: external_exports.number().nonnegative(),
|
|
92694
|
+
periodCostUsd: ownerOnly(external_exports.number().nonnegative()),
|
|
92648
92695
|
/** Set when the period's cost reached the cap: the machine sleeps until the period ends. */
|
|
92649
92696
|
budgetReached: external_exports.boolean(),
|
|
92650
92697
|
/** When the current budget period ends and the cost starts again from zero. */
|
|
92651
92698
|
budgetResetsAt: external_exports.iso.datetime(),
|
|
92652
|
-
monthCostUsd: external_exports.number().nonnegative(),
|
|
92699
|
+
monthCostUsd: ownerOnly(external_exports.number().nonnegative()),
|
|
92653
92700
|
price: machinePriceDefinition,
|
|
92654
92701
|
/** Whether the machine's daemon holds its link to Laze right now. */
|
|
92655
92702
|
online: external_exports.boolean(),
|
|
92656
92703
|
/** When the daemon was last linked; null before it ever was. */
|
|
92657
92704
|
lastSeenAt: external_exports.iso.datetime().nullable(),
|
|
92658
92705
|
/** What an own machine's connector reported last, and when. */
|
|
92659
|
-
health: machineHealthSchema.nullable(),
|
|
92706
|
+
health: ownerOnly(machineHealthSchema.nullable()),
|
|
92660
92707
|
healthCheckedAt: external_exports.iso.datetime().nullable(),
|
|
92661
92708
|
/** While an own machine waits for its connector: when the connect code stops working. */
|
|
92662
92709
|
connectExpiresAt: external_exports.iso.datetime().nullable(),
|
|
92663
92710
|
/** Set on an own machine Laze reaches over SSH instead of through the connector. */
|
|
92664
|
-
ssh: machineSshSchema.optional(),
|
|
92711
|
+
ssh: ownerOnly(machineSshSchema.optional()),
|
|
92665
92712
|
/** The owner's agents set to run on this own machine. */
|
|
92666
|
-
hostedAgents:
|
|
92667
|
-
external_exports.
|
|
92668
|
-
|
|
92669
|
-
|
|
92670
|
-
|
|
92671
|
-
|
|
92672
|
-
|
|
92713
|
+
hostedAgents: ownerOnly(
|
|
92714
|
+
external_exports.array(
|
|
92715
|
+
external_exports.object({
|
|
92716
|
+
id: idSchema26,
|
|
92717
|
+
name: external_exports.string(),
|
|
92718
|
+
whenOffline: external_exports.enum(["wait", "sandbox"])
|
|
92719
|
+
})
|
|
92720
|
+
).default([])
|
|
92721
|
+
),
|
|
92673
92722
|
lastUsedAt: external_exports.iso.datetime(),
|
|
92674
92723
|
createdAt: external_exports.iso.datetime(),
|
|
92675
92724
|
/** The machine's screen in Laze; absent where the deployment names no origin. */
|
|
@@ -93966,7 +94015,7 @@ async function answerSupportLine({
|
|
|
93966
94015
|
const scoped = client.withHeaders({ "x-laze-turn": turn });
|
|
93967
94016
|
try {
|
|
93968
94017
|
const answer6 = call.body === void 0 ? await scoped.get(call.path) : await scoped.post(call.path, call.body);
|
|
93969
|
-
return rpc(id8, { result: { content:
|
|
94018
|
+
return rpc(id8, { result: { content: contentOf(answer6) } });
|
|
93970
94019
|
} catch (error63) {
|
|
93971
94020
|
if (!(error63 instanceof LazeApiError)) throw error63;
|
|
93972
94021
|
const text3 = `${error63.code}: ${error63.message}`;
|
|
@@ -93989,6 +94038,20 @@ function routeOf({
|
|
|
93989
94038
|
}
|
|
93990
94039
|
return null;
|
|
93991
94040
|
}
|
|
94041
|
+
function contentOf(answer6) {
|
|
94042
|
+
const { images, ...rest } = recordOf3(answer6);
|
|
94043
|
+
const pictures = Array.isArray(images) ? images.map(recordOf3) : [];
|
|
94044
|
+
if (pictures.length === 0) return [{ type: "text", text: JSON.stringify(answer6) }];
|
|
94045
|
+
return [
|
|
94046
|
+
{ type: "text", text: JSON.stringify(rest) },
|
|
94047
|
+
...pictures.flatMap(
|
|
94048
|
+
({ attachmentId, messageId, data, contentType }) => typeof data === "string" && typeof contentType === "string" ? [
|
|
94049
|
+
{ type: "text", text: `Picture ${String(attachmentId)} on line ${String(messageId)}:` },
|
|
94050
|
+
{ type: "image", data, mimeType: contentType }
|
|
94051
|
+
] : []
|
|
94052
|
+
)
|
|
94053
|
+
];
|
|
94054
|
+
}
|
|
93992
94055
|
function rpc(id8, body) {
|
|
93993
94056
|
return JSON.stringify({ jsonrpc: "2.0", id: id8, ...body });
|
|
93994
94057
|
}
|
|
@@ -95408,7 +95471,8 @@ var DISCORD_PERMISSIONS = {
|
|
|
95408
95471
|
SEND_MESSAGES_IN_THREADS: 1n << 38n
|
|
95409
95472
|
};
|
|
95410
95473
|
var discordSetupDefinition = external_exports.object({
|
|
95411
|
-
|
|
95474
|
+
/** The handle that saves the bot; empty to anyone who cannot set it up. */
|
|
95475
|
+
setupKey: external_exports.string(),
|
|
95412
95476
|
/** The OAuth2 redirect to add in the portal. */
|
|
95413
95477
|
redirectUrl: external_exports.url(),
|
|
95414
95478
|
/** The Developer Portal's applications page. */
|
|
@@ -95791,8 +95855,12 @@ var overview = async ({ context, args, client }) => {
|
|
|
95791
95855
|
const view = await client.get(DISCORD_KEY_PATHS.overview);
|
|
95792
95856
|
if (json4({ context, args, data: view })) return;
|
|
95793
95857
|
if (!view.setup) context.out("No Discord bot is set up. An admin runs `laze discord setup`.\n");
|
|
95794
|
-
else if (!view.setup.saved)
|
|
95795
|
-
|
|
95858
|
+
else if (!view.setup.saved) {
|
|
95859
|
+
context.out(
|
|
95860
|
+
view.setup.setupKey ? `Setup started: ${view.setup.setupKey}
|
|
95861
|
+
` : "An admin started setup.\n"
|
|
95862
|
+
);
|
|
95863
|
+
}
|
|
95796
95864
|
if (view.connections.length === 0) return context.out("No Discord server is connected.\n");
|
|
95797
95865
|
for (const row of view.connections) printConnection2({ context, row });
|
|
95798
95866
|
};
|
|
@@ -97534,6 +97602,8 @@ var feedApprovalSchemaDefinition = external_exports.object({
|
|
|
97534
97602
|
/** The app, for an `app_publish` or `app_access` card. */
|
|
97535
97603
|
appId: external_exports.string().nullable(),
|
|
97536
97604
|
subject: external_exports.string(),
|
|
97605
|
+
/** A vault card's connector ("Gmail") when its key is one, so the card shows that logo. */
|
|
97606
|
+
service: external_exports.string().nullable().optional(),
|
|
97537
97607
|
action: external_exports.string(),
|
|
97538
97608
|
agentId: external_exports.string(),
|
|
97539
97609
|
reason: external_exports.string(),
|
|
@@ -100138,7 +100208,7 @@ var PERSONAL_WORDS = {
|
|
|
100138
100208
|
};
|
|
100139
100209
|
var printJson9 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
|
|
100140
100210
|
`);
|
|
100141
|
-
function
|
|
100211
|
+
function contentOf2({ value, flag: flag2 }) {
|
|
100142
100212
|
if (value === "full" || value === "metadata") return value;
|
|
100143
100213
|
throw new CliUsageError(`${flag2} takes full or metadata.
|
|
100144
100214
|
${LANGWATCH_USAGE}`);
|
|
@@ -100258,7 +100328,7 @@ ${LANGWATCH_USAGE}`);
|
|
|
100258
100328
|
}
|
|
100259
100329
|
async function turnOn2({ context, args }) {
|
|
100260
100330
|
const content = args.flags.content;
|
|
100261
|
-
const level2 = content === void 0 ? void 0 :
|
|
100331
|
+
const level2 = content === void 0 ? void 0 : contentOf2({ value: flagText({ args, name: "content" }), flag: "--content" });
|
|
100262
100332
|
const { client } = await signedIn({ context, args });
|
|
100263
100333
|
const integration = await client.post(
|
|
100264
100334
|
LANGWATCH_REST_PATHS.enable,
|
|
@@ -100283,7 +100353,7 @@ ${LANGWATCH_USAGE}`);
|
|
|
100283
100353
|
}
|
|
100284
100354
|
async function level({ context, args }) {
|
|
100285
100355
|
const personalLevel = personalOf({ args });
|
|
100286
|
-
const team = args.words[2] === void 0 && personalLevel !== void 0 ? void 0 :
|
|
100356
|
+
const team = args.words[2] === void 0 && personalLevel !== void 0 ? void 0 : contentOf2({ value: args.words[2], flag: "level" });
|
|
100287
100357
|
const { client } = await signedIn({ context, args });
|
|
100288
100358
|
const integration = await client.post(LANGWATCH_REST_PATHS.level, {
|
|
100289
100359
|
...team ? { level: team } : {},
|
|
@@ -105567,7 +105637,8 @@ async function releaseBatch({
|
|
|
105567
105637
|
for (const [key, release2] of settled3) {
|
|
105568
105638
|
if (release2.outcome !== "allow" || !release2.boundary) continue;
|
|
105569
105639
|
const { connectionId } = release2.boundary;
|
|
105570
|
-
|
|
105640
|
+
const fields = standInFieldsOf({ env: release2.env, boundary: release2.boundary });
|
|
105641
|
+
await handedOut({ context, name: key, connectionId, fields });
|
|
105571
105642
|
}
|
|
105572
105643
|
return outcome;
|
|
105573
105644
|
}
|
|
@@ -106794,7 +106865,7 @@ var USAGE20 = [
|
|
|
106794
106865
|
" laze whatsapp read [<machine>] <chat> [--limit <n>] a chat's last messages, oldest first",
|
|
106795
106866
|
" (a read your owner set to Always ask waits for their answer; --request <id> picks it up later)",
|
|
106796
106867
|
" laze whatsapp file [<machine>] <chat> <message-id> [--out <path>] save a message's photo, voice message or file",
|
|
106797
|
-
' laze whatsapp send <machine> <chat> "<text>"|-
|
|
106868
|
+
' laze whatsapp send [<machine>] <chat> "<text>"|- send as the owner (- reads stdin); an agent waits for their approval',
|
|
106798
106869
|
" laze whatsapp status <send-id> where a send stands",
|
|
106799
106870
|
" laze whatsapp sync [<machine>] check WhatsApp now (the owner only)",
|
|
106800
106871
|
WHATSAPP_PAIRING_USAGE,
|
|
@@ -106931,12 +107002,17 @@ Still waiting. Run \`laze whatsapp status ${send5.id}\` later to see the answer.
|
|
|
106931
107002
|
return send5.state === "sent" || !SETTLED.has(send5.state) ? 0 : 1;
|
|
106932
107003
|
}
|
|
106933
107004
|
async function send4({ context, args }) {
|
|
106934
|
-
const
|
|
107005
|
+
const after = args.words.length - 2;
|
|
107006
|
+
const fewest = args.rest.length > 0 ? 1 : 2;
|
|
107007
|
+
if (after < fewest) throw new CliUsageError(USAGE20);
|
|
107008
|
+
const named = after > fewest;
|
|
107009
|
+
const textAt = named ? 4 : 3;
|
|
107010
|
+
const text3 = args.rest.length > 0 && args.words.length <= textAt ? args.rest.join(" ").trim() : await textOf({ context, args, from: textAt });
|
|
106935
107011
|
if (!text3) throw new CliUsageError(USAGE20);
|
|
106936
107012
|
const client = await computeClient({ context, args });
|
|
106937
107013
|
const asked = await client.post(PATHS3.send, {
|
|
106938
|
-
machine: word2({ args, at: 2 }),
|
|
106939
|
-
chat: word2({ args, at: 3 }),
|
|
107014
|
+
...named ? { machine: word2({ args, at: 2 }) } : {},
|
|
107015
|
+
chat: word2({ args, at: named ? 3 : 2 }),
|
|
106940
107016
|
text: text3
|
|
106941
107017
|
});
|
|
106942
107018
|
if (!SETTLED.has(asked.state) && !args.flags.json) context.err(`${asked.outcome}
|
package/package.json
CHANGED