@skillrecordings/cli 0.14.2 → 0.15.0
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/.env.encrypted +0 -0
- package/dist/{chunk-FT5L3SDS.js → chunk-A5RBWKVF.js} +8 -8
- package/dist/chunk-JMAMXCWW.js +192 -0
- package/dist/chunk-JMAMXCWW.js.map +1 -0
- package/dist/{chunk-RA5G6CYF.js → chunk-L6YTBYNV.js} +11 -11
- package/dist/{config-AKU2GEMV.js → config-44V5DJBS.js} +5 -5
- package/dist/crypto-MTXIOCYL.js +23 -0
- package/dist/crypto-MTXIOCYL.js.map +1 -0
- package/dist/index.js +182 -216
- package/dist/index.js.map +1 -1
- package/dist/{pipeline-MJVBAX5W.js → pipeline-FGI6ICWM.js} +4 -4
- package/dist/secrets-MGVPGMFJ.js +14 -0
- package/dist/secrets-MGVPGMFJ.js.map +1 -0
- package/package.json +2 -2
- /package/dist/{chunk-FT5L3SDS.js.map → chunk-A5RBWKVF.js.map} +0 -0
- /package/dist/{chunk-RA5G6CYF.js.map → chunk-L6YTBYNV.js.map} +0 -0
- /package/dist/{config-AKU2GEMV.js.map → config-44V5DJBS.js.map} +0 -0
- /package/dist/{pipeline-MJVBAX5W.js.map → pipeline-FGI6ICWM.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import {
|
|
3
|
-
createFilterStats,
|
|
4
|
-
formatFilterStats,
|
|
5
|
-
shouldFilter,
|
|
6
|
-
updateFilterStats
|
|
7
|
-
} from "./chunk-5ACOI6Z3.js";
|
|
8
|
-
import {
|
|
9
|
-
Blob as Blob2,
|
|
10
|
-
File as File2,
|
|
11
|
-
isFile,
|
|
12
|
-
isFunction
|
|
13
|
-
} from "./chunk-PWWRCN5W.js";
|
|
14
|
-
import {
|
|
15
|
-
SUPPORT_AGENT_PROMPT,
|
|
16
|
-
getApp,
|
|
17
|
-
getOutcomeHistory,
|
|
18
|
-
getRedis
|
|
19
|
-
} from "./chunk-RA5G6CYF.js";
|
|
20
|
-
import "./chunk-F4EM72IH.js";
|
|
21
2
|
import {
|
|
22
3
|
DEFAULT_CATEGORY_TAG_MAPPING,
|
|
23
4
|
FrontApiError,
|
|
@@ -39,15 +20,44 @@ import {
|
|
|
39
20
|
runPipeline,
|
|
40
21
|
validate,
|
|
41
22
|
validateSync
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-KEV3QKXP.js";
|
|
23
|
+
} from "./chunk-A5RBWKVF.js";
|
|
44
24
|
import "./chunk-HK3PEWFD.js";
|
|
25
|
+
import {
|
|
26
|
+
createFilterStats,
|
|
27
|
+
formatFilterStats,
|
|
28
|
+
shouldFilter,
|
|
29
|
+
updateFilterStats
|
|
30
|
+
} from "./chunk-5ACOI6Z3.js";
|
|
31
|
+
import {
|
|
32
|
+
Blob as Blob2,
|
|
33
|
+
File as File2,
|
|
34
|
+
isFile,
|
|
35
|
+
isFunction
|
|
36
|
+
} from "./chunk-PWWRCN5W.js";
|
|
37
|
+
import {
|
|
38
|
+
SUPPORT_AGENT_PROMPT,
|
|
39
|
+
getApp,
|
|
40
|
+
getOutcomeHistory,
|
|
41
|
+
getRedis
|
|
42
|
+
} from "./chunk-L6YTBYNV.js";
|
|
43
|
+
import "./chunk-KEV3QKXP.js";
|
|
44
|
+
import "./chunk-ZNF7XD2S.js";
|
|
45
|
+
import {
|
|
46
|
+
upsertVector
|
|
47
|
+
} from "./chunk-H3D6VCME.js";
|
|
48
|
+
import "./chunk-F4EM72IH.js";
|
|
45
49
|
import "./chunk-WYKL32C3.js";
|
|
46
50
|
import {
|
|
47
51
|
MemoryService,
|
|
48
52
|
VotingService,
|
|
49
53
|
calculateConfidence
|
|
50
54
|
} from "./chunk-MLNDSBZ4.js";
|
|
55
|
+
import "./chunk-MG37YDAK.js";
|
|
56
|
+
import {
|
|
57
|
+
OnePasswordProvider,
|
|
58
|
+
SECRET_REFS,
|
|
59
|
+
createSecretsProvider
|
|
60
|
+
} from "./chunk-JMAMXCWW.js";
|
|
51
61
|
import {
|
|
52
62
|
ActionsTable,
|
|
53
63
|
AppsTable,
|
|
@@ -62,11 +72,6 @@ import {
|
|
|
62
72
|
or,
|
|
63
73
|
sql
|
|
64
74
|
} from "./chunk-V34YUISF.js";
|
|
65
|
-
import "./chunk-ZNF7XD2S.js";
|
|
66
|
-
import {
|
|
67
|
-
upsertVector
|
|
68
|
-
} from "./chunk-H3D6VCME.js";
|
|
69
|
-
import "./chunk-MG37YDAK.js";
|
|
70
75
|
import {
|
|
71
76
|
__commonJS,
|
|
72
77
|
__dirname,
|
|
@@ -1474,9 +1479,9 @@ var require_url_state_machine = __commonJS({
|
|
|
1474
1479
|
url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
|
|
1475
1480
|
}
|
|
1476
1481
|
};
|
|
1477
|
-
module.exports.setThePassword = function(url,
|
|
1482
|
+
module.exports.setThePassword = function(url, password2) {
|
|
1478
1483
|
url.password = "";
|
|
1479
|
-
const decoded = punycode.ucs2.decode(
|
|
1484
|
+
const decoded = punycode.ucs2.decode(password2);
|
|
1480
1485
|
for (let i = 0; i < decoded.length; ++i) {
|
|
1481
1486
|
url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
|
|
1482
1487
|
}
|
|
@@ -16731,7 +16736,7 @@ var require_proxy_agent = __commonJS({
|
|
|
16731
16736
|
const { proxyTunnel = true } = opts;
|
|
16732
16737
|
super();
|
|
16733
16738
|
const url = this.#getUrl(opts);
|
|
16734
|
-
const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url;
|
|
16739
|
+
const { href, origin, port, protocol, username, password: password2, hostname: proxyHostname } = url;
|
|
16735
16740
|
this[kProxy] = { uri: href, protocol };
|
|
16736
16741
|
this[kRequestTls] = opts.requestTls;
|
|
16737
16742
|
this[kProxyTls] = opts.proxyTls;
|
|
@@ -16743,8 +16748,8 @@ var require_proxy_agent = __commonJS({
|
|
|
16743
16748
|
this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`;
|
|
16744
16749
|
} else if (opts.token) {
|
|
16745
16750
|
this[kProxyHeaders]["proxy-authorization"] = opts.token;
|
|
16746
|
-
} else if (username &&
|
|
16747
|
-
this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(
|
|
16751
|
+
} else if (username && password2) {
|
|
16752
|
+
this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password2)}`).toString("base64")}`;
|
|
16748
16753
|
}
|
|
16749
16754
|
const connect = buildConnector({ ...opts.proxyTls });
|
|
16750
16755
|
this[kConnectEndpoint] = buildConnector({ ...opts.requestTls });
|
|
@@ -26401,8 +26406,8 @@ var require_fetch = __commonJS({
|
|
|
26401
26406
|
let authorizationValue = null;
|
|
26402
26407
|
if (hasAuthenticationEntry(httpRequest) && (httpRequest.useURLCredentials === void 0 || !includesCredentials(requestCurrentURL(httpRequest)))) {
|
|
26403
26408
|
} else if (includesCredentials(requestCurrentURL(httpRequest)) && isAuthenticationFetch) {
|
|
26404
|
-
const { username, password } = requestCurrentURL(httpRequest);
|
|
26405
|
-
authorizationValue = `Basic ${Buffer.from(`${username}:${
|
|
26409
|
+
const { username, password: password2 } = requestCurrentURL(httpRequest);
|
|
26410
|
+
authorizationValue = `Basic ${Buffer.from(`${username}:${password2}`).toString("base64")}`;
|
|
26406
26411
|
}
|
|
26407
26412
|
if (authorizationValue !== null) {
|
|
26408
26413
|
httpRequest.headersList.append("Authorization", authorizationValue, false);
|
|
@@ -74567,6 +74572,29 @@ async function copy(src, dest) {
|
|
|
74567
74572
|
await cp(src, dest, { recursive: true, force: true });
|
|
74568
74573
|
}
|
|
74569
74574
|
|
|
74575
|
+
// src/core/user-config.ts
|
|
74576
|
+
var USER_CONFIG_DIR_NAME = "skill";
|
|
74577
|
+
var USER_CONFIG_PATHS = {
|
|
74578
|
+
/** Age encryption private key file */
|
|
74579
|
+
ageKey: "age.key",
|
|
74580
|
+
/** Encrypted environment variables file */
|
|
74581
|
+
envEncrypted: ".env.user.encrypted",
|
|
74582
|
+
/** Optional plaintext config file */
|
|
74583
|
+
configJson: "config.json"
|
|
74584
|
+
};
|
|
74585
|
+
function getUserConfigDir(configDir) {
|
|
74586
|
+
if (configDir) return configDir;
|
|
74587
|
+
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
|
|
74588
|
+
if (xdgConfigHome && xdgConfigHome.trim() !== "") {
|
|
74589
|
+
return join(xdgConfigHome, USER_CONFIG_DIR_NAME);
|
|
74590
|
+
}
|
|
74591
|
+
const home = homedir() || process.env.HOME || "/tmp";
|
|
74592
|
+
return join(home, ".config", USER_CONFIG_DIR_NAME);
|
|
74593
|
+
}
|
|
74594
|
+
function getUserConfigPath(fileName, configDir) {
|
|
74595
|
+
return join(getUserConfigDir(configDir), fileName);
|
|
74596
|
+
}
|
|
74597
|
+
|
|
74570
74598
|
// src/core/config-loader.ts
|
|
74571
74599
|
function parseEnvContent(content) {
|
|
74572
74600
|
const env = {};
|
|
@@ -74582,7 +74610,85 @@ function parseEnvContent(content) {
|
|
|
74582
74610
|
}
|
|
74583
74611
|
return env;
|
|
74584
74612
|
}
|
|
74613
|
+
async function decryptEnvFile(encryptedPath) {
|
|
74614
|
+
const { existsSync: existsSync15 } = await import("fs");
|
|
74615
|
+
const { readFile: readFile10 } = await import("fs/promises");
|
|
74616
|
+
if (!existsSync15(encryptedPath)) {
|
|
74617
|
+
return {};
|
|
74618
|
+
}
|
|
74619
|
+
const ageKey = await getAgeKeyFrom1Password();
|
|
74620
|
+
if (!ageKey) {
|
|
74621
|
+
return {};
|
|
74622
|
+
}
|
|
74623
|
+
try {
|
|
74624
|
+
const { decrypt } = await import("./crypto-MTXIOCYL.js");
|
|
74625
|
+
const encrypted = await readFile10(encryptedPath);
|
|
74626
|
+
const decrypted = await decrypt(encrypted, ageKey);
|
|
74627
|
+
return parseEnvContent(decrypted);
|
|
74628
|
+
} catch {
|
|
74629
|
+
return {};
|
|
74630
|
+
}
|
|
74631
|
+
}
|
|
74632
|
+
async function getAgeKeyFrom1Password() {
|
|
74633
|
+
if (!process.env.OP_SERVICE_ACCOUNT_TOKEN) {
|
|
74634
|
+
return null;
|
|
74635
|
+
}
|
|
74636
|
+
try {
|
|
74637
|
+
const { OnePasswordProvider: OnePasswordProvider2 } = await import("./secrets-MGVPGMFJ.js");
|
|
74638
|
+
const op = new OnePasswordProvider2();
|
|
74639
|
+
if (!await op.isAvailable()) {
|
|
74640
|
+
return null;
|
|
74641
|
+
}
|
|
74642
|
+
return await op.resolve("op://Support/skill-cli-age-key/private_key");
|
|
74643
|
+
} catch {
|
|
74644
|
+
return null;
|
|
74645
|
+
}
|
|
74646
|
+
}
|
|
74647
|
+
async function loadShippedDefaults(cliRoot2) {
|
|
74648
|
+
const encryptedPath = resolve(cliRoot2, ".env.encrypted");
|
|
74649
|
+
try {
|
|
74650
|
+
return await decryptEnvFile(encryptedPath);
|
|
74651
|
+
} catch {
|
|
74652
|
+
return {};
|
|
74653
|
+
}
|
|
74654
|
+
}
|
|
74655
|
+
async function loadUserOverrides(configDir) {
|
|
74656
|
+
const encryptedPath = getUserConfigPath(
|
|
74657
|
+
USER_CONFIG_PATHS.envEncrypted,
|
|
74658
|
+
configDir
|
|
74659
|
+
);
|
|
74660
|
+
try {
|
|
74661
|
+
return await decryptEnvFile(encryptedPath);
|
|
74662
|
+
} catch {
|
|
74663
|
+
return {};
|
|
74664
|
+
}
|
|
74665
|
+
}
|
|
74666
|
+
async function loadConfigChain(cliRoot2, configDir) {
|
|
74667
|
+
const root2 = cliRoot2 ?? resolve(import.meta.dirname, "../..");
|
|
74668
|
+
const shipped = await loadShippedDefaults(root2);
|
|
74669
|
+
const user = await loadUserOverrides(configDir);
|
|
74670
|
+
const env = {};
|
|
74671
|
+
const provenance = /* @__PURE__ */ new Map();
|
|
74672
|
+
for (const [key, value] of Object.entries(shipped)) {
|
|
74673
|
+
env[key] = value;
|
|
74674
|
+
provenance.set(key, "shipped");
|
|
74675
|
+
}
|
|
74676
|
+
for (const [key, value] of Object.entries(user)) {
|
|
74677
|
+
env[key] = value;
|
|
74678
|
+
provenance.set(key, "user");
|
|
74679
|
+
}
|
|
74680
|
+
return { env, provenance };
|
|
74681
|
+
}
|
|
74585
74682
|
var globalProvenance = /* @__PURE__ */ new Map();
|
|
74683
|
+
async function initConfig(cliRoot2, configDir) {
|
|
74684
|
+
const result = await loadConfigChain(cliRoot2, configDir);
|
|
74685
|
+
globalProvenance = result.provenance;
|
|
74686
|
+
for (const [key, value] of Object.entries(result.env)) {
|
|
74687
|
+
if (!process.env[key]) {
|
|
74688
|
+
process.env[key] = value;
|
|
74689
|
+
}
|
|
74690
|
+
}
|
|
74691
|
+
}
|
|
74586
74692
|
function getKeyProvenance(key) {
|
|
74587
74693
|
return globalProvenance.get(key);
|
|
74588
74694
|
}
|
|
@@ -74857,172 +74963,6 @@ var TableFormatter = class extends BaseFormatter {
|
|
|
74857
74963
|
}
|
|
74858
74964
|
};
|
|
74859
74965
|
|
|
74860
|
-
// src/core/secrets.ts
|
|
74861
|
-
init_esm_shims();
|
|
74862
|
-
|
|
74863
|
-
// src/core/secret-refs.ts
|
|
74864
|
-
init_esm_shims();
|
|
74865
|
-
var SECRET_REFS = {
|
|
74866
|
-
DATABASE_URL: "op://Support/skill-cli/DATABASE_URL",
|
|
74867
|
-
FRONT_API_TOKEN: "op://Support/skill-cli/FRONT_API_TOKEN",
|
|
74868
|
-
FRONT_WEBHOOK_SECRET: "op://Support/skill-cli/FRONT_WEBHOOK_SECRET",
|
|
74869
|
-
SUPPORT_WEBHOOK_SECRET: "op://Support/skill-cli/SUPPORT_WEBHOOK_SECRET",
|
|
74870
|
-
INNGEST_SIGNING_KEY: "op://Support/skill-cli/INNGEST_SIGNING_KEY",
|
|
74871
|
-
INNGEST_EVENT_KEY: "op://Support/skill-cli/INNGEST_EVENT_KEY",
|
|
74872
|
-
SLACK_BOT_TOKEN: "op://Support/skill-cli/SLACK_BOT_TOKEN",
|
|
74873
|
-
SLACK_SIGNING_SECRET: "op://Support/skill-cli/SLACK_SIGNING_SECRET",
|
|
74874
|
-
SLACK_APPROVAL_CHANNEL: "op://Support/skill-cli/SLACK_APPROVAL_CHANNEL",
|
|
74875
|
-
UPSTASH_REDIS_REST_URL: "op://Support/skill-cli/UPSTASH_REDIS_REST_URL",
|
|
74876
|
-
UPSTASH_REDIS_REST_TOKEN: "op://Support/skill-cli/UPSTASH_REDIS_REST_TOKEN",
|
|
74877
|
-
UPSTASH_VECTOR_REST_URL: "op://Support/skill-cli/UPSTASH_VECTOR_REST_URL",
|
|
74878
|
-
UPSTASH_VECTOR_REST_TOKEN: "op://Support/skill-cli/UPSTASH_VECTOR_REST_TOKEN",
|
|
74879
|
-
STRIPE_SECRET_KEY: "op://Support/skill-cli/STRIPE_SECRET_KEY",
|
|
74880
|
-
STRIPE_CONNECT_CLIENT_ID: "op://Support/skill-cli/STRIPE_CONNECT_CLIENT_ID",
|
|
74881
|
-
STRIPE_WEBHOOK_SECRET: "op://Support/skill-cli/STRIPE_WEBHOOK_SECRET",
|
|
74882
|
-
AXIOM_TOKEN: "op://Support/skill-cli/AXIOM_TOKEN",
|
|
74883
|
-
LANGFUSE_PUBLIC_KEY: "op://Support/skill-cli/LANGFUSE_PUBLIC_KEY",
|
|
74884
|
-
LANGFUSE_SECRET_KEY: "op://Support/skill-cli/LANGFUSE_SECRET_KEY",
|
|
74885
|
-
BETTERAUTH_SECRET: "op://Support/skill-cli/BETTERAUTH_SECRET",
|
|
74886
|
-
MYSQL_HOST: "op://Support/skill-cli/MYSQL_HOST",
|
|
74887
|
-
MYSQL_PORT: "op://Support/skill-cli/MYSQL_PORT",
|
|
74888
|
-
MYSQL_USER: "op://Support/skill-cli/MYSQL_USER",
|
|
74889
|
-
MYSQL_PASSWORD: "op://Support/skill-cli/MYSQL_PASSWORD",
|
|
74890
|
-
MYSQL_DATABASE: "op://Support/skill-cli/MYSQL_DATABASE",
|
|
74891
|
-
QDRANT_URL: "op://Support/skill-cli/QDRANT_URL",
|
|
74892
|
-
QDRANT_COLLECTION: "op://Support/skill-cli/QDRANT_COLLECTION",
|
|
74893
|
-
OLLAMA_BASE_URL: "op://Support/skill-cli/OLLAMA_BASE_URL",
|
|
74894
|
-
EMBEDDING_MODEL: "op://Support/skill-cli/EMBEDDING_MODEL",
|
|
74895
|
-
AGE_SECRET_KEY: "op://Support/skill-cli-age-key/private_key"
|
|
74896
|
-
};
|
|
74897
|
-
|
|
74898
|
-
// src/core/secrets.ts
|
|
74899
|
-
var REF_TO_ENV_KEY = new Map(
|
|
74900
|
-
Object.entries(SECRET_REFS).map(([envKey, ref]) => [ref, envKey])
|
|
74901
|
-
);
|
|
74902
|
-
var OnePasswordProvider = class {
|
|
74903
|
-
name = "1password";
|
|
74904
|
-
cache = /* @__PURE__ */ new Map();
|
|
74905
|
-
clientPromise;
|
|
74906
|
-
sdkPromise;
|
|
74907
|
-
integrationName;
|
|
74908
|
-
integrationVersion;
|
|
74909
|
-
constructor(options = {}) {
|
|
74910
|
-
this.integrationName = options.integrationName ?? "skill-cli";
|
|
74911
|
-
this.integrationVersion = options.integrationVersion ?? "0.0.0";
|
|
74912
|
-
}
|
|
74913
|
-
async isAvailable() {
|
|
74914
|
-
if (!process.env.OP_SERVICE_ACCOUNT_TOKEN) {
|
|
74915
|
-
return false;
|
|
74916
|
-
}
|
|
74917
|
-
try {
|
|
74918
|
-
await this.getClient();
|
|
74919
|
-
return true;
|
|
74920
|
-
} catch {
|
|
74921
|
-
return false;
|
|
74922
|
-
}
|
|
74923
|
-
}
|
|
74924
|
-
async resolve(ref) {
|
|
74925
|
-
if (this.cache.has(ref)) {
|
|
74926
|
-
return this.cache.get(ref);
|
|
74927
|
-
}
|
|
74928
|
-
const client = await this.getClient();
|
|
74929
|
-
const secretsClient = client.secrets;
|
|
74930
|
-
const value = await secretsClient.resolve(ref);
|
|
74931
|
-
if (!value) {
|
|
74932
|
-
throw new Error(`1Password returned empty secret for ${ref}`);
|
|
74933
|
-
}
|
|
74934
|
-
this.cache.set(ref, value);
|
|
74935
|
-
return value;
|
|
74936
|
-
}
|
|
74937
|
-
async resolveAll(refs) {
|
|
74938
|
-
if (refs.length === 0) {
|
|
74939
|
-
return {};
|
|
74940
|
-
}
|
|
74941
|
-
const client = await this.getClient();
|
|
74942
|
-
const secrets = await this.resolveAllWithClient(client, refs);
|
|
74943
|
-
for (const [ref, value] of Object.entries(secrets)) {
|
|
74944
|
-
this.cache.set(ref, value);
|
|
74945
|
-
}
|
|
74946
|
-
return secrets;
|
|
74947
|
-
}
|
|
74948
|
-
async getClient() {
|
|
74949
|
-
if (this.clientPromise) {
|
|
74950
|
-
return this.clientPromise;
|
|
74951
|
-
}
|
|
74952
|
-
const token = process.env.OP_SERVICE_ACCOUNT_TOKEN;
|
|
74953
|
-
if (!token) {
|
|
74954
|
-
throw new Error("OP_SERVICE_ACCOUNT_TOKEN not set");
|
|
74955
|
-
}
|
|
74956
|
-
const { createClient } = await this.getSdk();
|
|
74957
|
-
this.clientPromise = createClient({
|
|
74958
|
-
auth: token,
|
|
74959
|
-
integrationName: this.integrationName,
|
|
74960
|
-
integrationVersion: this.integrationVersion
|
|
74961
|
-
});
|
|
74962
|
-
return this.clientPromise;
|
|
74963
|
-
}
|
|
74964
|
-
async getSdk() {
|
|
74965
|
-
if (this.sdkPromise) {
|
|
74966
|
-
return this.sdkPromise;
|
|
74967
|
-
}
|
|
74968
|
-
this.sdkPromise = import("@1password/sdk");
|
|
74969
|
-
return this.sdkPromise;
|
|
74970
|
-
}
|
|
74971
|
-
async resolveAllWithClient(client, refs) {
|
|
74972
|
-
const secretsClient = client.secrets;
|
|
74973
|
-
if (typeof secretsClient.resolveAll === "function") {
|
|
74974
|
-
const resolved = await secretsClient.resolveAll(refs);
|
|
74975
|
-
if (Array.isArray(resolved)) {
|
|
74976
|
-
const entries2 = resolved.map((item) => {
|
|
74977
|
-
if (item && typeof item === "object" && "reference" in item && "value" in item) {
|
|
74978
|
-
return [
|
|
74979
|
-
item.reference,
|
|
74980
|
-
String(item.value)
|
|
74981
|
-
];
|
|
74982
|
-
}
|
|
74983
|
-
return null;
|
|
74984
|
-
}).filter((entry) => Boolean(entry));
|
|
74985
|
-
return Object.fromEntries(entries2);
|
|
74986
|
-
}
|
|
74987
|
-
return resolved;
|
|
74988
|
-
}
|
|
74989
|
-
const entries = await Promise.all(
|
|
74990
|
-
refs.map(async (ref) => [ref, await this.resolve(ref)])
|
|
74991
|
-
);
|
|
74992
|
-
return Object.fromEntries(entries);
|
|
74993
|
-
}
|
|
74994
|
-
};
|
|
74995
|
-
var EnvProvider = class {
|
|
74996
|
-
name = "env";
|
|
74997
|
-
async isAvailable() {
|
|
74998
|
-
return true;
|
|
74999
|
-
}
|
|
75000
|
-
async resolve(ref) {
|
|
75001
|
-
const envKey = REF_TO_ENV_KEY.get(ref);
|
|
75002
|
-
if (!envKey) {
|
|
75003
|
-
throw new Error(`No env mapping found for secret ref: ${ref}`);
|
|
75004
|
-
}
|
|
75005
|
-
const value = process.env[envKey];
|
|
75006
|
-
if (!value) {
|
|
75007
|
-
throw new Error(`Missing environment secret for ${envKey}`);
|
|
75008
|
-
}
|
|
75009
|
-
return value;
|
|
75010
|
-
}
|
|
75011
|
-
async resolveAll(refs) {
|
|
75012
|
-
const entries = await Promise.all(
|
|
75013
|
-
refs.map(async (ref) => [ref, await this.resolve(ref)])
|
|
75014
|
-
);
|
|
75015
|
-
return Object.fromEntries(entries);
|
|
75016
|
-
}
|
|
75017
|
-
};
|
|
75018
|
-
async function createSecretsProvider() {
|
|
75019
|
-
const onePassword = new OnePasswordProvider();
|
|
75020
|
-
if (await onePassword.isAvailable()) {
|
|
75021
|
-
return onePassword;
|
|
75022
|
-
}
|
|
75023
|
-
return new EnvProvider();
|
|
75024
|
-
}
|
|
75025
|
-
|
|
75026
74966
|
// src/core/context.ts
|
|
75027
74967
|
async function createContext(overrides = {}) {
|
|
75028
74968
|
const signal = overrides.signal ?? new AbortController().signal;
|
|
@@ -77088,16 +77028,16 @@ import { existsSync as existsSync3, mkdirSync, writeFileSync as writeFileSync3 }
|
|
|
77088
77028
|
import { homedir as homedir2 } from "os";
|
|
77089
77029
|
import { join as join2 } from "path";
|
|
77090
77030
|
import { generateIdentity, identityToRecipient } from "age-encryption";
|
|
77091
|
-
function
|
|
77031
|
+
function getUserConfigDir2() {
|
|
77092
77032
|
return join2(homedir2(), ".config", "skill");
|
|
77093
77033
|
}
|
|
77094
77034
|
function getAgeKeyPath() {
|
|
77095
|
-
return join2(
|
|
77035
|
+
return join2(getUserConfigDir2(), "age.key");
|
|
77096
77036
|
}
|
|
77097
77037
|
async function configInitAction(ctx, options = {}) {
|
|
77098
77038
|
const outputJson = options.json === true || ctx.format === "json";
|
|
77099
77039
|
const keyPath = getAgeKeyPath();
|
|
77100
|
-
const configDir =
|
|
77040
|
+
const configDir = getUserConfigDir2();
|
|
77101
77041
|
if (existsSync3(keyPath) && !options.force) {
|
|
77102
77042
|
const result = {
|
|
77103
77043
|
success: false,
|
|
@@ -77156,9 +77096,10 @@ Private key saved to: ${keyPath}`);
|
|
|
77156
77096
|
// src/commands/config/set.ts
|
|
77157
77097
|
init_esm_shims();
|
|
77158
77098
|
import { existsSync as existsSync4, readFileSync as readFileSync2, writeFileSync as writeFileSync4 } from "fs";
|
|
77099
|
+
import { password, select as select2 } from "@inquirer/prompts";
|
|
77159
77100
|
import { Decrypter, Encrypter, identityToRecipient as identityToRecipient2 } from "age-encryption";
|
|
77160
77101
|
function getEncryptedConfigPath() {
|
|
77161
|
-
return `${
|
|
77102
|
+
return `${getUserConfigDir2()}/.env.user.encrypted`;
|
|
77162
77103
|
}
|
|
77163
77104
|
function parseKeyValue(input2) {
|
|
77164
77105
|
const match = input2.match(/^([A-Z_][A-Z0-9_]*)=(.*)$/);
|
|
@@ -77209,7 +77150,29 @@ async function configSetAction(ctx, keyValue, options = {}) {
|
|
|
77209
77150
|
process.exitCode = EXIT_CODES.usage;
|
|
77210
77151
|
return;
|
|
77211
77152
|
}
|
|
77212
|
-
|
|
77153
|
+
let finalKeyValue = keyValue;
|
|
77154
|
+
if (!finalKeyValue && process.stdin.isTTY && !outputJson) {
|
|
77155
|
+
try {
|
|
77156
|
+
const selectedKey = await select2({
|
|
77157
|
+
message: "Select a secret key to set:",
|
|
77158
|
+
choices: Object.keys(SECRET_REFS).map((key) => ({
|
|
77159
|
+
name: key,
|
|
77160
|
+
value: key
|
|
77161
|
+
}))
|
|
77162
|
+
});
|
|
77163
|
+
const secretValue = await password({
|
|
77164
|
+
message: `Enter value for ${selectedKey}:`
|
|
77165
|
+
});
|
|
77166
|
+
finalKeyValue = `${selectedKey}=${secretValue}`;
|
|
77167
|
+
} catch (error) {
|
|
77168
|
+
if (error instanceof Error && (error.message.includes("User force closed") || error.message.includes("canceled"))) {
|
|
77169
|
+
ctx.output.data("Cancelled");
|
|
77170
|
+
return;
|
|
77171
|
+
}
|
|
77172
|
+
throw error;
|
|
77173
|
+
}
|
|
77174
|
+
}
|
|
77175
|
+
const parsed = parseKeyValue(finalKeyValue || "");
|
|
77213
77176
|
if (!parsed) {
|
|
77214
77177
|
const result = {
|
|
77215
77178
|
success: false,
|
|
@@ -77465,7 +77428,9 @@ function registerConfigCommands(program3) {
|
|
|
77465
77428
|
const ctx = await buildContext2(command, options.json);
|
|
77466
77429
|
await configInitAction(ctx, options);
|
|
77467
77430
|
});
|
|
77468
|
-
config.command("set
|
|
77431
|
+
config.command("set [key-value]").description(
|
|
77432
|
+
"Set encrypted config value (format: KEY=value or interactive)"
|
|
77433
|
+
).option("--json", "Output as JSON").action(async (keyValue, options, command) => {
|
|
77469
77434
|
const ctx = await buildContext2(command, options.json);
|
|
77470
77435
|
await configSetAction(ctx, keyValue, options);
|
|
77471
77436
|
});
|
|
@@ -81270,7 +81235,7 @@ async function runValidateEval(ctx, scenarios, options) {
|
|
|
81270
81235
|
return results;
|
|
81271
81236
|
}
|
|
81272
81237
|
async function runE2EEval(ctx, scenarios, options) {
|
|
81273
|
-
const { runPipeline: runPipeline2 } = await import("./pipeline-
|
|
81238
|
+
const { runPipeline: runPipeline2 } = await import("./pipeline-FGI6ICWM.js");
|
|
81274
81239
|
const concurrency = options.parallel || 1;
|
|
81275
81240
|
let completed = 0;
|
|
81276
81241
|
const outputJson = options.outputJson ?? false;
|
|
@@ -92664,7 +92629,7 @@ import { spawnSync } from "child_process";
|
|
|
92664
92629
|
import { existsSync as existsSync14, readFileSync as readFileSync10, unlinkSync, writeFileSync as writeFileSync10 } from "fs";
|
|
92665
92630
|
import { tmpdir } from "os";
|
|
92666
92631
|
import { join as join12 } from "path";
|
|
92667
|
-
import { confirm as confirm2, select as
|
|
92632
|
+
import { confirm as confirm2, select as select3 } from "@inquirer/prompts";
|
|
92668
92633
|
var COLORS2 = {
|
|
92669
92634
|
reset: "\x1B[0m",
|
|
92670
92635
|
green: "\x1B[32m",
|
|
@@ -92798,7 +92763,7 @@ ${COLORS2.bold}\u{1F4CB} FAQ Review Session${COLORS2.reset}`);
|
|
|
92798
92763
|
for (let i = 0; i < candidates.length; i++) {
|
|
92799
92764
|
const candidate = candidates[i];
|
|
92800
92765
|
displayCandidate(ctx, candidate, i, candidates.length);
|
|
92801
|
-
const action = await
|
|
92766
|
+
const action = await select3({
|
|
92802
92767
|
message: "Action:",
|
|
92803
92768
|
choices: [
|
|
92804
92769
|
{
|
|
@@ -103276,7 +103241,7 @@ var compile3 = wrapCompile(compile2);
|
|
|
103276
103241
|
var _compileUnsafe = wrapCompile(compileUnsafe);
|
|
103277
103242
|
var _compileToken = wrapCompile(compileToken);
|
|
103278
103243
|
function getSelectorFunc(searchFunc) {
|
|
103279
|
-
return function
|
|
103244
|
+
return function select6(query, elements, options) {
|
|
103280
103245
|
const opts = convertOptionFormats(options);
|
|
103281
103246
|
if (typeof query !== "function") {
|
|
103282
103247
|
query = compileUnsafe(query, opts, elements);
|
|
@@ -103463,7 +103428,7 @@ function filterBySelector(selector, elements, options) {
|
|
|
103463
103428
|
}
|
|
103464
103429
|
return findFilterElements(elements, selector, options, false, elements.length);
|
|
103465
103430
|
}
|
|
103466
|
-
function
|
|
103431
|
+
function select4(selector, root2, options = {}, limit2 = Infinity) {
|
|
103467
103432
|
if (typeof selector === "function") {
|
|
103468
103433
|
return find3(root2, selector);
|
|
103469
103434
|
}
|
|
@@ -103568,7 +103533,7 @@ function _findBySelector(selector, limit2) {
|
|
|
103568
103533
|
pseudos: this.options.pseudos,
|
|
103569
103534
|
quirksMode: this.options.quirksMode
|
|
103570
103535
|
};
|
|
103571
|
-
return this._make(
|
|
103536
|
+
return this._make(select4(selector, elems, options, limit2));
|
|
103572
103537
|
}
|
|
103573
103538
|
function _getMatcher(matchMap) {
|
|
103574
103539
|
return function(fn, ...postFns) {
|
|
@@ -117427,7 +117392,7 @@ var handlePipelineError = (ctx, error, message, suggestion = "Verify inputs and
|
|
|
117427
117392
|
async function runPipelineCommand(ctx, opts) {
|
|
117428
117393
|
const outputJson = opts.json === true || ctx.format === "json";
|
|
117429
117394
|
try {
|
|
117430
|
-
const { runPipeline: runPipeline2 } = await import("./pipeline-
|
|
117395
|
+
const { runPipeline: runPipeline2 } = await import("./pipeline-FGI6ICWM.js");
|
|
117431
117396
|
const result = await runPipeline2({
|
|
117432
117397
|
message: {
|
|
117433
117398
|
subject: opts.subject,
|
|
@@ -119065,7 +119030,7 @@ var DEFAULT_HINT_RULES = [
|
|
|
119065
119030
|
{
|
|
119066
119031
|
id: "onboarding.auth",
|
|
119067
119032
|
audience: "onboarding",
|
|
119068
|
-
message: "
|
|
119033
|
+
message: "Set up credentials with `skill auth setup` (requires 1Password).",
|
|
119069
119034
|
showWhen: (state) => state.totalRuns >= 1 && !hasMilestone(state, "auth_configured"),
|
|
119070
119035
|
retireWhen: (state) => hasMilestone(state, "auth_configured")
|
|
119071
119036
|
},
|
|
@@ -119890,6 +119855,7 @@ function createMcpServer(options = {}) {
|
|
|
119890
119855
|
|
|
119891
119856
|
// src/index.ts
|
|
119892
119857
|
var cliRoot = resolve8(import.meta.dirname, "..");
|
|
119858
|
+
await initConfig(cliRoot);
|
|
119893
119859
|
var plaintextEnv = loadPlaintextEnv(cliRoot);
|
|
119894
119860
|
var envLoaded = false;
|
|
119895
119861
|
for (const [key, value] of Object.entries(plaintextEnv)) {
|
|
@@ -119902,8 +119868,8 @@ if (!envLoaded && !process.env.DATABASE_URL) {
|
|
|
119902
119868
|
process.env.SKIP_ENV_VALIDATION = "1";
|
|
119903
119869
|
}
|
|
119904
119870
|
var runtimeTarget = `bun-${process.platform}-${process.arch}`;
|
|
119905
|
-
var buildVersion = "0.
|
|
119906
|
-
var buildCommit = "
|
|
119871
|
+
var buildVersion = "0.15.0".length > 0 ? "0.15.0" : "0.0.0-dev";
|
|
119872
|
+
var buildCommit = "73ba4fa".length > 0 ? "73ba4fa" : "dev";
|
|
119907
119873
|
var buildTarget = "node".length > 0 ? "node" : runtimeTarget;
|
|
119908
119874
|
var isDevBuild = buildVersion.includes("dev") || buildCommit === "dev";
|
|
119909
119875
|
var versionLabel = `skill v${buildVersion} (${buildCommit}) ${buildTarget}`;
|
|
@@ -119948,7 +119914,7 @@ var resolveMilestones = (commandName) => {
|
|
|
119948
119914
|
case "wizard":
|
|
119949
119915
|
return ["wizard_completed"];
|
|
119950
119916
|
case "auth.setup":
|
|
119951
|
-
case "init":
|
|
119917
|
+
case "config.init":
|
|
119952
119918
|
return ["auth_configured"];
|
|
119953
119919
|
default:
|
|
119954
119920
|
return [];
|