@skillrecordings/cli 0.2.0 → 0.2.2

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/bin/skill.mjs CHANGED
@@ -1,27 +1,8 @@
1
1
  #!/usr/bin/env bun
2
- import { fileURLToPath } from 'node:url'
3
- import { dirname, join } from 'node:path'
4
2
 
5
- const __dirname = dirname(fileURLToPath(import.meta.url))
6
- const cliDir = join(__dirname, '..')
3
+ // Load secrets via 1Password/age encryption before importing CLI
4
+ // This sets DATABASE_URL and other env vars from encrypted .env.encrypted
5
+ await import('../dist/preload.js')
7
6
 
8
- // Commands that don't need database/secrets
9
- const noSecretsNeeded = process.argv.some((a) =>
10
- ['--help', '-h', '--version', '-V', 'auth'].includes(a)
11
- )
12
-
13
- // Skip env validation for commands that don't need it
14
- if (noSecretsNeeded) {
15
- process.env.SKIP_ENV_VALIDATION = '1'
16
- }
17
-
18
- // Load env from CLI package directory
19
- try {
20
- const dotenvFlow = await import('dotenv-flow')
21
- dotenvFlow.config({ path: cliDir, silent: true })
22
- } catch {
23
- // Ignore - env loading is optional
24
- }
25
-
26
- // Now import the main CLI
7
+ // Now import the main CLI with secrets available
27
8
  await import('../dist/index.js')
@@ -0,0 +1,36 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-WFANXVQG.js";
4
+
5
+ // src/lib/crypto.ts
6
+ init_esm_shims();
7
+ import {
8
+ Decrypter,
9
+ Encrypter,
10
+ generateIdentity,
11
+ identityToRecipient
12
+ } from "age-encryption";
13
+ async function generateKeypair() {
14
+ const privateKey = await generateIdentity();
15
+ const publicKey = await identityToRecipient(privateKey);
16
+ return { publicKey, privateKey };
17
+ }
18
+ async function encrypt(data, recipientPublicKey) {
19
+ const encrypter = new Encrypter();
20
+ encrypter.addRecipient(recipientPublicKey);
21
+ const input = typeof data === "string" ? data : new TextDecoder().decode(data);
22
+ return encrypter.encrypt(input);
23
+ }
24
+ async function decrypt(encrypted, privateKey) {
25
+ const decrypter = new Decrypter();
26
+ decrypter.addIdentity(privateKey);
27
+ const input = encrypted instanceof Buffer ? new Uint8Array(encrypted) : encrypted;
28
+ return decrypter.decrypt(input, "text");
29
+ }
30
+
31
+ export {
32
+ generateKeypair,
33
+ encrypt,
34
+ decrypt
35
+ };
36
+ //# sourceMappingURL=chunk-MNFDM56Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/crypto.ts"],"sourcesContent":["import {\n Decrypter,\n Encrypter,\n generateIdentity,\n identityToRecipient,\n} from 'age-encryption'\n\nexport interface Keypair {\n publicKey: string\n privateKey: string\n}\n\n/**\n * Generate an age keypair\n * @returns Keypair with publicKey (age1...) and privateKey (AGE-SECRET-KEY-1...)\n */\nexport async function generateKeypair(): Promise<Keypair> {\n const privateKey = await generateIdentity()\n const publicKey = await identityToRecipient(privateKey)\n return { publicKey, privateKey }\n}\n\n/**\n * Encrypt data with an age public key\n * @param data - String or Buffer to encrypt\n * @param recipientPublicKey - age public key (age1...)\n * @returns Encrypted data as Uint8Array\n */\nexport async function encrypt(\n data: string | Buffer,\n recipientPublicKey: string\n): Promise<Uint8Array> {\n const encrypter = new Encrypter()\n encrypter.addRecipient(recipientPublicKey)\n\n const input = typeof data === 'string' ? data : new TextDecoder().decode(data)\n return encrypter.encrypt(input)\n}\n\n/**\n * Decrypt data with an age private key\n * @param encrypted - Encrypted data as Uint8Array or Buffer\n * @param privateKey - age private key (AGE-SECRET-KEY-1...)\n * @returns Decrypted data as string\n */\nexport async function decrypt(\n encrypted: Uint8Array | Buffer,\n privateKey: string\n): Promise<string> {\n const decrypter = new Decrypter()\n decrypter.addIdentity(privateKey)\n\n const input =\n encrypted instanceof Buffer ? new Uint8Array(encrypted) : encrypted\n return decrypter.decrypt(input, 'text')\n}\n"],"mappings":";;;;;AAAA;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAWP,eAAsB,kBAAoC;AACxD,QAAM,aAAa,MAAM,iBAAiB;AAC1C,QAAM,YAAY,MAAM,oBAAoB,UAAU;AACtD,SAAO,EAAE,WAAW,WAAW;AACjC;AAQA,eAAsB,QACpB,MACA,oBACqB;AACrB,QAAM,YAAY,IAAI,UAAU;AAChC,YAAU,aAAa,kBAAkB;AAEzC,QAAM,QAAQ,OAAO,SAAS,WAAW,OAAO,IAAI,YAAY,EAAE,OAAO,IAAI;AAC7E,SAAO,UAAU,QAAQ,KAAK;AAChC;AAQA,eAAsB,QACpB,WACA,YACiB;AACjB,QAAM,YAAY,IAAI,UAAU;AAChC,YAAU,YAAY,UAAU;AAEhC,QAAM,QACJ,qBAAqB,SAAS,IAAI,WAAW,SAAS,IAAI;AAC5D,SAAO,UAAU,QAAQ,OAAO,MAAM;AACxC;","names":[]}
@@ -3547,7 +3547,7 @@ ${message.body}
3547
3547
  ---
