@lazehq/cli 0.1.68 → 0.1.70
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 +251 -102
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -36927,7 +36927,7 @@ function flagText({
|
|
|
36927
36927
|
}
|
|
36928
36928
|
|
|
36929
36929
|
// src/rules/cli-version.rules.ts
|
|
36930
|
-
var STAMPED = "0.1.
|
|
36930
|
+
var STAMPED = "0.1.70";
|
|
36931
36931
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36932
36932
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36933
36933
|
}
|
|
@@ -59548,7 +59548,9 @@ var layoutPartSchemaDefinition = external_exports.union([
|
|
|
59548
59548
|
]);
|
|
59549
59549
|
var messageLayoutSchemaDefinition = external_exports.object({
|
|
59550
59550
|
/** No parts means the source drew only its text: no layout is kept. */
|
|
59551
|
-
parts: external_exports.array(layoutPartSchemaDefinition).max(LAYOUT_BLOCKS_MAX)
|
|
59551
|
+
parts: external_exports.array(layoutPartSchemaDefinition).max(LAYOUT_BLOCKS_MAX),
|
|
59552
|
+
/** Served only: each https image on a host the page does not allow, to its signed address. */
|
|
59553
|
+
images: external_exports.record(external_exports.string().max(2e3), external_exports.string().max(5e3)).optional()
|
|
59552
59554
|
});
|
|
59553
59555
|
var messageLayoutSchema = messageLayoutSchemaDefinition;
|
|
59554
59556
|
|
|
@@ -60205,6 +60207,8 @@ var messageSchemaDefinition = external_exports.object({
|
|
|
60205
60207
|
forward: messageForwardSchemaDefinition.nullable().optional(),
|
|
60206
60208
|
/** The blocks and attachments a mirrored message's source drew; clients draw it for the body. */
|
|
60207
60209
|
layout: messageLayoutSchema.nullable().optional(),
|
|
60210
|
+
/** Each https body image and outside author picture the page cannot load, to its Laze address. */
|
|
60211
|
+
images: external_exports.record(external_exports.string().max(2e3), external_exports.string().max(5e3)).optional(),
|
|
60208
60212
|
/** A message written in Laze that its mirror is still waiting to send, or could not send. */
|
|
60209
60213
|
mirrorDelivery: mirrorDeliverySchema.nullable().optional(),
|
|
60210
60214
|
/** A thread reply also sent to its conversation: it shows in the thread and the channel. */
|
|
@@ -60806,7 +60810,10 @@ var startUploadInputSchemaDefinition = external_exports.object({
|
|
|
60806
60810
|
channelId: idSchema4,
|
|
60807
60811
|
fileName: external_exports.string().trim().min(1).max(255),
|
|
60808
60812
|
contentType: external_exports.string().trim().max(127).default("application/octet-stream"),
|
|
60809
|
-
sizeBytes: external_exports.number().int().nonnegative()
|
|
60813
|
+
sizeBytes: external_exports.number().int().nonnegative(),
|
|
60814
|
+
/** An image's size as the browser read it, so its box is known before the worker reads it. */
|
|
60815
|
+
width: external_exports.number().optional(),
|
|
60816
|
+
height: external_exports.number().optional()
|
|
60810
60817
|
});
|
|
60811
60818
|
var startUploadInputSchema = startUploadInputSchemaDefinition;
|
|
60812
60819
|
var uploadPartSchemaDefinition = external_exports.object({
|
|
@@ -61234,6 +61241,7 @@ var chatTrpc = joinTrpcContracts(
|
|
|
61234
61241
|
// ../../modules/notification/contract/src/apns.ts
|
|
61235
61242
|
var APNS_DEFAULT_BUNDLE_ID = "ai.langwatch.laze";
|
|
61236
61243
|
var APNS_APPROVAL_CATEGORY = "LAZE_APPROVAL";
|
|
61244
|
+
var feedCardClosedReasonSchema = external_exports.enum(["read", "done", "snoozed"]);
|
|
61237
61245
|
var apnsEnvironmentSchema = external_exports.enum(["sandbox", "production"]);
|
|
61238
61246
|
var apnsTokenSchema = external_exports.string().regex(/^[0-9a-fA-F]{64,200}$/, "an APNs device token is 64 to 200 hex characters").transform((token2) => token2.toLowerCase());
|
|
61239
61247
|
var installIdSchema = external_exports.string().regex(/^[A-Za-z0-9_-]{8,128}$/, "an install id is 8 to 128 letters, digits, - or _");
|
|
@@ -61280,12 +61288,14 @@ var apnsPayloadSchemaDefinition = external_exports.object({
|
|
|
61280
61288
|
seq: external_exports.number().int().nonnegative().optional(),
|
|
61281
61289
|
clear: external_exports.object({ threadId: external_exports.string().min(1).max(200), upToSeq: external_exports.number().int().nonnegative() }).strict().optional(),
|
|
61282
61290
|
/**
|
|
61283
|
-
* Absent on an alert; "read" on the silent push a read sends; "approval-decided"
|
|
61284
|
-
*
|
|
61291
|
+
* Absent on an alert; "read" on the silent push a read sends; "approval-decided" and
|
|
61292
|
+
* "feed-card-closed" on the silent pushes that take an alert with the same `cardId` off.
|
|
61285
61293
|
*/
|
|
61286
|
-
type: external_exports.enum(["read", "approval-decided"]).optional(),
|
|
61287
|
-
/** An approval alert, and the push that retracts it: the card's id
|
|
61294
|
+
type: external_exports.enum(["read", "approval-decided", "feed-card-closed"]).optional(),
|
|
61295
|
+
/** An approval or feed card alert, and the push that retracts it: the card's id. */
|
|
61288
61296
|
cardId: external_exports.string().min(1).max(200).optional(),
|
|
61297
|
+
/** A `feed-card-closed` push: why the card's alert came off. */
|
|
61298
|
+
reason: feedCardClosedReasonSchema.optional(),
|
|
61289
61299
|
/** The conversation an alert tells of, or a read push covers. */
|
|
61290
61300
|
conversationId: external_exports.string().min(1).max(200).optional(),
|
|
61291
61301
|
/** The thread's root message, when the alert or the read is in a thread. */
|
|
@@ -61610,7 +61620,9 @@ var desktopPublicationSchemaDefinition = external_exports.object({
|
|
|
61610
61620
|
}).nullable(),
|
|
61611
61621
|
badge: external_exports.number().int().nonnegative(),
|
|
61612
61622
|
/** The tag of a notification to take back, such as one for a message since deleted. */
|
|
61613
|
-
withdrawn: external_exports.string().optional()
|
|
61623
|
+
withdrawn: external_exports.string().optional(),
|
|
61624
|
+
/** More tags to take back at once, such as the messages one read covered. */
|
|
61625
|
+
withdrawnTags: external_exports.array(external_exports.string()).max(500).optional()
|
|
61614
61626
|
});
|
|
61615
61627
|
var desktopPublicationSchema = desktopPublicationSchemaDefinition;
|
|
61616
61628
|
var quietReasonSchema = external_exports.enum(["paused", "hours"]);
|
|
@@ -61829,8 +61841,30 @@ var feedCardSettledPayloadSchemaDefinition = external_exports.object({
|
|
|
61829
61841
|
userId: external_exports.string().min(1),
|
|
61830
61842
|
itemId: external_exports.string().min(1),
|
|
61831
61843
|
changeId: external_exports.string().min(1),
|
|
61844
|
+
/** Why, as the push that retracts the card's alert names it; absent on older facts. */
|
|
61845
|
+
reason: feedCardClosedReasonSchema.optional(),
|
|
61846
|
+
at: external_exports.iso.datetime()
|
|
61847
|
+
});
|
|
61848
|
+
var feedPushSentPayloadSchemaDefinition = external_exports.object({
|
|
61849
|
+
workspaceId: external_exports.string().min(1),
|
|
61850
|
+
userId: external_exports.string().min(1),
|
|
61851
|
+
itemId: external_exports.string().min(1),
|
|
61852
|
+
/** The push's own key, so a retried push records once. */
|
|
61853
|
+
pushKey: external_exports.string().min(1).max(256),
|
|
61832
61854
|
at: external_exports.iso.datetime()
|
|
61833
61855
|
});
|
|
61856
|
+
var feedPushLedgerStateSchemaDefinition = external_exports.object({
|
|
61857
|
+
workspaceId: external_exports.string(),
|
|
61858
|
+
userId: external_exports.string(),
|
|
61859
|
+
pushed: external_exports.array(external_exports.object({ itemId: external_exports.string().min(1), at: external_exports.number() }))
|
|
61860
|
+
});
|
|
61861
|
+
var feedCardRetractionIntentSchemaDefinition = external_exports.object({
|
|
61862
|
+
workspaceId: external_exports.string().min(1),
|
|
61863
|
+
userId: external_exports.string().min(1),
|
|
61864
|
+
itemId: external_exports.string().min(1),
|
|
61865
|
+
changeId: external_exports.string().min(1),
|
|
61866
|
+
reason: feedCardClosedReasonSchema
|
|
61867
|
+
});
|
|
61834
61868
|
var feedDigestSetPayloadSchemaDefinition = external_exports.object({
|
|
61835
61869
|
workspaceId: external_exports.string().min(1),
|
|
61836
61870
|
userId: external_exports.string().min(1),
|
|
@@ -62158,6 +62192,13 @@ function withSlackMarkupAsText(text3) {
|
|
|
62158
62192
|
return withSlackPeopleAsNames(text3).replace(SLACK_DATE_TOKEN, "$1").replace(ANGLE_LINK, (_link, address, label3) => label3 ?? address);
|
|
62159
62193
|
}
|
|
62160
62194
|
|
|
62195
|
+
// ../../modules/chat/contract/src/chat.images.ts
|
|
62196
|
+
var externalImageParamsSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1).max(64) });
|
|
62197
|
+
var externalImageQuerySchemaDefinition = external_exports.object({
|
|
62198
|
+
u: external_exports.string().min(1).max(2e3),
|
|
62199
|
+
sig: external_exports.string().max(100).default("")
|
|
62200
|
+
});
|
|
62201
|
+
|
|
62161
62202
|
// ../../modules/vault/contract/src/resolution-note.ts
|
|
62162
62203
|
var RESOLUTION_NOTE_INPUT_MAX_CHARS = 4e3;
|
|
62163
62204
|
function cleanResolutionNote(text3) {
|
|
@@ -63351,6 +63392,8 @@ var vaultApprovalResolvedPayloadSchemaDefinition = external_exports.object({
|
|
|
63351
63392
|
endedWithTurn: external_exports.boolean().optional(),
|
|
63352
63393
|
/** A task card: its Allow covered the rest of the agent's turn. */
|
|
63353
63394
|
coversTask: external_exports.boolean().optional(),
|
|
63395
|
+
/** Settled by another card's Allow for this agent, whose lease now covers this ask too. */
|
|
63396
|
+
coveredByLease: external_exports.boolean().optional(),
|
|
63354
63397
|
/** Who decides the card, so their open approvals lists refresh. */
|
|
63355
63398
|
approverUserIds: external_exports.array(external_exports.string()).readonly().default([])
|
|
63356
63399
|
});
|
|
@@ -68095,7 +68138,7 @@ var lazeChangeSchemaDefinition = external_exports.object({
|
|
|
68095
68138
|
// ../../modules/agent/contract/src/agent.config.ts
|
|
68096
68139
|
var positiveInt3 = external_exports.coerce.number().int().positive();
|
|
68097
68140
|
var agentConfig = Config.define((c) => ({
|
|
68098
|
-
/** Agent
|
|
68141
|
+
/** Agent messages in a row, each within 10 minutes of the last, before agents stop waking. */
|
|
68099
68142
|
hopLimit: c.env("AGENT_HOP_LIMIT", positiveInt3.default(12)),
|
|
68100
68143
|
/** The gateway's Anthropic-compatible root Claude Code reaches for a Laze model. */
|
|
68101
68144
|
claudeGatewayUrl: c.env(
|
|
@@ -68119,6 +68162,8 @@ var agentConfig = Config.define((c) => ({
|
|
|
68119
68162
|
"AGENT_CLAUDE_GATEWAY_THINKING",
|
|
68120
68163
|
external_exports.enum(["on", "off"]).default("on")
|
|
68121
68164
|
),
|
|
68165
|
+
/** Where the inbox watchdog writes its progress board card; unset, it only logs. */
|
|
68166
|
+
opsAlertDir: c.env("AGENT_OPS_ALERT_DIR", external_exports.string().min(1).optional()),
|
|
68122
68167
|
/** A harness prompt or question no one answers is denied or dismissed after this long. */
|
|
68123
68168
|
attentionTimeoutMinutes: c.env("AGENT_ATTENTION_TIMEOUT_MINUTES", positiveInt3.default(30)),
|
|
68124
68169
|
/** Where a GitHub signature links back; the origin the connect command fetches the CLI from. */
|
|
@@ -74516,6 +74561,20 @@ are waiting, if you think one was missed.
|
|
|
74516
74561
|
with \`laze app pull --app <app>\` (its files: page, plan, code) and
|
|
74517
74562
|
\`laze app records list <collection> --app <app>\` (its data).
|
|
74518
74563
|
|
|
74564
|
+
## The feed
|
|
74565
|
+
|
|
74566
|
+
When something needs a person to decide or act, post a card in their feed:
|
|
74567
|
+
\`laze feed post "<title>" --summary "<why>" --action "<label>=<what to do>"\`. Run
|
|
74568
|
+
\`laze feed post\` with no title for every flag and how to write a card.
|
|
74569
|
+
|
|
74570
|
+
When you prepare a message for a person to send (email, Slack, LinkedIn), post a feed card with
|
|
74571
|
+
the full text in \`--draft\`, the recipients and subject in
|
|
74572
|
+
\`--draft-header "To: ...\\nCc: ...\\nSubject: ..."\`, an action to send it
|
|
74573
|
+
(\`--action "Send it=<what to do>"\`) and a \`--link\` to the exact draft
|
|
74574
|
+
(\`"Open draft in Gmail=https://mail.google.com/mail/u/0/#drafts?compose=<draft message id>"\`,
|
|
74575
|
+
not the drafts folder). Never leave it only in Gmail drafts. If they edit the text on the card,
|
|
74576
|
+
the press brings you the edited text: update the native draft with it first, then send.
|
|
74577
|
+
|
|
74519
74578
|
## Apps
|
|
74520
74579
|
|
|
74521
74580
|
Asked for an app (a tracker, a CRM, a dashboard, a page that explains something), read the full
|
|
@@ -88158,10 +88217,65 @@ async function external({ context, args }) {
|
|
|
88158
88217
|
await command({ context, args });
|
|
88159
88218
|
}
|
|
88160
88219
|
|
|
88220
|
+
// src/services/feed-access-commands.service.ts
|
|
88221
|
+
var USAGE9 = `Usage:
|
|
88222
|
+
laze agent feed-access the agents that manage your feed
|
|
88223
|
+
laze agent feed-access <agent> on|off let one of your personal agents sort your whole feed`;
|
|
88224
|
+
var SWITCH = { on: true, off: false };
|
|
88225
|
+
function linesOf2(delegates) {
|
|
88226
|
+
if (delegates.length === 0) return "No agent manages your feed.\n";
|
|
88227
|
+
const lines2 = delegates.map((one) => `${one.agentName} ${one.agentId} since ${one.grantedAt}`);
|
|
88228
|
+
return `${lines2.join("\n")}
|
|
88229
|
+
`;
|
|
88230
|
+
}
|
|
88231
|
+
async function agentFeedAccess({
|
|
88232
|
+
context,
|
|
88233
|
+
args
|
|
88234
|
+
}) {
|
|
88235
|
+
const [agent3, state] = [args.words[2], args.words[3]];
|
|
88236
|
+
if (agent3 && !(state === "on" || state === "off")) throw new CliUsageError(USAGE9);
|
|
88237
|
+
const { client } = await signedIn({ context, args });
|
|
88238
|
+
const delegates = agent3 && (state === "on" || state === "off") ? await client.post("/api/feed/delegates", { agent: agent3, on: SWITCH[state] }) : await client.get("/api/feed/delegates");
|
|
88239
|
+
if (args.flags.json) return context.out(`${JSON.stringify(delegates, null, 2)}
|
|
88240
|
+
`);
|
|
88241
|
+
const named = delegates.find((one) => one.agentId === agent3)?.agentName ?? agent3;
|
|
88242
|
+
if (agent3) context.out(`Manage my feed is ${state} for ${named}.
|
|
88243
|
+
`);
|
|
88244
|
+
context.out(linesOf2(delegates));
|
|
88245
|
+
}
|
|
88246
|
+
|
|
88161
88247
|
// src/services/feed-commands.service.ts
|
|
88162
88248
|
import { readFile as readFile32 } from "node:fs/promises";
|
|
88163
88249
|
import { resolve as resolve15 } from "node:path";
|
|
88164
88250
|
|
|
88251
|
+
// ../../modules/feed/contract/src/feed.delegate.ts
|
|
88252
|
+
var feedDelegateSchemaDefinition = external_exports.object({
|
|
88253
|
+
agentId: external_exports.string(),
|
|
88254
|
+
agentName: external_exports.string(),
|
|
88255
|
+
grantedAt: external_exports.iso.datetime()
|
|
88256
|
+
});
|
|
88257
|
+
var feedDelegateSchema = feedDelegateSchemaDefinition;
|
|
88258
|
+
var setFeedDelegateInputSchemaDefinition = external_exports.object({
|
|
88259
|
+
workspaceId: external_exports.string().min(1),
|
|
88260
|
+
agentId: external_exports.string().min(1),
|
|
88261
|
+
on: external_exports.boolean()
|
|
88262
|
+
});
|
|
88263
|
+
var setFeedDelegateInputSchema = setFeedDelegateInputSchemaDefinition;
|
|
88264
|
+
var feedDelegateByKeyInputSchemaDefinition = external_exports.object({
|
|
88265
|
+
agent: external_exports.string().trim().min(1),
|
|
88266
|
+
on: external_exports.boolean()
|
|
88267
|
+
});
|
|
88268
|
+
var pinFeedItemInputSchemaDefinition = external_exports.object({
|
|
88269
|
+
workspaceId: external_exports.string().min(1),
|
|
88270
|
+
itemId: external_exports.string().min(1),
|
|
88271
|
+
pinned: external_exports.boolean()
|
|
88272
|
+
});
|
|
88273
|
+
var pinFeedItemInputSchema = pinFeedItemInputSchemaDefinition;
|
|
88274
|
+
var feedPinByKeyInputSchemaDefinition = external_exports.object({
|
|
88275
|
+
itemId: external_exports.string().min(1),
|
|
88276
|
+
pinned: external_exports.boolean()
|
|
88277
|
+
});
|
|
88278
|
+
|
|
88165
88279
|
// ../../modules/feed/contract/src/feed.ts
|
|
88166
88280
|
var feedAuthorSchemaDefinition = external_exports.object({
|
|
88167
88281
|
kind: external_exports.enum(["agent", "person", "system"]),
|
|
@@ -88402,7 +88516,9 @@ var feedViewerStateSchemaDefinition = external_exports.object({
|
|
|
88402
88516
|
/** On a shared item: the reader's own item they shared, or someone's item shared with them. */
|
|
88403
88517
|
shared: external_exports.enum(["by_you", "with_you"]).optional(),
|
|
88404
88518
|
/** The reader owns the item and may add or remove people on it. */
|
|
88405
|
-
mayShare: external_exports.boolean().optional()
|
|
88519
|
+
mayShare: external_exports.boolean().optional(),
|
|
88520
|
+
/** Pinned first in the reader's open cards, by them or the agent managing their feed. */
|
|
88521
|
+
pinned: external_exports.boolean().optional()
|
|
88406
88522
|
});
|
|
88407
88523
|
var feedViewerStateSchema = feedViewerStateSchemaDefinition;
|
|
88408
88524
|
var feedAssigneeSchemaDefinition = external_exports.object({
|
|
@@ -88708,12 +88824,13 @@ var feedFileLinkInputSchemaDefinition = external_exports.object({
|
|
|
88708
88824
|
var feedFileLinkInputSchema = feedFileLinkInputSchemaDefinition;
|
|
88709
88825
|
var feedFileLinkSchemaDefinition = external_exports.object({ url: external_exports.string(), expiresAt: external_exports.iso.datetime() });
|
|
88710
88826
|
var feedFileLinkSchema = feedFileLinkSchemaDefinition;
|
|
88711
|
-
var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("share").withInput(shareFeedItemInputSchema).withOutput(feedShareAnswerSchema).mutation("unshare").withInput(unshareFeedItemInputSchema).withOutput(feedShareAnswerSchema).query("shareCandidates").withInput(itemRef).withOutput(external_exports.array(feedSharePersonSchema)).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).build();
|
|
88827
|
+
var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("share").withInput(shareFeedItemInputSchema).withOutput(feedShareAnswerSchema).mutation("unshare").withInput(unshareFeedItemInputSchema).withOutput(feedShareAnswerSchema).query("shareCandidates").withInput(itemRef).withOutput(external_exports.array(feedSharePersonSchema)).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("pin").withInput(pinFeedItemInputSchema).withOutput(feedItemSchema).query("delegates").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.array(feedDelegateSchema)).mutation("setDelegate").withInput(setFeedDelegateInputSchema).withOutput(external_exports.array(feedDelegateSchema)).build();
|
|
88712
88828
|
var feedUi = uiTokens("feed");
|
|
88713
88829
|
var FeedNavSlot = feedUi.component("nav");
|
|
88714
88830
|
var FeedDecisionsSlot = feedUi.component("decisions");
|
|
88715
88831
|
var FeedCountHooksToken = feedUi.hooks("count");
|
|
88716
88832
|
var FeedChannelCardSlot = feedUi.component("channel-card");
|
|
88833
|
+
var FeedDelegateSlot = feedUi.component("delegate");
|
|
88717
88834
|
var FeedSearchSlot = feedUi.component("search");
|
|
88718
88835
|
|
|
88719
88836
|
// ../../modules/feed/contract/src/feed.events.ts
|
|
@@ -88863,10 +88980,20 @@ var FEED_WRITING = `Write for a person deciding on a phone in a few seconds:
|
|
|
88863
88980
|
no "Day 9." counters. Numbers only when they change the decision.
|
|
88864
88981
|
- Not too terse either: whole sentences a person understands without context.
|
|
88865
88982
|
- Replies and comments: same rules, short when you can.
|
|
88983
|
+
- When you prepare a message for a person to send (email, Slack, LinkedIn), post a card
|
|
88984
|
+
with the full text in --draft, the recipients and subject in
|
|
88985
|
+
--draft-header "To: ...
|
|
88986
|
+
Cc: ...
|
|
88987
|
+
Subject: ...", an action to send it
|
|
88988
|
+
(--action "Send it=<what to do>") and a --link to the exact draft
|
|
88989
|
+
("Open draft in Gmail=https://mail.google.com/mail/u/0/#drafts?compose=<draft message id>",
|
|
88990
|
+
not the drafts folder). Never leave it only in Gmail drafts. If they edit the text on the
|
|
88991
|
+
card, the press brings you the edited text: update the native draft with it, then send.
|
|
88866
88992
|
- A draft that sends a file carries the file: pass it with --file. Never name a file you
|
|
88867
88993
|
did not attach; "Attach: deck.pdf" without a file is stopped unless you pass --force.
|
|
88868
|
-
The server pushes back with feed_hard_to_read when the text reads like a log
|
|
88869
|
-
|
|
88994
|
+
The server pushes back with feed_hard_to_read when the text reads like a log, and with
|
|
88995
|
+
feed_draft_missing when a card points at a draft without its text; fix it, or pass --force
|
|
88996
|
+
to post it as written.`;
|
|
88870
88997
|
var FEED_NO_BODY = "feed cards have no body: put the point in the title and one --summary line, text to send in --draft, sources in --link";
|
|
88871
88998
|
function pairOf({ value, flag: flag2 }) {
|
|
88872
88999
|
const at = value.indexOf("=");
|
|
@@ -88980,7 +89107,7 @@ async function feedAttachmentIdsOf({
|
|
|
88980
89107
|
}
|
|
88981
89108
|
|
|
88982
89109
|
// src/services/feed-commands.service.ts
|
|
88983
|
-
var
|
|
89110
|
+
var USAGE10 = `Usage:
|
|
88984
89111
|
laze feed post <title> [--channel <channel>] [--tag <tag>] [--summary <line>]
|
|
88985
89112
|
[--draft <text|@file>] [--draft-header "To: ...\\nRe: ..."]
|
|
88986
89113
|
[--metric <json|@file.json> | --table <csv|@file.csv>]
|
|
@@ -89008,10 +89135,16 @@ var USAGE9 = `Usage:
|
|
|
89008
89135
|
laze feed decisions [--json]
|
|
89009
89136
|
laze feed act <id> <actionId> [--draft <text|@file>]
|
|
89010
89137
|
laze feed comment <id> <text> [--draft <text|@file>] [--force]
|
|
89011
|
-
laze feed done|put-back|unsnooze <id>
|
|
89138
|
+
laze feed done|put-back|unsnooze|pin|unpin <id>
|
|
89012
89139
|
laze feed snooze <id> --until <ISO time>
|
|
89013
89140
|
laze feed channel <channelId>
|
|
89014
89141
|
|
|
89142
|
+
Managing your owner's feed: when your owner turned on Manage my feed for you (in your settings,
|
|
89143
|
+
or laze agent feed-access <you> on), laze feed list, count, decisions, done, put-back, snooze,
|
|
89144
|
+
unsnooze, pin and unpin work on their whole feed, cards from every agent included. Close what
|
|
89145
|
+
is stale, snooze what can wait, pin what matters. You never press actions, comment or answer
|
|
89146
|
+
approvals there: those stay your owner's. Each change shows on the card as yours.
|
|
89147
|
+
|
|
89015
89148
|
${FEED_WRITING}`;
|
|
89016
89149
|
function flagsOf(args) {
|
|
89017
89150
|
try {
|
|
@@ -89076,7 +89209,7 @@ function printItem({
|
|
|
89076
89209
|
}
|
|
89077
89210
|
async function feedPost({ context, args }) {
|
|
89078
89211
|
const title = args.words.slice(2).join(" ").trim();
|
|
89079
|
-
if (!title) throw new CliUsageError(
|
|
89212
|
+
if (!title) throw new CliUsageError(USAGE10);
|
|
89080
89213
|
const flags2 = flagsOf(args);
|
|
89081
89214
|
const { client } = await signedIn({ context, args });
|
|
89082
89215
|
const channel = flagText({ args, name: "channel" });
|
|
@@ -89099,7 +89232,7 @@ async function feedPost({ context, args }) {
|
|
|
89099
89232
|
}
|
|
89100
89233
|
async function feedUpdate({ context, args }) {
|
|
89101
89234
|
const itemId = args.words[2];
|
|
89102
|
-
if (!itemId) throw new CliUsageError(
|
|
89235
|
+
if (!itemId) throw new CliUsageError(USAGE10);
|
|
89103
89236
|
const flags2 = flagsOf(args);
|
|
89104
89237
|
const { client } = await signedIn({ context, args });
|
|
89105
89238
|
const body = await bodyOf2({ context, flags: flags2 });
|
|
@@ -89138,7 +89271,7 @@ async function feedUpdate({ context, args }) {
|
|
|
89138
89271
|
async function feedReply({ context, args }) {
|
|
89139
89272
|
const itemId = args.words[2];
|
|
89140
89273
|
const text3 = args.words.slice(3).join(" ").trim();
|
|
89141
|
-
if (!itemId || !text3) throw new CliUsageError(
|
|
89274
|
+
if (!itemId || !text3) throw new CliUsageError(USAGE10);
|
|
89142
89275
|
const { client } = await signedIn({ context, args });
|
|
89143
89276
|
const replied = await client.post("/api/feed/items/reply", {
|
|
89144
89277
|
itemId,
|
|
@@ -89151,7 +89284,7 @@ async function feedReply({ context, args }) {
|
|
|
89151
89284
|
}
|
|
89152
89285
|
async function feedRead({ context, args }) {
|
|
89153
89286
|
const itemId = args.words[2];
|
|
89154
|
-
if (!itemId) throw new CliUsageError(
|
|
89287
|
+
if (!itemId) throw new CliUsageError(USAGE10);
|
|
89155
89288
|
const { client } = await signedIn({ context, args });
|
|
89156
89289
|
const read4 = await client.post("/api/feed/items/read", { itemId });
|
|
89157
89290
|
printItem({ context, args, item: read4 });
|
|
@@ -89170,7 +89303,7 @@ async function feedClose({ context, args }) {
|
|
|
89170
89303
|
const itemId = args.words[2];
|
|
89171
89304
|
const loop = flagText({ args, name: "loop" });
|
|
89172
89305
|
const note = flagText({ args, name: "note" });
|
|
89173
|
-
if (!note || Boolean(itemId) === Boolean(loop)) throw new CliUsageError(
|
|
89306
|
+
if (!note || Boolean(itemId) === Boolean(loop)) throw new CliUsageError(USAGE10);
|
|
89174
89307
|
const { client } = await signedIn({ context, args });
|
|
89175
89308
|
const closed = await client.post("/api/feed/items/close", {
|
|
89176
89309
|
...itemId ? { itemId } : { loop },
|
|
@@ -89185,7 +89318,7 @@ function shareCommand({ move: move3 }) {
|
|
|
89185
89318
|
const itemId = args.words[2];
|
|
89186
89319
|
const all = args.flags.all === true;
|
|
89187
89320
|
const people2 = args.lists.with ?? [];
|
|
89188
|
-
if (people2.length === 0 || Boolean(itemId) === all) throw new CliUsageError(
|
|
89321
|
+
if (people2.length === 0 || Boolean(itemId) === all) throw new CliUsageError(USAGE10);
|
|
89189
89322
|
const label3 = flagText({ args, name: "label" });
|
|
89190
89323
|
const group = flagText({ args, name: "group" });
|
|
89191
89324
|
const { client } = await signedIn({ context, args });
|
|
@@ -89228,7 +89361,7 @@ async function feedLoops({ context, args }) {
|
|
|
89228
89361
|
}
|
|
89229
89362
|
async function feedGroupSummary({ context, args }) {
|
|
89230
89363
|
const group = args.words.slice(2).join(" ").trim();
|
|
89231
|
-
if (!group) throw new CliUsageError(
|
|
89364
|
+
if (!group) throw new CliUsageError(USAGE10);
|
|
89232
89365
|
const { client } = await signedIn({ context, args });
|
|
89233
89366
|
const pointer = await client.post("/api/feed/group-summary", { group });
|
|
89234
89367
|
if (args.flags.json) return context.out(`${JSON.stringify(pointer, null, 2)}
|
|
@@ -89242,7 +89375,9 @@ var PLACES = { open: "open", coming_up: "coming up", handled: "handled" };
|
|
|
89242
89375
|
function printCard2({ context, item }) {
|
|
89243
89376
|
const when = item.me.place === "coming_up" ? ` (back ${item.me.snoozedUntil ?? item.showAt ?? ""})` : "";
|
|
89244
89377
|
const handled = item.me.place === "handled" && item.me.handledLabel;
|
|
89245
|
-
|
|
89378
|
+
const pinned = item.me.pinned ? " (pinned)" : "";
|
|
89379
|
+
const shown2 = `${item.title}${pinned}${when}${handled ? ` ${handled}` : ""}`;
|
|
89380
|
+
context.out(`${item.id} ${item.tag} ${shown2}
|
|
89246
89381
|
`);
|
|
89247
89382
|
if (item.me.place === "handled") return;
|
|
89248
89383
|
if (item.approval) context.out(" an approval: answer it in Laze\n");
|
|
@@ -89308,7 +89443,7 @@ async function feedDecisions({ context, args }) {
|
|
|
89308
89443
|
}
|
|
89309
89444
|
async function feedAct({ context, args }) {
|
|
89310
89445
|
const [itemId, actionId] = [args.words[2], args.words[3]];
|
|
89311
|
-
if (!itemId || !actionId) throw new CliUsageError(
|
|
89446
|
+
if (!itemId || !actionId) throw new CliUsageError(USAGE10);
|
|
89312
89447
|
const draft = await textFlag({ context, args, name: "draft" });
|
|
89313
89448
|
const { client } = await signedIn({ context, args });
|
|
89314
89449
|
const item = await client.post("/api/feed/mine/act", {
|
|
@@ -89321,7 +89456,7 @@ async function feedAct({ context, args }) {
|
|
|
89321
89456
|
async function feedComment({ context, args }) {
|
|
89322
89457
|
const itemId = args.words[2];
|
|
89323
89458
|
const text3 = args.words.slice(3).join(" ").trim();
|
|
89324
|
-
if (!itemId || !text3) throw new CliUsageError(
|
|
89459
|
+
if (!itemId || !text3) throw new CliUsageError(USAGE10);
|
|
89325
89460
|
const draft = await textFlag({ context, args, name: "draft" });
|
|
89326
89461
|
const { client } = await signedIn({ context, args });
|
|
89327
89462
|
const item = await client.post("/api/feed/mine/comment", {
|
|
@@ -89332,10 +89467,19 @@ async function feedComment({ context, args }) {
|
|
|
89332
89467
|
});
|
|
89333
89468
|
printMoved({ context, args, item });
|
|
89334
89469
|
}
|
|
89470
|
+
function pinItem(pinned) {
|
|
89471
|
+
return async ({ context, args }) => {
|
|
89472
|
+
const itemId = args.words[2];
|
|
89473
|
+
if (!itemId) throw new CliUsageError(USAGE10);
|
|
89474
|
+
const { client } = await signedIn({ context, args });
|
|
89475
|
+
const item = await client.post("/api/feed/mine/pin", { itemId, pinned });
|
|
89476
|
+
printMoved({ context, args, item });
|
|
89477
|
+
};
|
|
89478
|
+
}
|
|
89335
89479
|
function moveItem(path) {
|
|
89336
89480
|
return async ({ context, args }) => {
|
|
89337
89481
|
const itemId = args.words[2];
|
|
89338
|
-
if (!itemId) throw new CliUsageError(
|
|
89482
|
+
if (!itemId) throw new CliUsageError(USAGE10);
|
|
89339
89483
|
const { client } = await signedIn({ context, args });
|
|
89340
89484
|
const item = await client.post(`/api/feed/mine/${path}`, { itemId });
|
|
89341
89485
|
printMoved({ context, args, item });
|
|
@@ -89344,14 +89488,14 @@ function moveItem(path) {
|
|
|
89344
89488
|
async function feedSnooze({ context, args }) {
|
|
89345
89489
|
const itemId = args.words[2];
|
|
89346
89490
|
const until = flagText({ args, name: "until" });
|
|
89347
|
-
if (!itemId || !until) throw new CliUsageError(
|
|
89491
|
+
if (!itemId || !until) throw new CliUsageError(USAGE10);
|
|
89348
89492
|
const { client } = await signedIn({ context, args });
|
|
89349
89493
|
const item = await client.post("/api/feed/mine/snooze", { itemId, until });
|
|
89350
89494
|
printMoved({ context, args, item });
|
|
89351
89495
|
}
|
|
89352
89496
|
async function feedChannel({ context, args }) {
|
|
89353
89497
|
const channelId = args.words[2];
|
|
89354
|
-
if (!channelId) throw new CliUsageError(
|
|
89498
|
+
if (!channelId) throw new CliUsageError(USAGE10);
|
|
89355
89499
|
const { client } = await signedIn({ context, args });
|
|
89356
89500
|
const items = await client.post("/api/feed/channel", { channelId });
|
|
89357
89501
|
if (args.flags.json) return context.out(`${JSON.stringify(items, null, 2)}
|
|
@@ -89378,13 +89522,15 @@ var FEED_COMMANDS = {
|
|
|
89378
89522
|
done: moveItem("done"),
|
|
89379
89523
|
"put-back": moveItem("put-back"),
|
|
89380
89524
|
unsnooze: moveItem("unsnooze"),
|
|
89525
|
+
pin: pinItem(true),
|
|
89526
|
+
unpin: pinItem(false),
|
|
89381
89527
|
snooze: feedSnooze,
|
|
89382
89528
|
channel: feedChannel
|
|
89383
89529
|
};
|
|
89384
89530
|
async function feed({ context, args }) {
|
|
89385
89531
|
const name3 = args.words[1] ?? "";
|
|
89386
89532
|
const command = Object.hasOwn(FEED_COMMANDS, name3) ? FEED_COMMANDS[name3] : void 0;
|
|
89387
|
-
if (!command) throw new CliUsageError(
|
|
89533
|
+
if (!command) throw new CliUsageError(USAGE10);
|
|
89388
89534
|
await command({ context, args });
|
|
89389
89535
|
}
|
|
89390
89536
|
|
|
@@ -89627,7 +89773,7 @@ import { readFile as readFile34 } from "node:fs/promises";
|
|
|
89627
89773
|
function timeOf2(iso3) {
|
|
89628
89774
|
return `${iso3.slice(0, 10)} ${iso3.slice(11, 16)} UTC`;
|
|
89629
89775
|
}
|
|
89630
|
-
function
|
|
89776
|
+
function linesOf3(output2) {
|
|
89631
89777
|
const live = (output2.live?.messages ?? []).map((message2) => ({
|
|
89632
89778
|
at: message2.createdAt,
|
|
89633
89779
|
author: message2.authorName,
|
|
@@ -89657,7 +89803,7 @@ function blockOf2(line) {
|
|
|
89657
89803
|
return [head, ...body, ...replies].join("\n");
|
|
89658
89804
|
}
|
|
89659
89805
|
function olderCursorOf(output2) {
|
|
89660
|
-
const oldest =
|
|
89806
|
+
const oldest = linesOf3(output2)[0];
|
|
89661
89807
|
if (!oldest) return null;
|
|
89662
89808
|
const more = output2.live ? output2.live.hasOlder : output2.laze.hasOlder || output2.laze.liveBefore !== null;
|
|
89663
89809
|
return more ? oldest.cursor : null;
|
|
@@ -89666,7 +89812,7 @@ function formatHistory(output2) {
|
|
|
89666
89812
|
const { laze } = output2;
|
|
89667
89813
|
const where = laze.channelName ? `#${laze.channelName}` : laze.channelId;
|
|
89668
89814
|
const from = laze.mirror ? ` (mirrors ${laze.mirror.label})` : "";
|
|
89669
|
-
const lines2 =
|
|
89815
|
+
const lines2 = linesOf3(output2);
|
|
89670
89816
|
if (lines2.length === 0) return `${where}${from}: no messages.
|
|
89671
89817
|
`;
|
|
89672
89818
|
const count5 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
|
|
@@ -90651,7 +90797,7 @@ function machineAccessCommand(name3) {
|
|
|
90651
90797
|
}
|
|
90652
90798
|
|
|
90653
90799
|
// src/services/machine-commands.service.ts
|
|
90654
|
-
var
|
|
90800
|
+
var USAGE11 = [
|
|
90655
90801
|
"Usage: laze machine connect <name> the command to run on your own machine (people)",
|
|
90656
90802
|
" laze machine connect <name> --again a new command for a machine you connected; the old code stops working",
|
|
90657
90803
|
" laze machine connect <name> --ssh <user>@<host>[:port] a machine that cannot run the connector, over SSH (people)",
|
|
@@ -90697,7 +90843,7 @@ function listLine(machine2) {
|
|
|
90697
90843
|
var EXEC_ENV_MAX = 32;
|
|
90698
90844
|
function machineArg2({ args }) {
|
|
90699
90845
|
const machine2 = args.words[2];
|
|
90700
|
-
if (!machine2) throw new CliUsageError(
|
|
90846
|
+
if (!machine2) throw new CliUsageError(USAGE11);
|
|
90701
90847
|
return machine2;
|
|
90702
90848
|
}
|
|
90703
90849
|
async function connect4({ context, args }) {
|
|
@@ -90723,7 +90869,7 @@ async function connectSsh({
|
|
|
90723
90869
|
}) {
|
|
90724
90870
|
const ssh = flagText({ args, name: "ssh" });
|
|
90725
90871
|
if (!ssh) throw new CliUsageError(`--ssh takes <user>@<host>[:port]
|
|
90726
|
-
${
|
|
90872
|
+
${USAGE11}`);
|
|
90727
90873
|
const client = await computeClient({ context, args });
|
|
90728
90874
|
const made = await client.post(COMPUTE_REST_PATHS.connectSsh, {
|
|
90729
90875
|
name: name3,
|
|
@@ -90799,11 +90945,11 @@ async function exec({
|
|
|
90799
90945
|
}) {
|
|
90800
90946
|
const machine2 = machineArg2({ args });
|
|
90801
90947
|
const command = commandText({ rest: args.rest });
|
|
90802
|
-
if (!command.trim()) throw new CliUsageError(
|
|
90948
|
+
if (!command.trim()) throw new CliUsageError(USAGE11);
|
|
90803
90949
|
const timeout = flagText({ args, name: "timeout" });
|
|
90804
90950
|
if (timeout && !(Number(timeout) >= 1))
|
|
90805
90951
|
throw new CliUsageError(`--timeout takes a number of seconds
|
|
90806
|
-
${
|
|
90952
|
+
${USAGE11}`);
|
|
90807
90953
|
const released = await vaultEnv({ context, args });
|
|
90808
90954
|
if ("exitCode" in released) return released.exitCode;
|
|
90809
90955
|
const client = await computeClient({ context, args });
|
|
@@ -90831,11 +90977,11 @@ async function vaultEnv({
|
|
|
90831
90977
|
const connections = args.lists.vault ?? [];
|
|
90832
90978
|
if (args.flags.vault === true)
|
|
90833
90979
|
throw new CliUsageError(`--vault takes a connection name
|
|
90834
|
-
${
|
|
90980
|
+
${USAGE11}`);
|
|
90835
90981
|
if (connections.length === 0) return {};
|
|
90836
90982
|
const reason = flagText({ args, name: "reason" });
|
|
90837
90983
|
if (!reason) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
90838
|
-
${
|
|
90984
|
+
${USAGE11}`);
|
|
90839
90985
|
const env = {};
|
|
90840
90986
|
for (const connection of new Set(connections)) {
|
|
90841
90987
|
const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
|
|
@@ -90855,11 +91001,11 @@ ${USAGE10}`);
|
|
|
90855
91001
|
async function host({ context, args }) {
|
|
90856
91002
|
const machineName = args.words[2];
|
|
90857
91003
|
const agent3 = args.words[3];
|
|
90858
|
-
if (!machineName || !agent3) throw new CliUsageError(
|
|
91004
|
+
if (!machineName || !agent3) throw new CliUsageError(USAGE11);
|
|
90859
91005
|
const whenOffline = flagText({ args, name: "when-offline", fallback: "wait" });
|
|
90860
91006
|
if (whenOffline !== "wait" && whenOffline !== "computer" && whenOffline !== "sandbox")
|
|
90861
91007
|
throw new CliUsageError(`--when-offline takes wait or computer
|
|
90862
|
-
${
|
|
91008
|
+
${USAGE11}`);
|
|
90863
91009
|
const client = await computeClient({ context, args });
|
|
90864
91010
|
const machine2 = await client.post(COMPUTE_REST_PATHS.host, {
|
|
90865
91011
|
machine: machineName,
|
|
@@ -90876,7 +91022,7 @@ ${USAGE10}`);
|
|
|
90876
91022
|
}
|
|
90877
91023
|
async function unhost({ context, args }) {
|
|
90878
91024
|
const agent3 = args.words[2];
|
|
90879
|
-
if (!agent3) throw new CliUsageError(
|
|
91025
|
+
if (!agent3) throw new CliUsageError(USAGE11);
|
|
90880
91026
|
const client = await computeClient({ context, args });
|
|
90881
91027
|
const done = await client.post(COMPUTE_REST_PATHS.unhost, { agent: agent3 });
|
|
90882
91028
|
if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
|
|
@@ -90913,7 +91059,7 @@ async function machine({ context, args }) {
|
|
|
90913
91059
|
if (command === "unhost") return unhost({ context, args });
|
|
90914
91060
|
const access = machineAccessCommand(command);
|
|
90915
91061
|
if (access) return access({ context, args });
|
|
90916
|
-
throw new CliUsageError(
|
|
91062
|
+
throw new CliUsageError(USAGE11);
|
|
90917
91063
|
}
|
|
90918
91064
|
|
|
90919
91065
|
// src/services/mcp-server.service.ts
|
|
@@ -91203,7 +91349,7 @@ async function writeMount({
|
|
|
91203
91349
|
}
|
|
91204
91350
|
|
|
91205
91351
|
// src/services/memory-commands.service.ts
|
|
91206
|
-
var
|
|
91352
|
+
var USAGE12 = `Usage:
|
|
91207
91353
|
laze memory get SOUL.md|AGENTS.md|MEMORY.md [--channel <channel>]
|
|
91208
91354
|
laze memory set <file> <text|@file|-> [--channel <channel>] [--base <version>]
|
|
91209
91355
|
laze memory append MEMORY.md <text|@file|-> [--channel <channel>]
|
|
@@ -91229,7 +91375,7 @@ var PROVENANCES = ["said", "decided", "verified", "inferred", "observed"];
|
|
|
91229
91375
|
var FILES = /* @__PURE__ */ new Set(["SOUL.md", "AGENTS.md", "MEMORY.md"]);
|
|
91230
91376
|
function fileRef({ context, args }) {
|
|
91231
91377
|
const file3 = args.words[2] ?? "";
|
|
91232
|
-
if (!FILES.has(file3)) throw new CliUsageError(
|
|
91378
|
+
if (!FILES.has(file3)) throw new CliUsageError(USAGE12);
|
|
91233
91379
|
const channel = turnChannel({ context, args });
|
|
91234
91380
|
return { file: file3, ...channel ? { channel } : {} };
|
|
91235
91381
|
}
|
|
@@ -91268,7 +91414,7 @@ async function memoryHistory({ context, args }) {
|
|
|
91268
91414
|
async function memorySet({ context, args }) {
|
|
91269
91415
|
const ref = fileRef({ context, args });
|
|
91270
91416
|
const value = args.words.slice(3).join(" ");
|
|
91271
|
-
if (!value) throw new CliUsageError(
|
|
91417
|
+
if (!value) throw new CliUsageError(USAGE12);
|
|
91272
91418
|
const content = await textArgument({ context, value });
|
|
91273
91419
|
const base = args.flags.base;
|
|
91274
91420
|
const { client } = await signedIn({ context, args });
|
|
@@ -91284,7 +91430,7 @@ async function memorySet({ context, args }) {
|
|
|
91284
91430
|
async function memoryAppend({ context, args }) {
|
|
91285
91431
|
const ref = fileRef({ context, args });
|
|
91286
91432
|
const value = args.words.slice(3).join(" ");
|
|
91287
|
-
if (!value) throw new CliUsageError(
|
|
91433
|
+
if (!value) throw new CliUsageError(USAGE12);
|
|
91288
91434
|
const text3 = await textArgument({ context, value });
|
|
91289
91435
|
const { client } = await signedIn({ context, args });
|
|
91290
91436
|
const saved3 = await client.post("/api/memory/append", { ...ref, text: text3 });
|
|
@@ -91294,7 +91440,7 @@ async function memoryAppend({ context, args }) {
|
|
|
91294
91440
|
}
|
|
91295
91441
|
async function memorySearch({ context, args }) {
|
|
91296
91442
|
const query = args.words.slice(2).join(" ").trim();
|
|
91297
|
-
if (!query) throw new CliUsageError(
|
|
91443
|
+
if (!query) throw new CliUsageError(USAGE12);
|
|
91298
91444
|
const { client } = await signedIn({ context, args });
|
|
91299
91445
|
const hits = await client.post("/api/memory/search", { query });
|
|
91300
91446
|
if (args.flags.json) return context.out(`${JSON.stringify(hits, null, 2)}
|
|
@@ -91319,7 +91465,7 @@ async function memoryPull({ context, args }) {
|
|
|
91319
91465
|
}
|
|
91320
91466
|
function logTarget({ context, args }) {
|
|
91321
91467
|
const layer = flagText({ args, name: "layer", fallback: "person" });
|
|
91322
|
-
if (layer !== "person" && layer !== "agent") throw new CliUsageError(
|
|
91468
|
+
if (layer !== "person" && layer !== "agent") throw new CliUsageError(USAGE12);
|
|
91323
91469
|
const channel = turnChannel({ context, args });
|
|
91324
91470
|
const turn = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((id2) => id2.trim()).filter(Boolean);
|
|
91325
91471
|
const message2 = flagText({ args, name: "message" }) || turn.at(-1) || "";
|
|
@@ -91345,7 +91491,7 @@ async function taggedLine({
|
|
|
91345
91491
|
const [tag] = given;
|
|
91346
91492
|
const value = args.flags[tag];
|
|
91347
91493
|
const raw = typeof value === "string" ? value : args.words.slice(from).join(" ");
|
|
91348
|
-
if (!raw.trim()) throw new CliUsageError(
|
|
91494
|
+
if (!raw.trim()) throw new CliUsageError(USAGE12);
|
|
91349
91495
|
const text3 = await textArgument({ context, value: raw });
|
|
91350
91496
|
return { tag, text: text3, pins: [...args.lists.pin ?? []] };
|
|
91351
91497
|
}
|
|
@@ -91378,12 +91524,12 @@ async function logCall({
|
|
|
91378
91524
|
}
|
|
91379
91525
|
function entryId(args) {
|
|
91380
91526
|
const id2 = Number((args.words[2] ?? "").replace(/^#/, ""));
|
|
91381
|
-
if (!Number.isInteger(id2) || id2 < 0) throw new CliUsageError(
|
|
91527
|
+
if (!Number.isInteger(id2) || id2 < 0) throw new CliUsageError(USAGE12);
|
|
91382
91528
|
return id2;
|
|
91383
91529
|
}
|
|
91384
91530
|
function blockArg(args) {
|
|
91385
91531
|
const block2 = (args.words[2] ?? "").replace(/^#/, "");
|
|
91386
|
-
if (!block2) throw new CliUsageError(
|
|
91532
|
+
if (!block2) throw new CliUsageError(USAGE12);
|
|
91387
91533
|
return block2;
|
|
91388
91534
|
}
|
|
91389
91535
|
async function memoryNote({ context, args }) {
|
|
@@ -91401,7 +91547,7 @@ async function memoryRemove({ context, args }) {
|
|
|
91401
91547
|
async function memoryNap({ context, args }) {
|
|
91402
91548
|
const block2 = (args.words[2] ?? "").replace(/^#/, "");
|
|
91403
91549
|
const text3 = args.words.slice(3).join(" ");
|
|
91404
|
-
if (block2 && !text3) throw new CliUsageError(
|
|
91550
|
+
if (block2 && !text3) throw new CliUsageError(USAGE12);
|
|
91405
91551
|
const line = text3 ? await textArgument({ context, value: text3 }) : "";
|
|
91406
91552
|
await logCall({ context, args, path: "nap", body: block2 ? { block: block2, text: line } : {} });
|
|
91407
91553
|
}
|
|
@@ -91413,7 +91559,7 @@ async function memoryForget({ context, args }) {
|
|
|
91413
91559
|
}
|
|
91414
91560
|
async function memoryRecall({ context, args }) {
|
|
91415
91561
|
const query = args.words.slice(2).join(" ").trim();
|
|
91416
|
-
if (!query) throw new CliUsageError(
|
|
91562
|
+
if (!query) throw new CliUsageError(USAGE12);
|
|
91417
91563
|
await logCall({ context, args, path: "recall", body: { query } });
|
|
91418
91564
|
}
|
|
91419
91565
|
async function memoryWake({ context, args }) {
|
|
@@ -91459,7 +91605,7 @@ async function memoryImport({ context, args }) {
|
|
|
91459
91605
|
const siesta = flagText({ args, name: "siesta" });
|
|
91460
91606
|
if (siesta) return siestaImport({ context, args, dir: siesta });
|
|
91461
91607
|
const dir = flagText({ args, name: "optmem" });
|
|
91462
|
-
if (!dir) throw new CliUsageError(
|
|
91608
|
+
if (!dir) throw new CliUsageError(USAGE12);
|
|
91463
91609
|
const root = resolve17(context.cwd, dir);
|
|
91464
91610
|
const log = await readFile37(join26(root, "LOG.txt"));
|
|
91465
91611
|
const sizes2 = (await readdir7(join26(root, "TREE")).catch(() => [])).filter(
|
|
@@ -91501,13 +91647,13 @@ var MEMORY_COMMANDS = {
|
|
|
91501
91647
|
async function memory({ context, args }) {
|
|
91502
91648
|
const name3 = args.words[1] ?? "";
|
|
91503
91649
|
const command = Object.hasOwn(MEMORY_COMMANDS, name3) ? MEMORY_COMMANDS[name3] : void 0;
|
|
91504
|
-
if (!command) throw new CliUsageError(
|
|
91650
|
+
if (!command) throw new CliUsageError(USAGE12);
|
|
91505
91651
|
await command({ context, args });
|
|
91506
91652
|
}
|
|
91507
91653
|
|
|
91508
91654
|
// src/services/models-commands.service.ts
|
|
91509
91655
|
var WINDOWS = ["day", "week", "month"];
|
|
91510
|
-
var
|
|
91656
|
+
var USAGE13 = `Usage:
|
|
91511
91657
|
laze models policy whether Laze models are on, the default budget and the cap
|
|
91512
91658
|
laze models set-policy [on|off] [--default-day <usd|none>] [--cap-day <usd|none>] ... (admins)
|
|
91513
91659
|
--default-week, --default-month, --cap-week and --cap-month set the other windows
|
|
@@ -91532,7 +91678,7 @@ function limitsFrom({
|
|
|
91532
91678
|
const value = text3 === "none" ? null : Number(text3);
|
|
91533
91679
|
if (value !== null && (!Number.isFinite(value) || value < 0))
|
|
91534
91680
|
throw new CliUsageError(`--${prefix}${window2} takes an amount in USD or none.
|
|
91535
|
-
${
|
|
91681
|
+
${USAGE13}`);
|
|
91536
91682
|
next[window2] = value;
|
|
91537
91683
|
changed = true;
|
|
91538
91684
|
}
|
|
@@ -91557,12 +91703,12 @@ async function showPolicy({ context, args }) {
|
|
|
91557
91703
|
}
|
|
91558
91704
|
async function setPolicy({ context, args }) {
|
|
91559
91705
|
const state = args.words[2];
|
|
91560
|
-
if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(
|
|
91706
|
+
if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(USAGE13);
|
|
91561
91707
|
const { client } = await signedIn({ context, args });
|
|
91562
91708
|
const current3 = await client.get("/api/models/policy");
|
|
91563
91709
|
const defaultBudget = limitsFrom({ args, prefix: "default-", current: current3.defaultBudget });
|
|
91564
91710
|
const cap = limitsFrom({ args, prefix: "cap-", current: current3.cap });
|
|
91565
|
-
if (!state && !defaultBudget && !cap) throw new CliUsageError(
|
|
91711
|
+
if (!state && !defaultBudget && !cap) throw new CliUsageError(USAGE13);
|
|
91566
91712
|
const updated = await client.post("/api/models/policy", {
|
|
91567
91713
|
...state ? { lazeModels: state === "on" } : {},
|
|
91568
91714
|
...defaultBudget ? { defaultBudget } : {},
|
|
@@ -91603,11 +91749,11 @@ async function agentNamed({ client, name: name3 }) {
|
|
|
91603
91749
|
}
|
|
91604
91750
|
async function setBudget({ context, args }) {
|
|
91605
91751
|
const name3 = args.words[2];
|
|
91606
|
-
if (!name3) throw new CliUsageError(
|
|
91752
|
+
if (!name3) throw new CliUsageError(USAGE13);
|
|
91607
91753
|
const { client } = await signedIn({ context, args });
|
|
91608
91754
|
const agent3 = await agentNamed({ client, name: name3 });
|
|
91609
91755
|
const next = limitsFrom({ args, prefix: "", current: agent3.budget });
|
|
91610
|
-
if (!next) throw new CliUsageError(
|
|
91756
|
+
if (!next) throw new CliUsageError(USAGE13);
|
|
91611
91757
|
const updated = await client.post("/api/models/agents/budget", {
|
|
91612
91758
|
agentId: agent3.agentId,
|
|
91613
91759
|
budget: next
|
|
@@ -91640,7 +91786,7 @@ var MODEL_COMMANDS = {
|
|
|
91640
91786
|
async function models({ context, args }) {
|
|
91641
91787
|
const name3 = args.words[1] ?? "policy";
|
|
91642
91788
|
const command = Object.hasOwn(MODEL_COMMANDS, name3) ? MODEL_COMMANDS[name3] : void 0;
|
|
91643
|
-
if (!command) throw new CliUsageError(
|
|
91789
|
+
if (!command) throw new CliUsageError(USAGE13);
|
|
91644
91790
|
await command({ context, args });
|
|
91645
91791
|
}
|
|
91646
91792
|
|
|
@@ -91718,7 +91864,7 @@ var monitorResume = stateRun("/api/agents/monitors/resume", "resume");
|
|
|
91718
91864
|
var monitorRemove = stateRun("/api/agents/monitors/remove", "rm");
|
|
91719
91865
|
|
|
91720
91866
|
// src/services/notification-commands.service.ts
|
|
91721
|
-
var
|
|
91867
|
+
var USAGE14 = `Usage:
|
|
91722
91868
|
laze notifications [show] your notification settings (people)
|
|
91723
91869
|
laze notifications set [--channels all|mentions|nothing] [--keywords a,b] [--dnd on|off]
|
|
91724
91870
|
[--dnd-from 22:00] [--dnd-to 08:00] [--tz <IANA zone>] [--push on|off] [--email on|off]
|
|
@@ -91747,14 +91893,14 @@ function switchOf({ args, name: name3 }) {
|
|
|
91747
91893
|
if (!text3) return void 0;
|
|
91748
91894
|
if (text3 !== "on" && text3 !== "off")
|
|
91749
91895
|
throw new CliUsageError(`--${name3} takes on or off.
|
|
91750
|
-
${
|
|
91896
|
+
${USAGE14}`);
|
|
91751
91897
|
return text3 === "on";
|
|
91752
91898
|
}
|
|
91753
91899
|
function changesOf(args) {
|
|
91754
91900
|
const channels3 = flagText({ args, name: "channels" });
|
|
91755
91901
|
if (channels3 && !["all", "mentions", "nothing"].includes(channels3))
|
|
91756
91902
|
throw new CliUsageError(`--channels takes all, mentions or nothing.
|
|
91757
|
-
${
|
|
91903
|
+
${USAGE14}`);
|
|
91758
91904
|
const keywords = typeof args.flags.keywords === "string" ? args.flags.keywords : void 0;
|
|
91759
91905
|
const emailAfter = flagText({ args, name: "email-after" });
|
|
91760
91906
|
const changes2 = {
|
|
@@ -91776,7 +91922,7 @@ async function showSettings({ context, args }) {
|
|
|
91776
91922
|
}
|
|
91777
91923
|
async function setSettings({ context, args }) {
|
|
91778
91924
|
const changes2 = changesOf(args);
|
|
91779
|
-
if (Object.keys(changes2).length === 0) throw new CliUsageError(
|
|
91925
|
+
if (Object.keys(changes2).length === 0) throw new CliUsageError(USAGE14);
|
|
91780
91926
|
const { client } = await signedIn({ context, args });
|
|
91781
91927
|
print8({
|
|
91782
91928
|
context,
|
|
@@ -91787,7 +91933,7 @@ async function setSettings({ context, args }) {
|
|
|
91787
91933
|
async function snoozeFor({ context, args }) {
|
|
91788
91934
|
const word3 = args.words[2];
|
|
91789
91935
|
const minutes = word3 === "off" ? 0 : Number(word3);
|
|
91790
|
-
if (!word3 || !Number.isInteger(minutes) || minutes < 0) throw new CliUsageError(
|
|
91936
|
+
if (!word3 || !Number.isInteger(minutes) || minutes < 0) throw new CliUsageError(USAGE14);
|
|
91791
91937
|
const { client } = await signedIn({ context, args });
|
|
91792
91938
|
print8({
|
|
91793
91939
|
context,
|
|
@@ -91805,7 +91951,7 @@ var NOTIFICATION_COMMANDS = {
|
|
|
91805
91951
|
async function notifications({ context, args }) {
|
|
91806
91952
|
const name3 = args.words[1] ?? "show";
|
|
91807
91953
|
const command = Object.hasOwn(NOTIFICATION_COMMANDS, name3) ? NOTIFICATION_COMMANDS[name3] : void 0;
|
|
91808
|
-
if (!command) throw new CliUsageError(
|
|
91954
|
+
if (!command) throw new CliUsageError(USAGE14);
|
|
91809
91955
|
await command({ context, args });
|
|
91810
91956
|
}
|
|
91811
91957
|
|
|
@@ -92315,7 +92461,7 @@ async function rushWakeHook({ context, args }) {
|
|
|
92315
92461
|
}
|
|
92316
92462
|
|
|
92317
92463
|
// src/services/schedule-commands.service.ts
|
|
92318
|
-
var
|
|
92464
|
+
var USAGE15 = `Usage:
|
|
92319
92465
|
laze schedule add <name> --prompt <text> (--cron "<m h dom mon dow>" | --rrule "<RRULE>" | --at <local time>)
|
|
92320
92466
|
[--tz <IANA zone>] [--channel <channelId>] [--agent <agentId>]
|
|
92321
92467
|
laze schedule list
|
|
@@ -92331,7 +92477,7 @@ function timingOf(args) {
|
|
|
92331
92477
|
const given = [cron, rrule, at].filter(Boolean);
|
|
92332
92478
|
if (given.length !== 1)
|
|
92333
92479
|
throw new CliUsageError(`Give exactly one of --cron, --rrule or --at.
|
|
92334
|
-
${
|
|
92480
|
+
${USAGE15}`);
|
|
92335
92481
|
if (cron) return { kind: "cron", cron };
|
|
92336
92482
|
if (rrule) return { kind: "rrule", rrule };
|
|
92337
92483
|
return { kind: "once", at };
|
|
@@ -92346,7 +92492,7 @@ function printSchedule({ context, schedule: schedule2 }) {
|
|
|
92346
92492
|
async function scheduleAdd({ context, args }) {
|
|
92347
92493
|
const name3 = args.words.slice(2).join(" ").trim();
|
|
92348
92494
|
const prompt = flagText({ args, name: "prompt" });
|
|
92349
|
-
if (!name3 || !prompt) throw new CliUsageError(
|
|
92495
|
+
if (!name3 || !prompt) throw new CliUsageError(USAGE15);
|
|
92350
92496
|
const timing = timingOf(args);
|
|
92351
92497
|
const { client } = await signedIn({ context, args });
|
|
92352
92498
|
const channelId = flagText({ args, name: "channel" });
|
|
@@ -92383,7 +92529,7 @@ function changesOf2(args) {
|
|
|
92383
92529
|
async function scheduleUpdate({ context, args }) {
|
|
92384
92530
|
const scheduleId = args.words[2];
|
|
92385
92531
|
const changes2 = changesOf2(args);
|
|
92386
|
-
if (!scheduleId || Object.keys(changes2).length === 0) throw new CliUsageError(
|
|
92532
|
+
if (!scheduleId || Object.keys(changes2).length === 0) throw new CliUsageError(USAGE15);
|
|
92387
92533
|
const { client } = await signedIn({ context, args });
|
|
92388
92534
|
const schedule2 = await client.post("/api/schedules/update", { scheduleId, ...changes2 });
|
|
92389
92535
|
if (args.flags.json) return context.out(`${JSON.stringify(schedule2, null, 2)}
|
|
@@ -92400,7 +92546,7 @@ async function scheduleList({ context, args }) {
|
|
|
92400
92546
|
function byId(path) {
|
|
92401
92547
|
return async ({ context, args }) => {
|
|
92402
92548
|
const scheduleId = args.words[2];
|
|
92403
|
-
if (!scheduleId) throw new CliUsageError(
|
|
92549
|
+
if (!scheduleId) throw new CliUsageError(USAGE15);
|
|
92404
92550
|
const { client } = await signedIn({ context, args });
|
|
92405
92551
|
const answer6 = await client.post(`/api/schedules/${path}`, {
|
|
92406
92552
|
scheduleId
|
|
@@ -92414,7 +92560,7 @@ function byId(path) {
|
|
|
92414
92560
|
}
|
|
92415
92561
|
async function scheduleRuns({ context, args }) {
|
|
92416
92562
|
const scheduleId = args.words[2];
|
|
92417
|
-
if (!scheduleId) throw new CliUsageError(
|
|
92563
|
+
if (!scheduleId) throw new CliUsageError(USAGE15);
|
|
92418
92564
|
const { client } = await signedIn({ context, args });
|
|
92419
92565
|
const runs = await client.post("/api/schedules/runs", { scheduleId });
|
|
92420
92566
|
if (args.flags.json) return context.out(`${JSON.stringify(runs, null, 2)}
|
|
@@ -92428,7 +92574,7 @@ async function scheduleRuns({ context, args }) {
|
|
|
92428
92574
|
}
|
|
92429
92575
|
async function scheduleRun({ context, args }) {
|
|
92430
92576
|
const scheduleId = args.words[2];
|
|
92431
|
-
if (!scheduleId) throw new CliUsageError(
|
|
92577
|
+
if (!scheduleId) throw new CliUsageError(USAGE15);
|
|
92432
92578
|
const { client } = await signedIn({ context, args });
|
|
92433
92579
|
const run4 = await client.post("/api/schedules/run", { scheduleId });
|
|
92434
92580
|
if (args.flags.json) return context.out(`${JSON.stringify(run4, null, 2)}
|
|
@@ -92449,14 +92595,14 @@ var SCHEDULE_COMMANDS = {
|
|
|
92449
92595
|
async function schedule({ context, args }) {
|
|
92450
92596
|
const name3 = args.words[1] ?? "";
|
|
92451
92597
|
const command = Object.hasOwn(SCHEDULE_COMMANDS, name3) ? SCHEDULE_COMMANDS[name3] : void 0;
|
|
92452
|
-
if (!command) throw new CliUsageError(
|
|
92598
|
+
if (!command) throw new CliUsageError(USAGE15);
|
|
92453
92599
|
await command({ context, args });
|
|
92454
92600
|
}
|
|
92455
92601
|
|
|
92456
92602
|
// src/services/skill-commands.service.ts
|
|
92457
92603
|
import { readdir as readdir8, readFile as readFile40 } from "node:fs/promises";
|
|
92458
92604
|
import { join as join28, relative as relative6, resolve as resolve19 } from "node:path";
|
|
92459
|
-
var
|
|
92605
|
+
var USAGE16 = `Usage:
|
|
92460
92606
|
laze skill list [--agent <agentId>]
|
|
92461
92607
|
laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
|
|
92462
92608
|
laze skill install --from <folder> [--as <name>] [--agent <agentId>] a folder with a SKILL.md
|
|
@@ -92505,7 +92651,7 @@ async function skillList({ context, args }) {
|
|
|
92505
92651
|
async function skillInstall({ context, args }) {
|
|
92506
92652
|
const catalogueId = args.words[2];
|
|
92507
92653
|
const from = flagText({ args, name: "from" });
|
|
92508
|
-
if (!catalogueId === !from) throw new CliUsageError(
|
|
92654
|
+
if (!catalogueId === !from) throw new CliUsageError(USAGE16);
|
|
92509
92655
|
const name3 = flagText({ args, name: "as" });
|
|
92510
92656
|
const agent3 = flagText({ args, name: "agent" });
|
|
92511
92657
|
const files2 = from ? await folderFiles({ root: resolve19(context.cwd, from) }) : void 0;
|
|
@@ -92523,7 +92669,7 @@ async function skillInstall({ context, args }) {
|
|
|
92523
92669
|
}
|
|
92524
92670
|
async function skillShow({ context, args }) {
|
|
92525
92671
|
const name3 = args.words[2];
|
|
92526
|
-
if (!name3) throw new CliUsageError(
|
|
92672
|
+
if (!name3) throw new CliUsageError(USAGE16);
|
|
92527
92673
|
const agent3 = flagText({ args, name: "agent" });
|
|
92528
92674
|
const { client } = await signedIn({ context, args });
|
|
92529
92675
|
const skill2 = await client.post("/api/skills/show", {
|
|
@@ -92556,7 +92702,7 @@ function agentFlag(args) {
|
|
|
92556
92702
|
}
|
|
92557
92703
|
async function skillRemove({ context, args }) {
|
|
92558
92704
|
const name3 = args.words[2];
|
|
92559
|
-
if (!name3) throw new CliUsageError(
|
|
92705
|
+
if (!name3) throw new CliUsageError(USAGE16);
|
|
92560
92706
|
const { client } = await signedIn({ context, args });
|
|
92561
92707
|
const removed = await client.post("/api/skills/remove", {
|
|
92562
92708
|
name: name3,
|
|
@@ -92573,7 +92719,7 @@ async function skillUpdate({ context, args }) {
|
|
|
92573
92719
|
const description = typeof args.flags.description === "string" ? args.flags.description : void 0;
|
|
92574
92720
|
const skillMdFile = flagText({ args, name: "skill-md" });
|
|
92575
92721
|
if (!name3 || !newName && description === void 0 && !skillMdFile) {
|
|
92576
|
-
throw new CliUsageError(
|
|
92722
|
+
throw new CliUsageError(USAGE16);
|
|
92577
92723
|
}
|
|
92578
92724
|
const skillMd = skillMdFile ? await readFile40(resolve19(context.cwd, skillMdFile), "utf8") : void 0;
|
|
92579
92725
|
const { client } = await signedIn({ context, args });
|
|
@@ -92592,7 +92738,7 @@ async function skillUpdate({ context, args }) {
|
|
|
92592
92738
|
function pinning({ unpin }) {
|
|
92593
92739
|
return async ({ context, args }) => {
|
|
92594
92740
|
const name3 = args.words[2];
|
|
92595
|
-
if (!name3) throw new CliUsageError(
|
|
92741
|
+
if (!name3) throw new CliUsageError(USAGE16);
|
|
92596
92742
|
const { client } = await signedIn({ context, args });
|
|
92597
92743
|
const path = unpin ? "/api/skills/unpin" : "/api/skills/pin";
|
|
92598
92744
|
const skill2 = await client.post(path, { name: name3, ...agentFlag(args) });
|
|
@@ -92616,7 +92762,7 @@ var SKILL_COMMANDS = {
|
|
|
92616
92762
|
async function skill({ context, args }) {
|
|
92617
92763
|
const name3 = args.words[1] ?? "";
|
|
92618
92764
|
const command = Object.hasOwn(SKILL_COMMANDS, name3) ? SKILL_COMMANDS[name3] : void 0;
|
|
92619
|
-
if (!command) throw new CliUsageError(
|
|
92765
|
+
if (!command) throw new CliUsageError(USAGE16);
|
|
92620
92766
|
await command({ context, args });
|
|
92621
92767
|
}
|
|
92622
92768
|
|
|
@@ -93227,11 +93373,11 @@ function statusLine2({ presence: presence2 }) {
|
|
|
93227
93373
|
}
|
|
93228
93374
|
|
|
93229
93375
|
// src/services/status-commands.service.ts
|
|
93230
|
-
var
|
|
93376
|
+
var USAGE17 = "Usage: laze status set <emoji> [text] [--for 30m|1h|4h|today|week|never] [--tz <zone>], laze status clear|away|active";
|
|
93231
93377
|
function clearAfterOf({ args }) {
|
|
93232
93378
|
const wanted = flagText({ args, name: "for", fallback: "never" });
|
|
93233
93379
|
const known = STATUS_CLEAR_AFTER.find((candidate) => candidate === wanted);
|
|
93234
|
-
if (!known) throw new CliUsageError(
|
|
93380
|
+
if (!known) throw new CliUsageError(USAGE17);
|
|
93235
93381
|
return known;
|
|
93236
93382
|
}
|
|
93237
93383
|
function answer5({
|
|
@@ -93245,7 +93391,7 @@ function answer5({
|
|
|
93245
93391
|
}
|
|
93246
93392
|
async function statusSet({ context, args }) {
|
|
93247
93393
|
const [, , emoji4, ...words] = args.words;
|
|
93248
|
-
if (!emoji4) throw new CliUsageError(
|
|
93394
|
+
if (!emoji4) throw new CliUsageError(USAGE17);
|
|
93249
93395
|
const clearAfter = clearAfterOf({ args });
|
|
93250
93396
|
const timeZone = flagText({ args, name: "tz" }) || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
93251
93397
|
const { client } = await signedIn({ context, args });
|
|
@@ -93269,7 +93415,7 @@ async function statusAway({ context, args }) {
|
|
|
93269
93415
|
answer5({ context, args, presence: presence2 });
|
|
93270
93416
|
}
|
|
93271
93417
|
async function statusUsage() {
|
|
93272
|
-
throw new CliUsageError(
|
|
93418
|
+
throw new CliUsageError(USAGE17);
|
|
93273
93419
|
}
|
|
93274
93420
|
|
|
93275
93421
|
// src/services/update-commands.service.ts
|
|
@@ -94775,7 +94921,7 @@ var PATHS3 = {
|
|
|
94775
94921
|
var STATUS_WAIT_SECONDS2 = 50;
|
|
94776
94922
|
var STATUS_CALLS2 = 2;
|
|
94777
94923
|
var SETTLED = /* @__PURE__ */ new Set(["sent", "denied", "expired", "failed"]);
|
|
94778
|
-
var
|
|
94924
|
+
var USAGE18 = [
|
|
94779
94925
|
"Usage: laze whatsapp chats <machine> [--limit <n>] the chats on the machine, newest first",
|
|
94780
94926
|
" laze whatsapp read <machine> <chat> [--limit <n>] a chat's last messages, oldest first",
|
|
94781
94927
|
' laze whatsapp send <machine> <chat> "<text>" send as the owner; an agent waits for their approval',
|
|
@@ -94785,14 +94931,14 @@ var USAGE17 = [
|
|
|
94785
94931
|
].join("\n");
|
|
94786
94932
|
function word2({ args, at }) {
|
|
94787
94933
|
const value = args.words[at];
|
|
94788
|
-
if (!value) throw new CliUsageError(
|
|
94934
|
+
if (!value) throw new CliUsageError(USAGE18);
|
|
94789
94935
|
return value;
|
|
94790
94936
|
}
|
|
94791
94937
|
function limitOf5({ args }) {
|
|
94792
94938
|
const text3 = flagText({ args, name: "limit" });
|
|
94793
94939
|
if (!text3) return {};
|
|
94794
94940
|
const limit = Number(text3);
|
|
94795
|
-
if (!Number.isInteger(limit) || limit < 1) throw new CliUsageError(
|
|
94941
|
+
if (!Number.isInteger(limit) || limit < 1) throw new CliUsageError(USAGE18);
|
|
94796
94942
|
return { limit };
|
|
94797
94943
|
}
|
|
94798
94944
|
async function chats({ context, args }) {
|
|
@@ -94854,7 +95000,7 @@ Still waiting. Run \`laze whatsapp status ${send5.id}\` later to see the answer.
|
|
|
94854
95000
|
}
|
|
94855
95001
|
async function send4({ context, args }) {
|
|
94856
95002
|
const text3 = args.words.slice(4).join(" ") || args.rest.join(" ");
|
|
94857
|
-
if (!text3) throw new CliUsageError(
|
|
95003
|
+
if (!text3) throw new CliUsageError(USAGE18);
|
|
94858
95004
|
const client = await computeClient({ context, args });
|
|
94859
95005
|
const asked = await client.post(PATHS3.send, {
|
|
94860
95006
|
machine: word2({ args, at: 2 }),
|
|
@@ -94884,11 +95030,11 @@ async function whatsapp({
|
|
|
94884
95030
|
if (command === "status") return status10({ context, args });
|
|
94885
95031
|
const linking = whatsappPairingCommand(command);
|
|
94886
95032
|
if (linking) return linking({ context, args });
|
|
94887
|
-
throw new CliUsageError(
|
|
95033
|
+
throw new CliUsageError(USAGE18);
|
|
94888
95034
|
}
|
|
94889
95035
|
|
|
94890
95036
|
// src/services/wiki-commands.service.ts
|
|
94891
|
-
var
|
|
95037
|
+
var USAGE19 = `Usage:
|
|
94892
95038
|
laze wiki list
|
|
94893
95039
|
laze wiki get <path>
|
|
94894
95040
|
laze wiki put <path> <markdown|@file|-> [--title <title>] [--channel <channel>] [--base <version>]
|
|
@@ -94908,7 +95054,7 @@ async function wikiList({ context, args }) {
|
|
|
94908
95054
|
}
|
|
94909
95055
|
async function wikiGet({ context, args }) {
|
|
94910
95056
|
const path = args.words[2];
|
|
94911
|
-
if (!path) throw new CliUsageError(
|
|
95057
|
+
if (!path) throw new CliUsageError(USAGE19);
|
|
94912
95058
|
const { client } = await signedIn({ context, args });
|
|
94913
95059
|
const page = await client.post("/api/wiki/get", { path });
|
|
94914
95060
|
if (args.flags.json) return context.out(`${JSON.stringify(page, null, 2)}
|
|
@@ -94925,7 +95071,7 @@ Linked from: ${page.backlinks.map((link2) => link2.path).join(", ")}
|
|
|
94925
95071
|
async function wikiPut({ context, args }) {
|
|
94926
95072
|
const path = args.words[2];
|
|
94927
95073
|
const value = args.words.slice(3).join(" ");
|
|
94928
|
-
if (!path || !value) throw new CliUsageError(
|
|
95074
|
+
if (!path || !value) throw new CliUsageError(USAGE19);
|
|
94929
95075
|
const body = await textArgument({ context, value });
|
|
94930
95076
|
const title = flagText({ args, name: "title" });
|
|
94931
95077
|
const channel = flagText({ args, name: "channel" });
|
|
@@ -94945,7 +95091,7 @@ async function wikiPut({ context, args }) {
|
|
|
94945
95091
|
}
|
|
94946
95092
|
async function wikiSearch({ context, args }) {
|
|
94947
95093
|
const query = args.words.slice(2).join(" ").trim();
|
|
94948
|
-
if (!query) throw new CliUsageError(
|
|
95094
|
+
if (!query) throw new CliUsageError(USAGE19);
|
|
94949
95095
|
const { client } = await signedIn({ context, args });
|
|
94950
95096
|
const hits = await client.post("/api/wiki/search", { query });
|
|
94951
95097
|
if (args.flags.json) return context.out(`${JSON.stringify(hits, null, 2)}
|
|
@@ -94955,7 +95101,7 @@ async function wikiSearch({ context, args }) {
|
|
|
94955
95101
|
}
|
|
94956
95102
|
async function wikiHistory({ context, args }) {
|
|
94957
95103
|
const path = args.words[2];
|
|
94958
|
-
if (!path) throw new CliUsageError(
|
|
95104
|
+
if (!path) throw new CliUsageError(USAGE19);
|
|
94959
95105
|
const { client } = await signedIn({ context, args });
|
|
94960
95106
|
const revisions = await client.post("/api/wiki/history", { path });
|
|
94961
95107
|
if (args.flags.json) return context.out(`${JSON.stringify(revisions, null, 2)}
|
|
@@ -94969,7 +95115,7 @@ async function wikiHistory({ context, args }) {
|
|
|
94969
95115
|
}
|
|
94970
95116
|
async function wikiMove({ context, args }) {
|
|
94971
95117
|
const [, , path, to] = args.words;
|
|
94972
|
-
if (!path || !to) throw new CliUsageError(
|
|
95118
|
+
if (!path || !to) throw new CliUsageError(USAGE19);
|
|
94973
95119
|
const { client } = await signedIn({ context, args });
|
|
94974
95120
|
const page = await client.post("/api/wiki/move", { path, to });
|
|
94975
95121
|
if (args.flags.json) return context.out(`${JSON.stringify(page, null, 2)}
|
|
@@ -94979,7 +95125,7 @@ async function wikiMove({ context, args }) {
|
|
|
94979
95125
|
}
|
|
94980
95126
|
async function wikiRemove({ context, args }) {
|
|
94981
95127
|
const path = args.words[2];
|
|
94982
|
-
if (!path) throw new CliUsageError(
|
|
95128
|
+
if (!path) throw new CliUsageError(USAGE19);
|
|
94983
95129
|
const { client } = await signedIn({ context, args });
|
|
94984
95130
|
const removed = await client.post("/api/wiki/remove", { path });
|
|
94985
95131
|
if (args.flags.json) return context.out(`${JSON.stringify(removed)}
|
|
@@ -94999,7 +95145,7 @@ var WIKI_COMMANDS = {
|
|
|
94999
95145
|
async function wiki({ context, args }) {
|
|
95000
95146
|
const name3 = args.words[1] ?? "";
|
|
95001
95147
|
const command = Object.hasOwn(WIKI_COMMANDS, name3) ? WIKI_COMMANDS[name3] : void 0;
|
|
95002
|
-
if (!command) throw new CliUsageError(
|
|
95148
|
+
if (!command) throw new CliUsageError(USAGE19);
|
|
95003
95149
|
await command({ context, args });
|
|
95004
95150
|
}
|
|
95005
95151
|
|
|
@@ -95185,7 +95331,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
95185
95331
|
laze feed update|reply|read <id>, laze feed inbox change, answer and read your items
|
|
95186
95332
|
laze feed list|count|decisions your own feed as a person: cards and their actions
|
|
95187
95333
|
laze feed act <id> <actionId>, comment <id> <text> answer a card in your feed
|
|
95188
|
-
laze feed done|put-back|unsnooze <id>, snooze <id> --until <time> move a card
|
|
95334
|
+
laze feed done|put-back|unsnooze|pin|unpin <id>, snooze <id> --until <time> move or pin a card
|
|
95335
|
+
an agent whose owner turned on Manage my feed runs these on its owner's whole feed
|
|
95189
95336
|
laze feed channel <channelId> the feed cards a channel shows
|
|
95190
95337
|
laze schedule add <name> --prompt <p> --cron "0 8 * * 1-5" --tz <zone> work on a timer
|
|
95191
95338
|
laze schedule list|update|pause|resume|rm|runs your agent's schedules and their runs
|
|
@@ -95206,6 +95353,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
95206
95353
|
laze agent update <agent>|--self [--name] [--description] [--avatar|--avatar-emoji] [--model] [--effort] [--max-context] change an agent your owner owns, or yourself
|
|
95207
95354
|
laze agent archive <agent> remove an agent your owner owns; kept 30 days
|
|
95208
95355
|
laze agent archived removed agents you may restore, with the day each goes
|
|
95356
|
+
laze agent feed-access [<agent> on|off] let your own agent sort your whole feed (Manage my feed)
|
|
95209
95357
|
laze agent restore|delete <agent> bring an archived agent back, or delete it for good now
|
|
95210
95358
|
laze agent copy <agent> <name> a team copy of a personal agent, with its skills
|
|
95211
95359
|
laze agent pause|resume <agent> [--reason <why>] pause an agent Laze runs, or resume it
|
|
@@ -95476,6 +95624,7 @@ var COMMANDS3 = {
|
|
|
95476
95624
|
"agent update": updateAgent,
|
|
95477
95625
|
"agent archive": archiveAgent,
|
|
95478
95626
|
"agent archived": listArchivedAgents,
|
|
95627
|
+
"agent feed-access": agentFeedAccess,
|
|
95479
95628
|
"agent restore": restoreAgent,
|
|
95480
95629
|
"agent delete": deleteArchivedAgent,
|
|
95481
95630
|
"agent copy": copyAgent,
|
package/package.json
CHANGED