@hasna/instructions 0.4.42 → 0.4.43
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/cli/apply-unchanged-snapshot-bloat.test.d.ts +2 -0
- package/dist/cli/apply-unchanged-snapshot-bloat.test.d.ts.map +1 -0
- package/dist/cli/index.js +32 -13
- package/dist/generated/storage-kit/backend.d.ts +0 -1
- package/dist/generated/storage-kit/backend.d.ts.map +1 -1
- package/dist/generated/storage-kit/index.d.ts +1 -1
- package/dist/generated/storage-kit/query.d.ts +1 -1
- package/dist/generated/storage-kit/query.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/lib/apply.d.ts.map +1 -1
- package/dist/lib/sync-dir.d.ts.map +1 -1
- package/dist/lib/sync.d.ts.map +1 -1
- package/dist/mcp/early-args.test.d.ts +2 -0
- package/dist/mcp/early-args.test.d.ts.map +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +125 -76
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/server/cloud.d.ts.map +1 -1
- package/dist/server/index.js +22 -3
- package/dist/status.d.ts.map +1 -1
- package/dist/storage/cloud-store.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-unchanged-snapshot-bloat.test.d.ts","sourceRoot":"","sources":["../../src/cli/apply-unchanged-snapshot-bloat.test.ts"],"names":[],"mappings":""}
|
package/dist/cli/index.js
CHANGED
|
@@ -14282,7 +14282,7 @@ async function applyPreparedConfig(config, opts) {
|
|
|
14282
14282
|
changed: outputResults.some((output) => output.changed)
|
|
14283
14283
|
};
|
|
14284
14284
|
}
|
|
14285
|
-
if (!opts.dryRun) {
|
|
14285
|
+
if (!opts.dryRun && result.changed) {
|
|
14286
14286
|
await store.updateConfig(config.id, { synced_at: new Date().toISOString() });
|
|
14287
14287
|
}
|
|
14288
14288
|
return result;
|
|
@@ -14563,14 +14563,15 @@ async function syncFromDir(dir, opts = {}) {
|
|
|
14563
14563
|
continue;
|
|
14564
14564
|
}
|
|
14565
14565
|
const targetPath = file.replace(home, "~");
|
|
14566
|
+
const redacted = redactContent(content, redactFormatForTarget(targetPath, detectFormat(file)));
|
|
14566
14567
|
const existing = allConfigs.find((c) => c.target_path === targetPath);
|
|
14567
14568
|
if (!existing) {
|
|
14568
14569
|
if (!opts.dryRun)
|
|
14569
|
-
await store.createConfig({ name: relative4(absDir, file), category: detectCategory(file), agent: detectAgent(file), target_path: targetPath, format: detectFormat(file), content });
|
|
14570
|
+
await store.createConfig({ name: relative4(absDir, file), category: detectCategory(file), agent: detectAgent(file), target_path: targetPath, format: detectFormat(file), content: redacted.content });
|
|
14570
14571
|
result.added++;
|
|
14571
|
-
} else if (existing.content !== content) {
|
|
14572
|
+
} else if (existing.content !== redacted.content) {
|
|
14572
14573
|
if (!opts.dryRun)
|
|
14573
|
-
await store.updateConfig(existing.id, { content });
|
|
14574
|
+
await store.updateConfig(existing.id, { content: redacted.content });
|
|
14574
14575
|
result.updated++;
|
|
14575
14576
|
} else {
|
|
14576
14577
|
result.unchanged++;
|
|
@@ -14622,6 +14623,7 @@ var init_sync_dir = __esm(() => {
|
|
|
14622
14623
|
init_config_store();
|
|
14623
14624
|
init_apply();
|
|
14624
14625
|
init_sync();
|
|
14626
|
+
init_redact();
|
|
14625
14627
|
SKIP = [".db", ".db-shm", ".db-wal", ".log", ".lock", ".DS_Store", "node_modules", ".git"];
|
|
14626
14628
|
});
|
|
14627
14629
|
|
|
@@ -14843,7 +14845,7 @@ async function syncKnown(opts = {}) {
|
|
|
14843
14845
|
continue;
|
|
14844
14846
|
}
|
|
14845
14847
|
const fmt = known.format ?? detectFormat(abs);
|
|
14846
|
-
const redacted = redactContent(rawContent, fmt);
|
|
14848
|
+
const redacted = redactContent(rawContent, redactFormatForTarget(abs, fmt));
|
|
14847
14849
|
const machineAware = templateizeMachineContent(redacted.content, machine);
|
|
14848
14850
|
const content = machineAware.content;
|
|
14849
14851
|
const isTemplate2 = redacted.isTemplate || machineAware.changed;
|
|
@@ -18664,7 +18666,7 @@ async function getConfigsStatus(store = resolveConfigStore(), options = {}) {
|
|
|
18664
18666
|
let unredactedSecretFindings = 0;
|
|
18665
18667
|
let knownTargets = 0;
|
|
18666
18668
|
for (const config of fileConfigs) {
|
|
18667
|
-
unredactedSecretFindings += scanSecrets(config.content, config.format).length;
|
|
18669
|
+
unredactedSecretFindings += scanSecrets(config.content, redactFormatForTarget(config.target_path ?? "", config.format)).length;
|
|
18668
18670
|
if (isRetiredOrUnsupportedConfigAgent(config.agent))
|
|
18669
18671
|
continue;
|
|
18670
18672
|
if (!config.target_path)
|
|
@@ -18676,7 +18678,7 @@ async function getConfigsStatus(store = resolveConfigStore(), options = {}) {
|
|
|
18676
18678
|
continue;
|
|
18677
18679
|
}
|
|
18678
18680
|
const disk = readFileSync13(targetPath, "utf-8");
|
|
18679
|
-
const { content: redactedDisk } = redactContent(disk, config.format);
|
|
18681
|
+
const { content: redactedDisk } = redactContent(disk, redactFormatForTarget(config.target_path, config.format));
|
|
18680
18682
|
if (redactedDisk !== config.content) {
|
|
18681
18683
|
driftedTargets += 1;
|
|
18682
18684
|
}
|
|
@@ -19254,7 +19256,8 @@ program.command("add <path>").description("Ingest a file into the config DB").op
|
|
|
19254
19256
|
process.exit(1);
|
|
19255
19257
|
}
|
|
19256
19258
|
const rawContent = readFileSync15(abs, "utf-8");
|
|
19257
|
-
const
|
|
19259
|
+
const storedFmt = detectFormat(abs);
|
|
19260
|
+
const fmt = redactFormatForTarget(abs, storedFmt);
|
|
19258
19261
|
const { content, redacted, isTemplate: isTemplate2 } = redactContent(rawContent, fmt);
|
|
19259
19262
|
const targetPath = abs.startsWith(homedir10()) ? abs.replace(homedir10(), "~") : abs;
|
|
19260
19263
|
const name = opts.name || filePath.split("/").pop();
|
|
@@ -19288,7 +19291,7 @@ program.command("add <path>").description("Ingest a file into the config DB").op
|
|
|
19288
19291
|
}
|
|
19289
19292
|
config = await store.updateConfig(target.id, {
|
|
19290
19293
|
content,
|
|
19291
|
-
format:
|
|
19294
|
+
format: storedFmt,
|
|
19292
19295
|
is_template: (opts.template ?? false) || isTemplate2,
|
|
19293
19296
|
...opts.category ? { category: opts.category } : {},
|
|
19294
19297
|
...opts.agent ? { agent: opts.agent } : {}
|
|
@@ -19309,7 +19312,7 @@ program.command("add <path>").description("Ingest a file into the config DB").op
|
|
|
19309
19312
|
category: opts.category ?? detectCategory(abs),
|
|
19310
19313
|
agent: opts.agent ?? detectAgent(abs),
|
|
19311
19314
|
target_path: opts.kind === "reference" ? null : targetPath,
|
|
19312
|
-
format:
|
|
19315
|
+
format: storedFmt,
|
|
19313
19316
|
content,
|
|
19314
19317
|
is_template: (opts.template ?? false) || isTemplate2
|
|
19315
19318
|
});
|
|
@@ -20060,6 +20063,22 @@ snapshotCmd.command("restore <config> <snapshot-id>").description("Restore a con
|
|
|
20060
20063
|
process.exit(1);
|
|
20061
20064
|
}
|
|
20062
20065
|
});
|
|
20066
|
+
snapshotCmd.command("prune <config>").description("Delete old snapshots, keeping the N most recent").option("--keep <n>", "number of most-recent snapshots to keep (default 10)").action(async (configId, opts) => {
|
|
20067
|
+
try {
|
|
20068
|
+
const store = resolveConfigStore();
|
|
20069
|
+
const c = await store.getConfig(configId);
|
|
20070
|
+
const keep = opts.keep === undefined ? 10 : Number(opts.keep);
|
|
20071
|
+
if (!Number.isInteger(keep) || keep < 1) {
|
|
20072
|
+
console.error(chalk.red(`--keep must be a positive integer (got: ${opts.keep})`));
|
|
20073
|
+
process.exit(1);
|
|
20074
|
+
}
|
|
20075
|
+
const removed = await store.pruneSnapshots(c.id, keep);
|
|
20076
|
+
console.log(chalk.green("\u2713") + ` Pruned ${removed} snapshot(s), keeping the ${keep} most recent for ${c.slug}`);
|
|
20077
|
+
} catch (e) {
|
|
20078
|
+
console.error(chalk.red(formatCliError(e)));
|
|
20079
|
+
process.exit(1);
|
|
20080
|
+
}
|
|
20081
|
+
});
|
|
20063
20082
|
var templateCmd = program.command("template").description("Work with template configs");
|
|
20064
20083
|
templateCmd.command("vars <id>").description("Show template variables").action(async (id) => {
|
|
20065
20084
|
try {
|
|
@@ -20166,7 +20185,7 @@ program.command("scan [id]").description("Scan configs for secrets. Defaults to
|
|
|
20166
20185
|
for (let i = 0;i < configs.length; i += BATCH) {
|
|
20167
20186
|
const batch = configs.slice(i, i + BATCH);
|
|
20168
20187
|
for (const c of batch) {
|
|
20169
|
-
const fmt = c.format;
|
|
20188
|
+
const fmt = redactFormatForTarget(c.target_path ?? "", c.format);
|
|
20170
20189
|
const secrets = scanSecrets(c.content, fmt);
|
|
20171
20190
|
if (secrets.length === 0)
|
|
20172
20191
|
continue;
|
|
@@ -20468,7 +20487,7 @@ Stored configs (${allConfigs.length}):`));
|
|
|
20468
20487
|
pass(`${validCount}/${allConfigs.length} valid syntax`);
|
|
20469
20488
|
let secretCount = 0;
|
|
20470
20489
|
for (const c of allConfigs) {
|
|
20471
|
-
const found = scanSecrets(c.content, c.format);
|
|
20490
|
+
const found = scanSecrets(c.content, redactFormatForTarget(c.target_path ?? "", c.format));
|
|
20472
20491
|
secretCount += found.length;
|
|
20473
20492
|
}
|
|
20474
20493
|
secretCount === 0 ? pass("No unredacted secrets") : fail2(`${secretCount} unredacted secret(s) \u2014 run \`configs scan --fix\``);
|
|
@@ -20672,7 +20691,7 @@ program.command("report").description("Summary of stored configs, drift, and eco
|
|
|
20672
20691
|
continue;
|
|
20673
20692
|
}
|
|
20674
20693
|
const disk = readFileSync15(abs, "utf-8");
|
|
20675
|
-
const { content: redactedDisk } = redactContent(disk, c.format);
|
|
20694
|
+
const { content: redactedDisk } = redactContent(disk, redactFormatForTarget(c.target_path, c.format));
|
|
20676
20695
|
if (redactedDisk !== c.content)
|
|
20677
20696
|
drifted++;
|
|
20678
20697
|
}
|
|
@@ -7,7 +7,6 @@ export interface ServerDataBackendEnvKeys {
|
|
|
7
7
|
databaseUrlKeys: string[];
|
|
8
8
|
}
|
|
9
9
|
export declare function serverDataBackendEnvKeys(name: string): ServerDataBackendEnvKeys;
|
|
10
|
-
export declare function assertNoLegacyStorageMode(name: string, env?: Env): void;
|
|
11
10
|
export interface ServerDataBackendResolution {
|
|
12
11
|
backend: ServerDataBackend;
|
|
13
12
|
source: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/backend.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,mCAAoC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAErD,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAK/E;
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/backend.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,mCAAoC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAErD,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAK/E;AAcD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,GAAiB,GACrB,2BAA2B,CAgB7B;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,GAAG,MAAM,GAAG,IAAI,CAGtF"}
|
|
@@ -17,7 +17,7 @@ export interface PgExecutor {
|
|
|
17
17
|
export interface TypedQueryClient {
|
|
18
18
|
query<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<QueryResult<T>>;
|
|
19
19
|
many<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<T[]>;
|
|
20
|
-
/** First row or `null`. Restored here after
|
|
20
|
+
/** First row or `null`. Restored here after knowledge dropped it. */
|
|
21
21
|
get<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<T | null>;
|
|
22
22
|
/** Exactly one row; throws if zero or more than one row is returned. */
|
|
23
23
|
one<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/query.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,IAAI,EAAc,cAAc,EAAE,MAAM,IAAI,CAAC;AAE3D,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc;IACnD,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,CAAC,SAAS,cAAc,EAC5B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC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cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACvF,qEAAqE;IACrE,GAAG,CAAC,CAAC,SAAS,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3F,wEAAwE;IACxE,GAAG,CAAC,CAAC,SAAS,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,gBAAgB,CAyBnE;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,kFAAkF;IAClF,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACzE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,eAAe,CA2B7D"}
|
package/dist/index.js
CHANGED
|
@@ -12247,7 +12247,7 @@ async function applyPreparedConfig(config, opts) {
|
|
|
12247
12247
|
changed: outputResults.some((output) => output.changed)
|
|
12248
12248
|
};
|
|
12249
12249
|
}
|
|
12250
|
-
if (!opts.dryRun) {
|
|
12250
|
+
if (!opts.dryRun && result.changed) {
|
|
12251
12251
|
await store.updateConfig(config.id, { synced_at: new Date().toISOString() });
|
|
12252
12252
|
}
|
|
12253
12253
|
return result;
|
|
@@ -12953,7 +12953,7 @@ async function getConfigsStatus(store = resolveConfigStore(), options = {}) {
|
|
|
12953
12953
|
let unredactedSecretFindings = 0;
|
|
12954
12954
|
let knownTargets = 0;
|
|
12955
12955
|
for (const config of fileConfigs) {
|
|
12956
|
-
unredactedSecretFindings += scanSecrets(config.content, config.format).length;
|
|
12956
|
+
unredactedSecretFindings += scanSecrets(config.content, redactFormatForTarget(config.target_path ?? "", config.format)).length;
|
|
12957
12957
|
if (isRetiredOrUnsupportedConfigAgent(config.agent))
|
|
12958
12958
|
continue;
|
|
12959
12959
|
if (!config.target_path)
|
|
@@ -12965,7 +12965,7 @@ async function getConfigsStatus(store = resolveConfigStore(), options = {}) {
|
|
|
12965
12965
|
continue;
|
|
12966
12966
|
}
|
|
12967
12967
|
const disk = readFileSync9(targetPath, "utf-8");
|
|
12968
|
-
const { content: redactedDisk } = redactContent(disk, config.format);
|
|
12968
|
+
const { content: redactedDisk } = redactContent(disk, redactFormatForTarget(config.target_path, config.format));
|
|
12969
12969
|
if (redactedDisk !== config.content) {
|
|
12970
12970
|
driftedTargets += 1;
|
|
12971
12971
|
}
|
|
@@ -14372,14 +14372,15 @@ async function syncFromDir(dir, opts = {}) {
|
|
|
14372
14372
|
continue;
|
|
14373
14373
|
}
|
|
14374
14374
|
const targetPath = file.replace(home, "~");
|
|
14375
|
+
const redacted = redactContent(content, redactFormatForTarget(targetPath, detectFormat(file)));
|
|
14375
14376
|
const existing = allConfigs.find((c) => c.target_path === targetPath);
|
|
14376
14377
|
if (!existing) {
|
|
14377
14378
|
if (!opts.dryRun)
|
|
14378
|
-
await store.createConfig({ name: relative6(absDir, file), category: detectCategory(file), agent: detectAgent(file), target_path: targetPath, format: detectFormat(file), content });
|
|
14379
|
+
await store.createConfig({ name: relative6(absDir, file), category: detectCategory(file), agent: detectAgent(file), target_path: targetPath, format: detectFormat(file), content: redacted.content });
|
|
14379
14380
|
result.added++;
|
|
14380
|
-
} else if (existing.content !== content) {
|
|
14381
|
+
} else if (existing.content !== redacted.content) {
|
|
14381
14382
|
if (!opts.dryRun)
|
|
14382
|
-
await store.updateConfig(existing.id, { content });
|
|
14383
|
+
await store.updateConfig(existing.id, { content: redacted.content });
|
|
14383
14384
|
result.updated++;
|
|
14384
14385
|
} else {
|
|
14385
14386
|
result.unchanged++;
|
|
@@ -14687,7 +14688,7 @@ async function syncKnown(opts = {}) {
|
|
|
14687
14688
|
continue;
|
|
14688
14689
|
}
|
|
14689
14690
|
const fmt = known.format ?? detectFormat(abs);
|
|
14690
|
-
const redacted = redactContent(rawContent, fmt);
|
|
14691
|
+
const redacted = redactContent(rawContent, redactFormatForTarget(abs, fmt));
|
|
14691
14692
|
const machineAware = templateizeMachineContent(redacted.content, machine);
|
|
14692
14693
|
const content = machineAware.content;
|
|
14693
14694
|
const isTemplate2 = redacted.isTemplate || machineAware.changed;
|
package/dist/lib/apply.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/lib/apply.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAA8B,MAAM,mBAAmB,CAAC;AAEzF,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,OAAO,EAGL,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAO7B,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK5C;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAsBrD;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO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AO,EAAE,MAAM,EAAE,EACjB,IAAI,GAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAM,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAE7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-dir.d.ts","sourceRoot":"","sources":["../../src/lib/sync-dir.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-dir.d.ts","sourceRoot":"","sources":["../../src/lib/sync-dir.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQ/E,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CAoCjG;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBtH"}
|
package/dist/lib/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/lib/sync.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACrH,OAA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AAG,OAAO,CAAC,UAAU,CAAC,CA2GhF;AAGD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,wBAAsB,UAAU,CAAC,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmClF;AAGD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAkJD,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B9F;AAGD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAU/D;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAoBzD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAQ3D;AAGD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"early-args.test.d.ts","sourceRoot":"","sources":["../../src/mcp/early-args.test.ts"],"names":[],"mappings":""}
|
package/dist/mcp/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AA4DA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -99,17 +99,17 @@ var init_retired_storage_mode = __esm(() => {
|
|
|
99
99
|
|
|
100
100
|
// src/lib/raw-store-root.ts
|
|
101
101
|
import { homedir } from "os";
|
|
102
|
-
import { join, resolve } from "path";
|
|
102
|
+
import { join as join2, resolve } from "path";
|
|
103
103
|
function getRawStoreRoot() {
|
|
104
|
-
return resolve(process.env[RAW_STORE_ROOT_ENV] ||
|
|
104
|
+
return resolve(process.env[RAW_STORE_ROOT_ENV] || join2(process.env["HOME"] || homedir(), ".hasna", "instructions"));
|
|
105
105
|
}
|
|
106
106
|
var RAW_STORE_ROOT_ENV = "HASNA_CONFIGS_HOME";
|
|
107
107
|
var init_raw_store_root = () => {};
|
|
108
108
|
|
|
109
109
|
// src/db/database.ts
|
|
110
110
|
import { Database } from "bun:sqlite";
|
|
111
|
-
import { existsSync, mkdirSync, rmSync } from "fs";
|
|
112
|
-
import { join as
|
|
111
|
+
import { existsSync as existsSync2, mkdirSync, rmSync } from "fs";
|
|
112
|
+
import { join as join3 } from "path";
|
|
113
113
|
import { randomUUID } from "crypto";
|
|
114
114
|
function getDbPath() {
|
|
115
115
|
if (process.env["HASNA_INSTRUCTIONS_DB_PATH"]) {
|
|
@@ -117,7 +117,7 @@ function getDbPath() {
|
|
|
117
117
|
}
|
|
118
118
|
const dir = getRawStoreRoot();
|
|
119
119
|
mkdirSync(dir, { recursive: true });
|
|
120
|
-
return
|
|
120
|
+
return join3(dir, "instructions.db");
|
|
121
121
|
}
|
|
122
122
|
function uuid() {
|
|
123
123
|
return randomUUID();
|
|
@@ -158,7 +158,7 @@ function resetLocalDatabase() {
|
|
|
158
158
|
if (dbPath === ":memory:")
|
|
159
159
|
return;
|
|
160
160
|
for (const p of [dbPath, `${dbPath}-wal`, `${dbPath}-shm`]) {
|
|
161
|
-
if (
|
|
161
|
+
if (existsSync2(p))
|
|
162
162
|
rmSync(p);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -596,8 +596,8 @@ var init_template = __esm(() => {
|
|
|
596
596
|
|
|
597
597
|
// src/lib/machine.ts
|
|
598
598
|
import { arch as currentArch, homedir as homedir2, hostname as currentHostname, type as currentOsType } from "os";
|
|
599
|
-
import { existsSync as
|
|
600
|
-
import { join as
|
|
599
|
+
import { existsSync as existsSync3 } from "fs";
|
|
600
|
+
import { join as join4 } from "path";
|
|
601
601
|
function normalizeOsFamily(os) {
|
|
602
602
|
const value = (os ?? "").trim().toLowerCase();
|
|
603
603
|
if (value === "darwin" || value === "macos" || value === "mac" || value === "osx")
|
|
@@ -612,8 +612,8 @@ function detectMachineContext(overrides = {}) {
|
|
|
612
612
|
const homeDir = overrides.home_dir ?? process.env["CONFIGS_HOME"] ?? process.env["HOME"] ?? homedir2();
|
|
613
613
|
const os = overrides.os ?? currentOsType();
|
|
614
614
|
const osFamily = normalizeOsFamily(os);
|
|
615
|
-
const bunBinDir = overrides.bun_bin_dir ??
|
|
616
|
-
const defaultBunPath = osFamily === "macos" &&
|
|
615
|
+
const bunBinDir = overrides.bun_bin_dir ?? join4(homeDir, ".bun", "bin");
|
|
616
|
+
const defaultBunPath = osFamily === "macos" && existsSync3(BREW_BUN_PATH) ? BREW_BUN_PATH : join4(bunBinDir, "bun");
|
|
617
617
|
return {
|
|
618
618
|
id: "current-machine",
|
|
619
619
|
hostname: overrides.hostname ?? currentHostname(),
|
|
@@ -623,10 +623,10 @@ function detectMachineContext(overrides = {}) {
|
|
|
623
623
|
created_at: "",
|
|
624
624
|
os_family: osFamily,
|
|
625
625
|
home_dir: homeDir,
|
|
626
|
-
workspace_root: overrides.workspace_root ??
|
|
626
|
+
workspace_root: overrides.workspace_root ?? join4(homeDir, osFamily === "macos" ? "Workspace" : "workspace"),
|
|
627
627
|
bun_bin_dir: bunBinDir,
|
|
628
628
|
bun_path: overrides.bun_path ?? defaultBunPath,
|
|
629
|
-
path_prefix: overrides.path_prefix ?? (osFamily === "macos" ? `${
|
|
629
|
+
path_prefix: overrides.path_prefix ?? (osFamily === "macos" ? `${join4("/opt", "homebrew", "bin")}:${bunBinDir}` : bunBinDir)
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
632
|
function machineContextToVariables(machine) {
|
|
@@ -5115,7 +5115,7 @@ var init_session_render_contract = __esm(() => {
|
|
|
5115
5115
|
});
|
|
5116
5116
|
|
|
5117
5117
|
// src/lib/project-context.ts
|
|
5118
|
-
import { basename, dirname, isAbsolute, join as
|
|
5118
|
+
import { basename, dirname as dirname2, isAbsolute, join as join5, parse, relative, resolve as resolve2 } from "path";
|
|
5119
5119
|
function revisionKey(value) {
|
|
5120
5120
|
const sequence = value.match(/^(?:rev-)?([0-9]+)$/);
|
|
5121
5121
|
if (sequence)
|
|
@@ -5678,7 +5678,7 @@ var init_asset_plan = __esm(() => {
|
|
|
5678
5678
|
// src/lib/cursor-authority.ts
|
|
5679
5679
|
import { createHash } from "crypto";
|
|
5680
5680
|
import { homedir as homedir3 } from "os";
|
|
5681
|
-
import { join as
|
|
5681
|
+
import { join as join6, resolve as resolve3 } from "path";
|
|
5682
5682
|
function sha256(content) {
|
|
5683
5683
|
return createHash("sha256").update(content).digest("hex");
|
|
5684
5684
|
}
|
|
@@ -5686,7 +5686,7 @@ function homeDir() {
|
|
|
5686
5686
|
return process.env["HOME"] || homedir3();
|
|
5687
5687
|
}
|
|
5688
5688
|
function isCursorGlobalAuthorityPath(path) {
|
|
5689
|
-
return resolve3(path) === resolve3(
|
|
5689
|
+
return resolve3(path) === resolve3(join6(homeDir(), CURSOR_GLOBAL_AUTHORITY_RELATIVE_PATH));
|
|
5690
5690
|
}
|
|
5691
5691
|
function stampCursorGlobalAuthorityMarker(content) {
|
|
5692
5692
|
if (CURSOR_GLOBAL_AUTHORITY_MARKER_PATTERN.test(content))
|
|
@@ -6884,8 +6884,8 @@ var init_config_store = __esm(() => {
|
|
|
6884
6884
|
});
|
|
6885
6885
|
|
|
6886
6886
|
// src/lib/session-render-ownership.ts
|
|
6887
|
-
import { existsSync as
|
|
6888
|
-
import { dirname as
|
|
6887
|
+
import { existsSync as existsSync4, readFileSync as readFileSync2, statSync } from "fs";
|
|
6888
|
+
import { dirname as dirname3, join as join7, parse as parse2, relative as relative2, sep } from "path";
|
|
6889
6889
|
function toSegments(absolutePath2) {
|
|
6890
6890
|
return absolutePath2.replaceAll("\\", "/").split("/").filter(Boolean);
|
|
6891
6891
|
}
|
|
@@ -6904,19 +6904,19 @@ function pathIsSessionRenderManagedDir(absolutePath2) {
|
|
|
6904
6904
|
function readManifestRelativePaths(manifestPath) {
|
|
6905
6905
|
let stats;
|
|
6906
6906
|
try {
|
|
6907
|
-
if (!
|
|
6907
|
+
if (!existsSync4(manifestPath))
|
|
6908
6908
|
return null;
|
|
6909
6909
|
stats = statSync(manifestPath);
|
|
6910
6910
|
} catch {
|
|
6911
6911
|
return null;
|
|
6912
6912
|
}
|
|
6913
|
-
const
|
|
6914
|
-
if (
|
|
6915
|
-
return
|
|
6913
|
+
const cached2 = manifestCache.get(manifestPath);
|
|
6914
|
+
if (cached2 && cached2.mtimeMs === stats.mtimeMs && cached2.size === stats.size) {
|
|
6915
|
+
return cached2.relativePaths;
|
|
6916
6916
|
}
|
|
6917
6917
|
let manifest;
|
|
6918
6918
|
try {
|
|
6919
|
-
manifest = JSON.parse(
|
|
6919
|
+
manifest = JSON.parse(readFileSync2(manifestPath, "utf-8"));
|
|
6920
6920
|
} catch {
|
|
6921
6921
|
return null;
|
|
6922
6922
|
}
|
|
@@ -6931,16 +6931,16 @@ function readManifestRelativePaths(manifestPath) {
|
|
|
6931
6931
|
}
|
|
6932
6932
|
function sessionRenderManifestClaimsPath(absolutePath2) {
|
|
6933
6933
|
const root = parse2(absolutePath2).root;
|
|
6934
|
-
let home =
|
|
6934
|
+
let home = dirname3(absolutePath2);
|
|
6935
6935
|
for (let depth = 0;depth < MANIFEST_ANCESTOR_LIMIT; depth += 1) {
|
|
6936
|
-
const manifestPath =
|
|
6936
|
+
const manifestPath = join7(home, ...SESSION_RENDER_MANIFEST_RELATIVE_PATH.split("/"));
|
|
6937
6937
|
const relativePaths = readManifestRelativePaths(manifestPath);
|
|
6938
6938
|
if (relativePaths) {
|
|
6939
6939
|
const claimed = relative2(home, absolutePath2).split(sep).join("/");
|
|
6940
6940
|
if (relativePaths.has(claimed))
|
|
6941
6941
|
return true;
|
|
6942
6942
|
}
|
|
6943
|
-
const parent =
|
|
6943
|
+
const parent = dirname3(home);
|
|
6944
6944
|
if (parent === home || home === root)
|
|
6945
6945
|
break;
|
|
6946
6946
|
home = parent;
|
|
@@ -6968,8 +6968,8 @@ __export(exports_apply, {
|
|
|
6968
6968
|
applyConfigs: () => applyConfigs,
|
|
6969
6969
|
applyConfig: () => applyConfig
|
|
6970
6970
|
});
|
|
6971
|
-
import { existsSync as
|
|
6972
|
-
import { basename as basename3, dirname as
|
|
6971
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, realpathSync, writeFileSync } from "fs";
|
|
6972
|
+
import { basename as basename3, dirname as dirname4, join as join8, resolve as resolve4 } from "path";
|
|
6973
6973
|
import { homedir as homedir4 } from "os";
|
|
6974
6974
|
function getConfigHome() {
|
|
6975
6975
|
return process.env["CONFIGS_HOME"] || process.env["HOME"] || homedir4();
|
|
@@ -6988,14 +6988,14 @@ function normalizeTargetPath(p) {
|
|
|
6988
6988
|
let current = expanded;
|
|
6989
6989
|
const missingSegments = [];
|
|
6990
6990
|
while (true) {
|
|
6991
|
-
if (
|
|
6991
|
+
if (existsSync5(current)) {
|
|
6992
6992
|
try {
|
|
6993
6993
|
return resolve4(realpathSync(current), ...missingSegments);
|
|
6994
6994
|
} catch {
|
|
6995
6995
|
return expanded;
|
|
6996
6996
|
}
|
|
6997
6997
|
}
|
|
6998
|
-
const parent =
|
|
6998
|
+
const parent = dirname4(current);
|
|
6999
6999
|
const name = basename3(current);
|
|
7000
7000
|
if (parent === current)
|
|
7001
7001
|
return expanded;
|
|
@@ -7019,11 +7019,11 @@ async function writeConfigResult(config, targetPath, content, opts, meta = {}) {
|
|
|
7019
7019
|
}
|
|
7020
7020
|
const path = expandPath(renderedTargetPath);
|
|
7021
7021
|
const renderedForTarget = isCursorGlobalAuthorityPath(path) ? stampCursorGlobalAuthorityMarker(renderedContent) : renderedContent;
|
|
7022
|
-
const previousContent =
|
|
7022
|
+
const previousContent = existsSync5(path) ? readFileSync3(path, "utf-8") : null;
|
|
7023
7023
|
const changed = previousContent !== renderedForTarget;
|
|
7024
7024
|
if (!opts.dryRun) {
|
|
7025
|
-
const dir =
|
|
7026
|
-
if (!
|
|
7025
|
+
const dir = dirname4(path);
|
|
7026
|
+
if (!existsSync5(dir)) {
|
|
7027
7027
|
mkdirSync2(dir, { recursive: true });
|
|
7028
7028
|
}
|
|
7029
7029
|
if (previousContent !== null && changed) {
|
|
@@ -7057,9 +7057,9 @@ function wouldDestroyACredential(targetPath, renderedContent, format) {
|
|
|
7057
7057
|
let current;
|
|
7058
7058
|
try {
|
|
7059
7059
|
const path = expandPath(targetPath);
|
|
7060
|
-
if (!
|
|
7060
|
+
if (!existsSync5(path))
|
|
7061
7061
|
return [];
|
|
7062
|
-
current =
|
|
7062
|
+
current = readFileSync3(path, "utf-8");
|
|
7063
7063
|
} catch {
|
|
7064
7064
|
return secretTokens;
|
|
7065
7065
|
}
|
|
@@ -7147,7 +7147,7 @@ async function applyPreparedConfig(config, opts) {
|
|
|
7147
7147
|
changed: outputResults.some((output) => output.changed)
|
|
7148
7148
|
};
|
|
7149
7149
|
}
|
|
7150
|
-
if (!opts.dryRun) {
|
|
7150
|
+
if (!opts.dryRun && result.changed) {
|
|
7151
7151
|
await store.updateConfig(config.id, { synced_at: new Date().toISOString() });
|
|
7152
7152
|
}
|
|
7153
7153
|
return result;
|
|
@@ -7383,7 +7383,7 @@ function sessionRendererOwnsCanonicalTarget(normalized, opts) {
|
|
|
7383
7383
|
getConfigHome(),
|
|
7384
7384
|
opts.vars?.["HOME_DIR"]
|
|
7385
7385
|
].filter((home) => typeof home === "string" && home.length > 0));
|
|
7386
|
-
if ([...homes].some((home) => SESSION_RENDER_OWNED_CONFIG_TARGETS.some((relativePath) => normalized === normalizeTargetPath(
|
|
7386
|
+
if ([...homes].some((home) => SESSION_RENDER_OWNED_CONFIG_TARGETS.some((relativePath) => normalized === normalizeTargetPath(join8(home, ...relativePath.split("/"))))))
|
|
7387
7387
|
return true;
|
|
7388
7388
|
return sessionRenderOwnsPath(normalized);
|
|
7389
7389
|
}
|
|
@@ -7416,8 +7416,8 @@ __export(exports_sync, {
|
|
|
7416
7416
|
KNOWN_CONFIGS: () => KNOWN_CONFIGS,
|
|
7417
7417
|
CLAUDE_PROMPT_OUTPUTS: () => CLAUDE_PROMPT_OUTPUTS
|
|
7418
7418
|
});
|
|
7419
|
-
import { existsSync as
|
|
7420
|
-
import { basename as basename4, extname as extname2, join as
|
|
7419
|
+
import { existsSync as existsSync6, readdirSync, readFileSync as readFileSync4 } from "fs";
|
|
7420
|
+
import { basename as basename4, extname as extname2, join as join9 } from "path";
|
|
7421
7421
|
function claudeRuleOutputs(fileName) {
|
|
7422
7422
|
const stem = basename4(fileName, extname2(fileName));
|
|
7423
7423
|
return [
|
|
@@ -7456,7 +7456,7 @@ function isGeneratedOutputTarget2(config, owners) {
|
|
|
7456
7456
|
return !!ownerIds && !ownerIds.has(config.id);
|
|
7457
7457
|
}
|
|
7458
7458
|
function hasClaudePromptSource() {
|
|
7459
|
-
return
|
|
7459
|
+
return existsSync6(expandPath("~/.claude/CLAUDE.md"));
|
|
7460
7460
|
}
|
|
7461
7461
|
function hasClaudeRuleSourceForCursorTarget(targetPath) {
|
|
7462
7462
|
const absoluteTargetPath = expandPath(targetPath);
|
|
@@ -7464,7 +7464,7 @@ function hasClaudeRuleSourceForCursorTarget(targetPath) {
|
|
|
7464
7464
|
if (!absoluteTargetPath.startsWith(`${absolutePrefix}/`) || !absoluteTargetPath.endsWith(".mdc"))
|
|
7465
7465
|
return false;
|
|
7466
7466
|
const stem = basename4(absoluteTargetPath, ".mdc");
|
|
7467
|
-
return
|
|
7467
|
+
return existsSync6(expandPath(`~/.claude/rules/${stem}.md`)) || existsSync6(expandPath(`~/.claude/rules/${stem}.mdc`));
|
|
7468
7468
|
}
|
|
7469
7469
|
function isKnownGeneratedTargetPath(targetPath) {
|
|
7470
7470
|
const normalizedTargetPath = normalizeTargetPath(targetPath);
|
|
@@ -7481,11 +7481,11 @@ async function syncProject(opts) {
|
|
|
7481
7481
|
const allConfigs = await store.listConfigs();
|
|
7482
7482
|
const machine = detectMachineContext();
|
|
7483
7483
|
for (const pf of PROJECT_CONFIG_FILES) {
|
|
7484
|
-
const abs =
|
|
7485
|
-
if (!
|
|
7484
|
+
const abs = join9(absDir, pf.file);
|
|
7485
|
+
if (!existsSync6(abs))
|
|
7486
7486
|
continue;
|
|
7487
7487
|
try {
|
|
7488
|
-
const rawContent =
|
|
7488
|
+
const rawContent = readFileSync4(abs, "utf-8");
|
|
7489
7489
|
if (rawContent.length > 500000) {
|
|
7490
7490
|
result.skipped.push(pf.file);
|
|
7491
7491
|
continue;
|
|
@@ -7514,20 +7514,20 @@ async function syncProject(opts) {
|
|
|
7514
7514
|
}
|
|
7515
7515
|
}
|
|
7516
7516
|
for (const ruleDir of [
|
|
7517
|
-
{ dir:
|
|
7518
|
-
{ dir:
|
|
7519
|
-
{ dir:
|
|
7520
|
-
{ dir:
|
|
7521
|
-
{ dir:
|
|
7522
|
-
{ dir:
|
|
7523
|
-
{ dir:
|
|
7517
|
+
{ dir: join9(absDir, ".claude", "rules"), agent: "claude", namePrefix: "rules" },
|
|
7518
|
+
{ dir: join9(absDir, ".agents", "rules"), agent: "antigravity", namePrefix: "antigravity-rules" },
|
|
7519
|
+
{ dir: join9(absDir, ".cursor", "rules"), agent: "cursor", namePrefix: "cursor-rules" },
|
|
7520
|
+
{ dir: join9(absDir, ".github", "instructions"), agent: "copilot", namePrefix: "copilot-instructions" },
|
|
7521
|
+
{ dir: join9(absDir, ".devin", "rules"), agent: "devin", namePrefix: "devin-rules" },
|
|
7522
|
+
{ dir: join9(absDir, ".windsurf", "rules"), agent: "windsurf-legacy", namePrefix: "windsurf-rules" },
|
|
7523
|
+
{ dir: join9(absDir, ".clinerules"), agent: "cline", namePrefix: "cline-rules" }
|
|
7524
7524
|
]) {
|
|
7525
|
-
if (!
|
|
7525
|
+
if (!existsSync6(ruleDir.dir))
|
|
7526
7526
|
continue;
|
|
7527
7527
|
const mdFiles = readdirSync(ruleDir.dir).filter((f) => f.endsWith(".md") || f.endsWith(".mdc"));
|
|
7528
7528
|
for (const f of mdFiles) {
|
|
7529
|
-
const abs =
|
|
7530
|
-
const raw =
|
|
7529
|
+
const abs = join9(ruleDir.dir, f);
|
|
7530
|
+
const raw = readFileSync4(abs, "utf-8");
|
|
7531
7531
|
const redacted = redactContent(raw, "markdown");
|
|
7532
7532
|
const machineAware = templateizeMachineContent(redacted.content, machine);
|
|
7533
7533
|
const content = machineAware.content;
|
|
@@ -7566,20 +7566,20 @@ async function syncKnown(opts = {}) {
|
|
|
7566
7566
|
for (const known of targets) {
|
|
7567
7567
|
if (known.rulesDir) {
|
|
7568
7568
|
const absDir = expandPath(known.rulesDir);
|
|
7569
|
-
if (!
|
|
7569
|
+
if (!existsSync6(absDir)) {
|
|
7570
7570
|
result.skipped.push(known.rulesDir);
|
|
7571
7571
|
continue;
|
|
7572
7572
|
}
|
|
7573
7573
|
const extensions = known.rulesExtensions ?? [".md", ".mdc"];
|
|
7574
7574
|
const ruleFiles = readdirSync(absDir).filter((f) => extensions.some((ext) => f.endsWith(ext)));
|
|
7575
7575
|
for (const f of ruleFiles) {
|
|
7576
|
-
const abs2 =
|
|
7576
|
+
const abs2 = join9(absDir, f);
|
|
7577
7577
|
const targetPath = abs2.replace(home, "~");
|
|
7578
7578
|
if (existingOutputOwners.has(normalizeTargetPath(targetPath)) || isKnownGeneratedTargetPath(targetPath)) {
|
|
7579
7579
|
result.skipped.push(`${targetPath} (generated output)`);
|
|
7580
7580
|
continue;
|
|
7581
7581
|
}
|
|
7582
|
-
const raw =
|
|
7582
|
+
const raw = readFileSync4(abs2, "utf-8");
|
|
7583
7583
|
const redacted = redactContent(raw, "markdown");
|
|
7584
7584
|
const machineAware = templateizeMachineContent(redacted.content, machine);
|
|
7585
7585
|
const content = machineAware.content;
|
|
@@ -7607,18 +7607,18 @@ async function syncKnown(opts = {}) {
|
|
|
7607
7607
|
continue;
|
|
7608
7608
|
}
|
|
7609
7609
|
const abs = expandPath(known.path);
|
|
7610
|
-
if (!
|
|
7610
|
+
if (!existsSync6(abs)) {
|
|
7611
7611
|
result.skipped.push(known.path);
|
|
7612
7612
|
continue;
|
|
7613
7613
|
}
|
|
7614
7614
|
try {
|
|
7615
|
-
const rawContent = normalizeKnownConfigSource(known,
|
|
7615
|
+
const rawContent = normalizeKnownConfigSource(known, readFileSync4(abs, "utf-8"));
|
|
7616
7616
|
if (rawContent.length > 500000) {
|
|
7617
7617
|
result.skipped.push(known.path + " (too large)");
|
|
7618
7618
|
continue;
|
|
7619
7619
|
}
|
|
7620
7620
|
const fmt = known.format ?? detectFormat(abs);
|
|
7621
|
-
const redacted = redactContent(rawContent, fmt);
|
|
7621
|
+
const redacted = redactContent(rawContent, redactFormatForTarget(abs, fmt));
|
|
7622
7622
|
const machineAware = templateizeMachineContent(redacted.content, machine);
|
|
7623
7623
|
const content = machineAware.content;
|
|
7624
7624
|
const isTemplate2 = redacted.isTemplate || machineAware.changed;
|
|
@@ -7713,9 +7713,9 @@ function storedPlaceholderIsLiteralOnDisk(storedLine, diskLine) {
|
|
|
7713
7713
|
}
|
|
7714
7714
|
function buildDiff(expectedContent, targetPath, storedFormat, showSecrets) {
|
|
7715
7715
|
const path = expandPath(targetPath);
|
|
7716
|
-
if (!
|
|
7716
|
+
if (!existsSync6(path))
|
|
7717
7717
|
return `(file not found on disk: ${path})`;
|
|
7718
|
-
const diskContent =
|
|
7718
|
+
const diskContent = readFileSync4(path, "utf-8");
|
|
7719
7719
|
if (diskContent === expectedContent)
|
|
7720
7720
|
return "(no diff \u2014 identical)";
|
|
7721
7721
|
const format = redactFormatForTarget(targetPath, storedFormat);
|
|
@@ -7943,8 +7943,8 @@ var init_sync = __esm(() => {
|
|
|
7943
7943
|
});
|
|
7944
7944
|
|
|
7945
7945
|
// src/lib/sync-dir.ts
|
|
7946
|
-
import { existsSync as
|
|
7947
|
-
import { join as
|
|
7946
|
+
import { existsSync as existsSync7, readdirSync as readdirSync2, readFileSync as readFileSync5, statSync as statSync2 } from "fs";
|
|
7947
|
+
import { join as join10, relative as relative3 } from "path";
|
|
7948
7948
|
import { homedir as homedir5 } from "os";
|
|
7949
7949
|
function shouldSkip(p) {
|
|
7950
7950
|
return SKIP.some((s) => p.includes(s));
|
|
@@ -7952,9 +7952,9 @@ function shouldSkip(p) {
|
|
|
7952
7952
|
async function syncFromDir(dir, opts = {}) {
|
|
7953
7953
|
const store = opts.store ?? resolveConfigStore();
|
|
7954
7954
|
const absDir = expandPath(dir);
|
|
7955
|
-
if (!
|
|
7955
|
+
if (!existsSync7(absDir))
|
|
7956
7956
|
return { added: 0, updated: 0, unchanged: 0, skipped: [`Not found: ${absDir}`] };
|
|
7957
|
-
const files = opts.recursive !== false ? walkDir(absDir) : readdirSync2(absDir).map((f) =>
|
|
7957
|
+
const files = opts.recursive !== false ? walkDir(absDir) : readdirSync2(absDir).map((f) => join10(absDir, f)).filter((f) => statSync2(f).isFile());
|
|
7958
7958
|
const result = { added: 0, updated: 0, unchanged: 0, skipped: [] };
|
|
7959
7959
|
const home = homedir5();
|
|
7960
7960
|
const allConfigs = await store.listConfigs();
|
|
@@ -7964,20 +7964,21 @@ async function syncFromDir(dir, opts = {}) {
|
|
|
7964
7964
|
continue;
|
|
7965
7965
|
}
|
|
7966
7966
|
try {
|
|
7967
|
-
const content =
|
|
7967
|
+
const content = readFileSync5(file, "utf-8");
|
|
7968
7968
|
if (content.length > 500000) {
|
|
7969
7969
|
result.skipped.push(file + " (too large)");
|
|
7970
7970
|
continue;
|
|
7971
7971
|
}
|
|
7972
7972
|
const targetPath = file.replace(home, "~");
|
|
7973
|
+
const redacted = redactContent(content, redactFormatForTarget(targetPath, detectFormat(file)));
|
|
7973
7974
|
const existing = allConfigs.find((c) => c.target_path === targetPath);
|
|
7974
7975
|
if (!existing) {
|
|
7975
7976
|
if (!opts.dryRun)
|
|
7976
|
-
await store.createConfig({ name: relative3(absDir, file), category: detectCategory(file), agent: detectAgent(file), target_path: targetPath, format: detectFormat(file), content });
|
|
7977
|
+
await store.createConfig({ name: relative3(absDir, file), category: detectCategory(file), agent: detectAgent(file), target_path: targetPath, format: detectFormat(file), content: redacted.content });
|
|
7977
7978
|
result.added++;
|
|
7978
|
-
} else if (existing.content !== content) {
|
|
7979
|
+
} else if (existing.content !== redacted.content) {
|
|
7979
7980
|
if (!opts.dryRun)
|
|
7980
|
-
await store.updateConfig(existing.id, { content });
|
|
7981
|
+
await store.updateConfig(existing.id, { content: redacted.content });
|
|
7981
7982
|
result.updated++;
|
|
7982
7983
|
} else {
|
|
7983
7984
|
result.unchanged++;
|
|
@@ -8014,7 +8015,7 @@ async function syncToDir(dir, opts = {}) {
|
|
|
8014
8015
|
}
|
|
8015
8016
|
function walkDir(dir, files = []) {
|
|
8016
8017
|
for (const entry of readdirSync2(dir, { withFileTypes: true })) {
|
|
8017
|
-
const full =
|
|
8018
|
+
const full = join10(dir, entry.name);
|
|
8018
8019
|
if (shouldSkip(full))
|
|
8019
8020
|
continue;
|
|
8020
8021
|
if (entry.isDirectory())
|
|
@@ -8029,6 +8030,7 @@ var init_sync_dir = __esm(() => {
|
|
|
8029
8030
|
init_config_store();
|
|
8030
8031
|
init_apply();
|
|
8031
8032
|
init_sync();
|
|
8033
|
+
init_redact();
|
|
8032
8034
|
SKIP = [".db", ".db-shm", ".db-wal", ".log", ".lock", ".DS_Store", "node_modules", ".git"];
|
|
8033
8035
|
});
|
|
8034
8036
|
|
|
@@ -8036,7 +8038,7 @@ var init_sync_dir = __esm(() => {
|
|
|
8036
8038
|
var require_package = __commonJS((exports, module) => {
|
|
8037
8039
|
module.exports = {
|
|
8038
8040
|
name: "@hasna/instructions",
|
|
8039
|
-
version: "0.4.
|
|
8041
|
+
version: "0.4.43",
|
|
8040
8042
|
description: "AI coding agent instruction & configuration manager \u2014 store, version, apply, and share all your AI coding configs. CLI + MCP + HTTP API (instructions-serve) + generated SDK + Dashboard.",
|
|
8041
8043
|
type: "module",
|
|
8042
8044
|
main: "dist/index.js",
|
|
@@ -8112,7 +8114,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
8112
8114
|
author: "Andrei Hasna <andrei@hasna.com>",
|
|
8113
8115
|
license: "Apache-2.0",
|
|
8114
8116
|
dependencies: {
|
|
8115
|
-
"@hasna/contracts": "0.13.
|
|
8117
|
+
"@hasna/contracts": "0.13.1",
|
|
8116
8118
|
"@hasna/events": "^0.1.16",
|
|
8117
8119
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
8118
8120
|
chalk: "^5.4.1",
|
|
@@ -8136,6 +8138,35 @@ var require_package = __commonJS((exports, module) => {
|
|
|
8136
8138
|
// src/mcp/index.ts
|
|
8137
8139
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8138
8140
|
|
|
8141
|
+
// src/lib/package-version.ts
|
|
8142
|
+
import { existsSync, readFileSync } from "fs";
|
|
8143
|
+
import { dirname, join } from "path";
|
|
8144
|
+
import { fileURLToPath } from "url";
|
|
8145
|
+
var cached = null;
|
|
8146
|
+
function getPackageVersion() {
|
|
8147
|
+
if (cached)
|
|
8148
|
+
return cached;
|
|
8149
|
+
try {
|
|
8150
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
8151
|
+
for (let i = 0;i < 8; i++) {
|
|
8152
|
+
const pkgPath = join(dir, "package.json");
|
|
8153
|
+
if (existsSync(pkgPath)) {
|
|
8154
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
8155
|
+
if (pkg.name === "@hasna/instructions" && pkg.version) {
|
|
8156
|
+
cached = pkg.version;
|
|
8157
|
+
return cached;
|
|
8158
|
+
}
|
|
8159
|
+
}
|
|
8160
|
+
const parent = dirname(dir);
|
|
8161
|
+
if (parent === dir)
|
|
8162
|
+
break;
|
|
8163
|
+
dir = parent;
|
|
8164
|
+
}
|
|
8165
|
+
} catch {}
|
|
8166
|
+
cached = "0.0.0";
|
|
8167
|
+
return cached;
|
|
8168
|
+
}
|
|
8169
|
+
|
|
8139
8170
|
// src/mcp/server.ts
|
|
8140
8171
|
init_config_store();
|
|
8141
8172
|
init_apply();
|
|
@@ -8374,7 +8405,7 @@ function buildServer() {
|
|
|
8374
8405
|
const allConfigs = await store.listConfigs({ kind: "file" });
|
|
8375
8406
|
const { existsSync: ex, readFileSync: rf } = await import("fs");
|
|
8376
8407
|
const { expandPath: expandPath2 } = await Promise.resolve().then(() => (init_apply(), exports_apply));
|
|
8377
|
-
const { redactContent: redactContent2 } = await Promise.resolve().then(() => (init_redact(), exports_redact));
|
|
8408
|
+
const { redactContent: redactContent2, redactFormatForTarget: redactFormatForTarget2 } = await Promise.resolve().then(() => (init_redact(), exports_redact));
|
|
8378
8409
|
let drifted = 0, missing = 0, templates = 0;
|
|
8379
8410
|
const driftedSlugs = [];
|
|
8380
8411
|
for (const c of allConfigs) {
|
|
@@ -8388,7 +8419,7 @@ function buildServer() {
|
|
|
8388
8419
|
continue;
|
|
8389
8420
|
}
|
|
8390
8421
|
const disk = rf(abs, "utf-8");
|
|
8391
|
-
const { content: redactedDisk } = redactContent2(disk, c.format);
|
|
8422
|
+
const { content: redactedDisk } = redactContent2(disk, redactFormatForTarget2(c.target_path, c.format));
|
|
8392
8423
|
if (redactedDisk !== c.content) {
|
|
8393
8424
|
drifted++;
|
|
8394
8425
|
driftedSlugs.push(c.slug);
|
|
@@ -8435,11 +8466,11 @@ function buildServer() {
|
|
|
8435
8466
|
return ok({ rendered, config_id: config.id, slug: config.slug });
|
|
8436
8467
|
}
|
|
8437
8468
|
case "scan_secrets": {
|
|
8438
|
-
const { scanSecrets: scanSecrets2, redactContent: redactContent2 } = await Promise.resolve().then(() => (init_redact(), exports_redact));
|
|
8469
|
+
const { scanSecrets: scanSecrets2, redactContent: redactContent2, redactFormatForTarget: redactFormatForTarget2 } = await Promise.resolve().then(() => (init_redact(), exports_redact));
|
|
8439
8470
|
const configs = args["id_or_slug"] ? [await store.getConfig(args["id_or_slug"])] : await store.listConfigs({ kind: "file" });
|
|
8440
8471
|
const findings = [];
|
|
8441
8472
|
for (const c of configs) {
|
|
8442
|
-
const fmt = c.format;
|
|
8473
|
+
const fmt = redactFormatForTarget2(c.target_path ?? "", c.format);
|
|
8443
8474
|
const secrets = scanSecrets2(c.content, fmt);
|
|
8444
8475
|
if (secrets.length > 0) {
|
|
8445
8476
|
findings.push({ slug: c.slug, secrets: secrets.length, vars: secrets.map((s) => s.varName) });
|
|
@@ -8587,6 +8618,24 @@ async function startMcpHttpServer(port) {
|
|
|
8587
8618
|
// src/mcp/index.ts
|
|
8588
8619
|
async function main() {
|
|
8589
8620
|
const argv = process.argv.slice(2);
|
|
8621
|
+
if (argv.includes("--version") || argv.includes("-V")) {
|
|
8622
|
+
console.log(getPackageVersion());
|
|
8623
|
+
return;
|
|
8624
|
+
}
|
|
8625
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
8626
|
+
console.log(`Usage: configs-mcp [options]
|
|
8627
|
+
|
|
8628
|
+
MCP server for @hasna/instructions (Streamable HTTP by default; --stdio to select stdio).
|
|
8629
|
+
|
|
8630
|
+
Options:
|
|
8631
|
+
-V, --version output the version number
|
|
8632
|
+
-h, --help display help for command
|
|
8633
|
+
--claude register with Claude Code (stdio, user scope)
|
|
8634
|
+
--http explicitly select Streamable HTTP transport
|
|
8635
|
+
--stdio explicitly select stdio transport
|
|
8636
|
+
--port <n> HTTP port (default: 8853)`);
|
|
8637
|
+
return;
|
|
8638
|
+
}
|
|
8590
8639
|
if (argv.includes("--claude")) {
|
|
8591
8640
|
const proc = Bun.spawn(["claude", "mcp", "add", "--transport", "stdio", "--scope", "user", "configs", "--", "configs-mcp"], { stdout: "inherit", stderr: "inherit" });
|
|
8592
8641
|
await proc.exited;
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA4EnE,wBAAgB,WAAW,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA4EnE,wBAAgB,WAAW,IAAI,MAAM,CA+VpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../src/server/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAgB,UAAU,EAAE,KAAK,cAAc,EAAE,WAAW,EAAwB,MAAM,uBAAuB,CAAC;AACzH,OAAO,EAAmC,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAI1G,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,oFAAoF;AACpF,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAQhG;AAED,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAO7F;AAED,wFAAwF;AACxF,wBAAgB,wBAAwB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAEtF;AA0BD,+EAA+E;AAC/E,wBAAgB,cAAc,IAAI,eAAe,CAEhD;AAkBD,wBAAgB,cAAc,IAAI,WAAW,CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,cAAc,CAejD;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../src/server/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAgB,UAAU,EAAE,KAAK,cAAc,EAAE,WAAW,EAAwB,MAAM,uBAAuB,CAAC;AACzH,OAAO,EAAmC,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAI1G,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,oFAAoF;AACpF,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAQhG;AAED,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAO7F;AAED,wFAAwF;AACxF,wBAAgB,wBAAwB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAEtF;AA0BD,+EAA+E;AAC/E,wBAAgB,cAAc,IAAI,eAAe,CAEhD;AAkBD,wBAAgB,cAAc,IAAI,WAAW,CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,cAAc,CAejD;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkBvD;AAQD,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAmB7F;AAED,iEAAiE;AACjE,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAIlD;AAED,4BAA4B;AAC5B,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAMhD"}
|
package/dist/server/index.js
CHANGED
|
@@ -1744,7 +1744,7 @@ class ProfileNotFoundError extends Error {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
1746
|
|
|
1747
|
-
//
|
|
1747
|
+
// ../../node_modules/.bun/@hasna+contracts@0.13.1+b44ff2e73ad18770/node_modules/@hasna/contracts/dist/auth/index.js
|
|
1748
1748
|
import { createHash, createHmac, randomBytes, timingSafeEqual } from "crypto";
|
|
1749
1749
|
var MAX_TENANT_ID_LENGTH = 64;
|
|
1750
1750
|
var TENANT_ID_PATTERN = new RegExp(`^[A-Za-z0-9][A-Za-z0-9._-]{0,${MAX_TENANT_ID_LENGTH - 1}}$`);
|
|
@@ -2779,7 +2779,10 @@ async function ensureCloudSchema() {
|
|
|
2779
2779
|
await client.execute(sql);
|
|
2780
2780
|
}
|
|
2781
2781
|
await getApiKeyStore().ensureSchema();
|
|
2782
|
-
})()
|
|
2782
|
+
})().catch((e) => {
|
|
2783
|
+
schemaEnsured = null;
|
|
2784
|
+
throw e;
|
|
2785
|
+
});
|
|
2783
2786
|
return schemaEnsured;
|
|
2784
2787
|
}
|
|
2785
2788
|
var honoMiddlewareCache = new Map;
|
|
@@ -2865,6 +2868,18 @@ function boundedReadPage(items, total, options = {}) {
|
|
|
2865
2868
|
};
|
|
2866
2869
|
}
|
|
2867
2870
|
|
|
2871
|
+
// src/lib/machine.ts
|
|
2872
|
+
function normalizeOsFamily(os) {
|
|
2873
|
+
const value = (os ?? "").trim().toLowerCase();
|
|
2874
|
+
if (value === "darwin" || value === "macos" || value === "mac" || value === "osx")
|
|
2875
|
+
return "macos";
|
|
2876
|
+
if (value === "linux")
|
|
2877
|
+
return "linux";
|
|
2878
|
+
if (value === "windows_nt" || value === "windows" || value === "win32")
|
|
2879
|
+
return "windows";
|
|
2880
|
+
return value || "unknown";
|
|
2881
|
+
}
|
|
2882
|
+
|
|
2868
2883
|
// src/lib/provider-version.ts
|
|
2869
2884
|
function providerVersionSatisfies(version, range) {
|
|
2870
2885
|
const current = parseProviderVersion(version);
|
|
@@ -8161,6 +8176,7 @@ async function resolveProfileForMachineRead2(client, machine, options = {}) {
|
|
|
8161
8176
|
const { limit } = normalizeBoundedReadOptions(options);
|
|
8162
8177
|
const host = (machine.hostname ?? "").trim().toLowerCase();
|
|
8163
8178
|
const os = (machine.os ?? "").trim().toLowerCase();
|
|
8179
|
+
const osFamily = normalizeOsFamily(machine.os);
|
|
8164
8180
|
const arch = (machine.arch ?? "").trim().toLowerCase();
|
|
8165
8181
|
let cursor = 0;
|
|
8166
8182
|
let scanned = 0;
|
|
@@ -8174,7 +8190,10 @@ async function resolveProfileForMachineRead2(client, machine, options = {}) {
|
|
|
8174
8190
|
if (!profileHasSelectors(p.selectors))
|
|
8175
8191
|
continue;
|
|
8176
8192
|
const s = p.selectors;
|
|
8177
|
-
const osOk = !s.os?.length || s.os.some((c) =>
|
|
8193
|
+
const osOk = !s.os?.length || s.os.some((c) => {
|
|
8194
|
+
const value = c.trim().toLowerCase();
|
|
8195
|
+
return value === os || normalizeOsFamily(c) === osFamily;
|
|
8196
|
+
});
|
|
8178
8197
|
const archOk = !s.arch?.length || s.arch.some((c) => c.trim().toLowerCase() === arch);
|
|
8179
8198
|
const hostOk = !s.hostnames?.length || s.hostnames.some((c) => c.trim().toLowerCase() === host);
|
|
8180
8199
|
if (!osOk || !archOk || !hostOk)
|
package/dist/status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAW9E,KAAK,WAAW,GAAG,4BAA4B,GAAG,IAAI,CAAC;AACvD,KAAK,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;AACtC,KAAK,cAAc,GAAG,IAAI,GAAG,MAAM,CAAC;AAEpC,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC;IACrB,OAAO,EAAE;QACP,IAAI,EAAE,MAA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AC,qBAAqB,CAAC,CA0IhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-store.d.ts","sourceRoot":"","sources":["../../src/storage/cloud-store.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,OAAO,EAGZ,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"cloud-store.d.ts","sourceRoot":"","sources":["../../src/storage/cloud-store.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,OAAO,EAGZ,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;AA6G3B,wBAAsB,WAAW,CAC/B,MAAM,EAAE,gBAAgB,EACxB,MAAM,GAAE,YAAiB,GACxB,OAAO,CAAC,MAAM,EAAE,CAAC,CAsBnB;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,QA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AE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAC1D,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAkDhC;AAwBD,wBAAsB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAK/E;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,GAAG,IAAI,EACjB,IAAI,EAAE,MAAM,GAAG,IAAI,GAClB,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpG;AAID,wBAAsB,cAAc,CAClC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACnG,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/instructions",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.43",
|
|
4
4
|
"description": "AI coding agent instruction & configuration manager — store, version, apply, and share all your AI coding configs. CLI + MCP + HTTP API (instructions-serve) + generated SDK + Dashboard.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"author": "Andrei Hasna <andrei@hasna.com>",
|
|
77
77
|
"license": "Apache-2.0",
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@hasna/contracts": "0.13.
|
|
79
|
+
"@hasna/contracts": "0.13.1",
|
|
80
80
|
"@hasna/events": "^0.1.16",
|
|
81
81
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
82
82
|
"chalk": "^5.4.1",
|