3548
3548
  Write your response:`;
3549
3549
  if (useAgentMode && appId) {
3550
- const { runSupportAgent } = await import("./config-AUAIYDSI.js");
3550
+ const { runSupportAgent } = await import("./config-5DDRFZMG.js");
3551
3551
  await log("debug", "draft using agent mode", {
3552
3552
  workflow: "pipeline",
3553
3553
  step: "draft",
@@ -7068,4 +7068,4 @@ export {
7068
7068
  runPipeline,
7069
7069
  runThreadPipeline
7070
7070
  };
7071
- //# sourceMappingURL=chunk-3E3GYSZR.js.map
7071
+ //# sourceMappingURL=chunk-SASXI5PZ.js.map
@@ -1,3 +1,6 @@
1
+ import {
2
+ createTool
3
+ } from "./chunk-F4EM72IH.js";
1
4
  import {
2
5
  Redis2,
3
6
  traceMemoryCite,
@@ -18,9 +21,6 @@ import {
18
21
  import {
19
22
  queryVectors
20
23
  } from "./chunk-H3D6VCME.js";
21
- import {
22
- createTool
23
- } from "./chunk-F4EM72IH.js";
24
24
  import {
25
25
  __export,
26
26
  init_esm_shims
@@ -22339,4 +22339,4 @@ export {
22339
22339
  DEFAULT_AGENT_MODEL,
22340
22340
  runSupportAgent
22341
22341
  };
22342
- //# sourceMappingURL=chunk-2NCCVTEE.js.map
22342
+ //# sourceMappingURL=chunk-XHLN776K.js.map
@@ -3,13 +3,13 @@ import {
3
3
  SUPPORT_AGENT_PROMPT,
4
4
  agentTools,
5
5
  runSupportAgent
6
- } from "./chunk-2NCCVTEE.js";
6
+ } from "./chunk-XHLN776K.js";
7
+ import "./chunk-F4EM72IH.js";
7
8
  import "./chunk-KEV3QKXP.js";
8
9
  import "./chunk-MLNDSBZ4.js";
9
10
  import "./chunk-ZNF7XD2S.js";
10
11
  import "./chunk-H3D6VCME.js";
11
12
  import "./chunk-MG37YDAK.js";
12
- import "./chunk-F4EM72IH.js";
13
13
  import "./chunk-WFANXVQG.js";
14
14
  export {
15
15
  DEFAULT_AGENT_MODEL,
@@ -17,4 +17,4 @@ export {
17
17
  agentTools,
18
18
  runSupportAgent
19
19
  };
20
- //# sourceMappingURL=config-AUAIYDSI.js.map
20
+ //# sourceMappingURL=config-5DDRFZMG.js.map
package/dist/index.js CHANGED
@@ -23,7 +23,8 @@ import {
23
23
  gte,
24
24
  or,
25
25
  sql
26
- } from "./chunk-2NCCVTEE.js";
26
+ } from "./chunk-XHLN776K.js";
27
+ import "./chunk-F4EM72IH.js";
27
28
  import {
28
29
  DEFAULT_CATEGORY_TAG_MAPPING,
29
30
  FrontApiError,
@@ -35,7 +36,7 @@ import {
35
36
  runPipeline,
36
37
  validate,
37
38
  validateSync
38
- } from "./chunk-3E3GYSZR.js";
39
+ } from "./chunk-SASXI5PZ.js";
39
40
  import "./chunk-KEV3QKXP.js";
40
41
  import "./chunk-HK3PEWFD.js";
41
42
  import "./chunk-WYKL32C3.js";
@@ -44,12 +45,16 @@ import {
44
45
  VotingService,
45
46
  calculateConfidence
46
47
  } from "./chunk-MLNDSBZ4.js";
48
+ import {
49
+ decrypt,
50
+ encrypt,
51
+ generateKeypair
52
+ } from "./chunk-MNFDM56Q.js";
47
53
  import "./chunk-ZNF7XD2S.js";
48
54
  import {
49
55
  upsertVector
50
56
  } from "./chunk-H3D6VCME.js";
51
57
  import "./chunk-MG37YDAK.js";
52
- import "./chunk-F4EM72IH.js";
53
58
  import {
54
59
  __commonJS,
55
60
  __dirname,
@@ -74530,32 +74535,6 @@ init_esm_shims();
74530
74535
  import path from "path";
74531
74536
  import fs from "fs/promises";
74532
74537
 
74533
- // src/lib/crypto.ts
74534
- init_esm_shims();
74535
- import {
74536
- Decrypter,
74537
- Encrypter,
74538
- generateIdentity,
74539
- identityToRecipient
74540
- } from "age-encryption";
74541
- async function generateKeypair() {
74542
- const privateKey = await generateIdentity();
74543
- const publicKey = await identityToRecipient(privateKey);
74544
- return { publicKey, privateKey };
74545
- }
74546
- async function encrypt(data2, recipientPublicKey) {
74547
- const encrypter = new Encrypter();
74548
- encrypter.addRecipient(recipientPublicKey);
74549
- const input2 = typeof data2 === "string" ? data2 : new TextDecoder().decode(data2);
74550
- return encrypter.encrypt(input2);
74551
- }
74552
- async function decrypt(encrypted, privateKey) {
74553
- const decrypter = new Decrypter();
74554
- decrypter.addIdentity(privateKey);
74555
- const input2 = encrypted instanceof Buffer ? new Uint8Array(encrypted) : encrypted;
74556
- return decrypter.decrypt(input2, "text");
74557
- }
74558
-
74559
74538
  // src/lib/onepassword.ts
74560
74539
  init_esm_shims();
74561
74540
  import { execSync, spawn } from "child_process";
@@ -76398,7 +76377,7 @@ async function compare(options) {
76398
76377
  console.log(`Baseline: ${baseline}`);
76399
76378
  }
76400
76379
  } else {
76401
- const { SUPPORT_AGENT_PROMPT: SUPPORT_AGENT_PROMPT2 } = await import("./config-AUAIYDSI.js");
76380
+ const { SUPPORT_AGENT_PROMPT: SUPPORT_AGENT_PROMPT2 } = await import("./config-5DDRFZMG.js");
76402
76381
  baselinePrompt = SUPPORT_AGENT_PROMPT2;
76403
76382
  if (!json) {
76404
76383
  console.log("Baseline: Production prompt");
@@ -79686,7 +79665,7 @@ async function runValidateEval(scenarios, options) {
79686
79665
  return results;
79687
79666
  }
79688
79667
  async function runE2EEval(scenarios, options) {
79689
- const { runPipeline: runPipeline2 } = await import("./pipeline-IAVVAKTU.js");
79668
+ const { runPipeline: runPipeline2 } = await import("./pipeline-W23TKSVR.js");
79690
79669
  const concurrency = options.parallel || 1;
79691
79670
  let completed = 0;
79692
79671
  if (options.realTools && options.verbose) {
@@ -111627,7 +111606,7 @@ function registerPipelineCommands(program3) {
111627
111606
  await runE2EEval2(opts);
111628
111607
  });
111629
111608
  pipeline.command("run").description("Run pipeline on a single message").requiredOption("--subject <text>", "Message subject").requiredOption("--body <text>", "Message body").option("--app <id>", "App ID", "total-typescript").option("--dry-run", "Don't actually send", true).option("--json", "JSON output").action(async (opts) => {
111630
- const { runPipeline: runPipeline2 } = await import("./pipeline-IAVVAKTU.js");
111609
+ const { runPipeline: runPipeline2 } = await import("./pipeline-W23TKSVR.js");
111631
111610
  const result = await runPipeline2({
111632
111611
  message: {
111633
111612
  subject: opts.subject,