@lazehq/cli 0.1.129 → 0.1.131
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 +47 -12
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
|
|
|
36960
36960
|
}
|
|
36961
36961
|
|
|
36962
36962
|
// src/rules/cli-version.rules.ts
|
|
36963
|
-
var STAMPED = "0.1.
|
|
36963
|
+
var STAMPED = "0.1.131";
|
|
36964
36964
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36965
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36966
|
}
|
|
@@ -62716,6 +62716,25 @@ var vaultSecretOfferedSchemaDefinition = external_exports.object({
|
|
|
62716
62716
|
state: external_exports.enum(["pending", "denied", "expired"])
|
|
62717
62717
|
});
|
|
62718
62718
|
|
|
62719
|
+
// ../../modules/vault/contract/src/vault-agent-setup.ts
|
|
62720
|
+
var VAULT_CLI_INSTALL = "npm i -g @lazehq/cli";
|
|
62721
|
+
var VAULT_CLI_LOGIN = "laze login";
|
|
62722
|
+
var VAULT_AGENT_PROMPT = `I keep my API keys and passwords in the Laze vault. Use them through the laze CLI, which is signed in as me. I approve uses on my phone or computer, so a command may wait for me.
|
|
62723
|
+
|
|
62724
|
+
If \`laze\` is missing, run \`${VAULT_CLI_INSTALL}\`, then ask me to run \`${VAULT_CLI_LOGIN}\`.
|
|
62725
|
+
|
|
62726
|
+
Commands:
|
|
62727
|
+
- \`laze vault list\` shows the keys you may use: names, fields and levels, never values.
|
|
62728
|
+
- \`laze vault run <name> --reason "<one plain sentence>" -- <command>\` runs the command with the key's fields as environment variables. To put a value in an argument, let a shell expand it inside the run, for example: \`laze vault run openai --reason "List the models our account can use" -- sh -c 'curl -s https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"'\`
|
|
62729
|
+
- \`laze vault env --reason "<one plain sentence>" -- <command>\` runs the command with every key a \`.env.vault\` file names, in this folder or a parent. One line per variable: \`KEY\` (the key that holds that field), \`KEY={{vault:<name>}}\`, or a key's name for all its fields. \`--env <x>\` reads \`.env.<x>.vault\` instead. \`laze vault env --names\` shows what each line resolves to, never a value.
|
|
62730
|
+
- \`laze vault aws <name> --reason "<one plain sentence>" -- <aws command>\` runs the command with a short-lived AWS session made from that key.
|
|
62731
|
+
|
|
62732
|
+
Rules:
|
|
62733
|
+
- The reason is one short sentence I can read on my phone: what you want to do and why. Never a command.
|
|
62734
|
+
- A run may wait until I answer its approval card. Let it wait and do not start it again. Exit 75: the wait ran out, run it again. Exit 77: I denied it, so stop and ask me. Exit 2: rewrite the reason.
|
|
62735
|
+
- Never print, echo or log a value. Never write one into a file, a commit, a message or your notes.
|
|
62736
|
+
- If no key fits, tell me the name and fields you need. Never ask me to paste a secret into the chat.`;
|
|
62737
|
+
|
|
62719
62738
|
// ../../modules/chat/contract/src/chat.close.ts
|
|
62720
62739
|
var conversationOpenDaysSchemaDefinition = external_exports.union([external_exports.literal(7), external_exports.literal(14), external_exports.literal(30), external_exports.literal(90)]).nullable();
|
|
62721
62740
|
var conversationOpenDaysSchema = conversationOpenDaysSchemaDefinition;
|
|
@@ -79855,6 +79874,26 @@ someone an action cannot be done because Laze refused it earlier, run \`laze cha
|
|
|
79855
79874
|
again. When a change lifts a refusal you hit in a conversation, tell the people there once that
|
|
79856
79875
|
it works now.
|
|
79857
79876
|
|
|
79877
|
+
## Keys from the vault
|
|
79878
|
+
|
|
79879
|
+
Your owner keeps API keys and passwords in the Laze vault. Use them only through these commands:
|
|
79880
|
+
|
|
79881
|
+
- \`laze vault list\` shows the keys you may use: names, fields and levels, never values.
|
|
79882
|
+
- \`laze vault run <name> --reason "<one plain sentence>" -- <command>\` runs the command with the
|
|
79883
|
+
key's fields as environment variables. To put a value in an argument, let a shell expand it
|
|
79884
|
+
inside the run: \`-- sh -c 'curl -H "Authorization: Bearer $OPENAI_API_KEY" <url>'\`.
|
|
79885
|
+
- \`laze vault env --reason "<one plain sentence>" -- <command>\` runs it with every key a
|
|
79886
|
+
\`.env.vault\` file names (\`--env <x>\` reads \`.env.<x>.vault\`, \`--names\` shows what each line
|
|
79887
|
+
resolves to, never a value).
|
|
79888
|
+
- \`laze vault aws <name> --reason "<one plain sentence>" -- <aws command>\` runs it with a
|
|
79889
|
+
short-lived AWS session made from that key.
|
|
79890
|
+
|
|
79891
|
+
The reason is one short sentence a person reads on a phone: what you want to do and why, never a
|
|
79892
|
+
command. A run may wait for an approval card: let it wait and do not start it again. Exit 75: the
|
|
79893
|
+
wait ran out, run it again. Exit 77: denied, so stop and ask. Exit 2: rewrite the reason. Never
|
|
79894
|
+
print, echo or log a value, and never write one into a file, a commit, a message or your notes.
|
|
79895
|
+
If no key fits, ask for it by name; never ask anyone to paste a secret into the chat.
|
|
79896
|
+
|
|
79858
79897
|
## Browser tabs and sign-ins
|
|
79859
79898
|
|
|
79860
79899
|
- \`laze browser tabs\` lists the live browser tabs of your conversations. You drive every tab
|
|
@@ -89656,7 +89695,7 @@ async function channelSettings({ context, args }) {
|
|
|
89656
89695
|
|
|
89657
89696
|
// src/services/chat-actions-commands.service.ts
|
|
89658
89697
|
import { readFile as readFile19 } from "node:fs/promises";
|
|
89659
|
-
import { basename as basename9,
|
|
89698
|
+
import { basename as basename9, resolve as resolve11 } from "node:path";
|
|
89660
89699
|
|
|
89661
89700
|
// src/rules/app-link.rules.ts
|
|
89662
89701
|
var MARKDOWN_LINK = /^\[[^\]]*\]\((\S+)\)$/;
|
|
@@ -89876,7 +89915,7 @@ var CHAT_ACTIONS_USAGE = `Usage:
|
|
|
89876
89915
|
laze file link <fileId> [--variant original|thumbnail|poster|preview] [--download]
|
|
89877
89916
|
laze file download <fileId> [--out <path>] save a file to disk, up to 1 GB
|
|
89878
89917
|
laze file rename <fileId> <name> rename a file you posted
|
|
89879
|
-
laze file upload <channel> <path> [--name <name>] [--type <content-type>] upload a file; post it with its id
|
|
89918
|
+
laze file upload <channel> <path> [--name <name>] [--type <content-type>] upload a file under its own name (or --name); post it with its id
|
|
89880
89919
|
laze saved [--done] [--limit <n>] | laze saved marks your saved messages (people)
|
|
89881
89920
|
laze save <messageId> [--off] save a message for later, or take it out
|
|
89882
89921
|
laze saved done <messageId> [--undo] mark a saved message done, or open again
|
|
@@ -90100,10 +90139,6 @@ var files = async ({ context, args, client }) => {
|
|
|
90100
90139
|
}).join("") || "No files.\n"
|
|
90101
90140
|
});
|
|
90102
90141
|
};
|
|
90103
|
-
function uploadNameOf({ cwd, path }) {
|
|
90104
|
-
const inside = relative4(cwd, path);
|
|
90105
|
-
return inside && !inside.startsWith("..") && !isAbsolute2(inside) ? inside : basename9(path);
|
|
90106
|
-
}
|
|
90107
90142
|
var fileUpload = async ({ context, args, client }) => {
|
|
90108
90143
|
const path = resolve11(context.cwd, wordAt(args, 3));
|
|
90109
90144
|
const bytes = new Uint8Array(await readFile19(path));
|
|
@@ -90113,7 +90148,7 @@ var fileUpload = async ({ context, args, client }) => {
|
|
|
90113
90148
|
file: {
|
|
90114
90149
|
channel: wordAt(args, 2),
|
|
90115
90150
|
fileName: readableUploadName({
|
|
90116
|
-
name:
|
|
90151
|
+
name: basename9(path),
|
|
90117
90152
|
...flagText({ args, name: "name" }) && { asked: flagText({ args, name: "name" }) }
|
|
90118
90153
|
}),
|
|
90119
90154
|
contentType: flagText({ args, name: "type", fallback: contentTypeOf(path) }),
|
|
@@ -101072,7 +101107,7 @@ import { join as join32, resolve as resolve20 } from "node:path";
|
|
|
101072
101107
|
|
|
101073
101108
|
// src/services/mount-files.service.ts
|
|
101074
101109
|
import { mkdir as mkdir11, readFile as readFile30, rm as rm18, writeFile as writeFile8 } from "node:fs/promises";
|
|
101075
|
-
import { dirname as dirname23, relative as
|
|
101110
|
+
import { dirname as dirname23, relative as relative4, resolve as resolve19 } from "node:path";
|
|
101076
101111
|
async function textArgument({
|
|
101077
101112
|
context,
|
|
101078
101113
|
value
|
|
@@ -101095,7 +101130,7 @@ async function writeMount({
|
|
|
101095
101130
|
await mkdir11(root, { recursive: true });
|
|
101096
101131
|
for (const file4 of files2) {
|
|
101097
101132
|
const target = resolve19(root, file4.path);
|
|
101098
|
-
const inside =
|
|
101133
|
+
const inside = relative4(root, target);
|
|
101099
101134
|
if (!inside || inside.startsWith(".."))
|
|
101100
101135
|
throw new Error(`Refusing to write outside ${root}: ${file4.path}`);
|
|
101101
101136
|
await mkdir11(dirname23(target), { recursive: true });
|
|
@@ -104399,7 +104434,7 @@ async function schedule({ context, args }) {
|
|
|
104399
104434
|
|
|
104400
104435
|
// src/services/skill-commands.service.ts
|
|
104401
104436
|
import { readdir as readdir8, readFile as readFile33 } from "node:fs/promises";
|
|
104402
|
-
import { join as join35, relative as
|
|
104437
|
+
import { join as join35, relative as relative5, resolve as resolve22 } from "node:path";
|
|
104403
104438
|
var USAGE18 = `Usage:
|
|
104404
104439
|
laze skill list [--agent <agentId>]
|
|
104405
104440
|
laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
|
|
@@ -104421,7 +104456,7 @@ async function folderFiles({ root }) {
|
|
|
104421
104456
|
for (const entry2 of entries) {
|
|
104422
104457
|
if (!entry2.isFile()) continue;
|
|
104423
104458
|
const full = join35(entry2.parentPath, entry2.name);
|
|
104424
|
-
files2.push({ path:
|
|
104459
|
+
files2.push({ path: relative5(root, full), content: await readFile33(full, "utf8") });
|
|
104425
104460
|
}
|
|
104426
104461
|
return files2.toSorted((a, b) => a.path.localeCompare(b.path));
|
|
104427
104462
|
}
|
package/package.json
CHANGED