@hasna/instructions 0.4.39 → 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/index.js CHANGED
@@ -1060,113 +1060,113 @@ import { basename, dirname, isAbsolute, join as join4, parse, relative, resolve
1060
1060
  // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
1061
1061
  var exports_external = {};
1062
1062
  __export(exports_external, {
1063
- BRAND: () => BRAND,
1064
- DIRTY: () => DIRTY,
1065
- EMPTY_PATH: () => EMPTY_PATH,
1066
- INVALID: () => INVALID,
1067
- NEVER: () => NEVER,
1068
- OK: () => OK,
1069
- ParseStatus: () => ParseStatus,
1070
- Schema: () => ZodType,
1071
- ZodAny: () => ZodAny,
1072
- ZodArray: () => ZodArray,
1073
- ZodBigInt: () => ZodBigInt,
1074
- ZodBoolean: () => ZodBoolean,
1075
- ZodBranded: () => ZodBranded,
1076
- ZodCatch: () => ZodCatch,
1077
- ZodDate: () => ZodDate,
1078
- ZodDefault: () => ZodDefault,
1079
- ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
1080
- ZodEffects: () => ZodEffects,
1081
- ZodEnum: () => ZodEnum,
1082
- ZodError: () => ZodError,
1083
- ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
1084
- ZodFunction: () => ZodFunction,
1085
- ZodIntersection: () => ZodIntersection,
1086
- ZodIssueCode: () => ZodIssueCode,
1087
- ZodLazy: () => ZodLazy,
1088
- ZodLiteral: () => ZodLiteral,
1089
- ZodMap: () => ZodMap,
1090
- ZodNaN: () => ZodNaN,
1091
- ZodNativeEnum: () => ZodNativeEnum,
1092
- ZodNever: () => ZodNever,
1093
- ZodNull: () => ZodNull,
1094
- ZodNullable: () => ZodNullable,
1095
- ZodNumber: () => ZodNumber,
1096
- ZodObject: () => ZodObject,
1097
- ZodOptional: () => ZodOptional,
1098
- ZodParsedType: () => ZodParsedType,
1099
- ZodPipeline: () => ZodPipeline,
1100
- ZodPromise: () => ZodPromise,
1101
- ZodReadonly: () => ZodReadonly,
1102
- ZodRecord: () => ZodRecord,
1103
- ZodSchema: () => ZodType,
1104
- ZodSet: () => ZodSet,
1105
- ZodString: () => ZodString,
1106
- ZodSymbol: () => ZodSymbol,
1107
- ZodTransformer: () => ZodEffects,
1108
- ZodTuple: () => ZodTuple,
1109
- ZodType: () => ZodType,
1110
- ZodUndefined: () => ZodUndefined,
1111
- ZodUnion: () => ZodUnion,
1112
- ZodUnknown: () => ZodUnknown,
1113
- ZodVoid: () => ZodVoid,
1114
- addIssueToContext: () => addIssueToContext,
1115
- any: () => anyType,
1116
- array: () => arrayType,
1117
- bigint: () => bigIntType,
1118
- boolean: () => booleanType,
1119
- coerce: () => coerce,
1120
- custom: () => custom,
1121
- date: () => dateType,
1122
- datetimeRegex: () => datetimeRegex,
1123
- defaultErrorMap: () => en_default,
1124
- discriminatedUnion: () => discriminatedUnionType,
1125
- effect: () => effectsType,
1126
- enum: () => enumType,
1127
- function: () => functionType,
1128
- getErrorMap: () => getErrorMap,
1129
- getParsedType: () => getParsedType,
1130
- instanceof: () => instanceOfType,
1131
- intersection: () => intersectionType,
1132
- isAborted: () => isAborted,
1133
- isAsync: () => isAsync,
1134
- isDirty: () => isDirty,
1135
- isValid: () => isValid,
1136
- late: () => late,
1137
- lazy: () => lazyType,
1138
- literal: () => literalType,
1139
- makeIssue: () => makeIssue,
1140
- map: () => mapType,
1141
- nan: () => nanType,
1142
- nativeEnum: () => nativeEnumType,
1143
- never: () => neverType,
1144
- null: () => nullType,
1145
- nullable: () => nullableType,
1146
- number: () => numberType,
1147
- object: () => objectType,
1148
- objectUtil: () => objectUtil,
1149
- oboolean: () => oboolean,
1150
- onumber: () => onumber,
1151
- optional: () => optionalType,
1152
- ostring: () => ostring,
1153
- pipeline: () => pipelineType,
1154
- preprocess: () => preprocessType,
1155
- promise: () => promiseType,
1156
- quotelessJson: () => quotelessJson,
1157
- record: () => recordType,
1158
- set: () => setType,
1159
- setErrorMap: () => setErrorMap,
1160
- strictObject: () => strictObjectType,
1161
- string: () => stringType,
1162
- symbol: () => symbolType,
1163
- transformer: () => effectsType,
1164
- tuple: () => tupleType,
1165
- undefined: () => undefinedType,
1166
- union: () => unionType,
1167
- unknown: () => unknownType,
1063
+ void: () => voidType,
1168
1064
  util: () => util,
1169
- void: () => voidType
1065
+ unknown: () => unknownType,
1066
+ union: () => unionType,
1067
+ undefined: () => undefinedType,
1068
+ tuple: () => tupleType,
1069
+ transformer: () => effectsType,
1070
+ symbol: () => symbolType,
1071
+ string: () => stringType,
1072
+ strictObject: () => strictObjectType,
1073
+ setErrorMap: () => setErrorMap,
1074
+ set: () => setType,
1075
+ record: () => recordType,
1076
+ quotelessJson: () => quotelessJson,
1077
+ promise: () => promiseType,
1078
+ preprocess: () => preprocessType,
1079
+ pipeline: () => pipelineType,
1080
+ ostring: () => ostring,
1081
+ optional: () => optionalType,
1082
+ onumber: () => onumber,
1083
+ oboolean: () => oboolean,
1084
+ objectUtil: () => objectUtil,
1085
+ object: () => objectType,
1086
+ number: () => numberType,
1087
+ nullable: () => nullableType,
1088
+ null: () => nullType,
1089
+ never: () => neverType,
1090
+ nativeEnum: () => nativeEnumType,
1091
+ nan: () => nanType,
1092
+ map: () => mapType,
1093
+ makeIssue: () => makeIssue,
1094
+ literal: () => literalType,
1095
+ lazy: () => lazyType,
1096
+ late: () => late,
1097
+ isValid: () => isValid,
1098
+ isDirty: () => isDirty,
1099
+ isAsync: () => isAsync,
1100
+ isAborted: () => isAborted,
1101
+ intersection: () => intersectionType,
1102
+ instanceof: () => instanceOfType,
1103
+ getParsedType: () => getParsedType,
1104
+ getErrorMap: () => getErrorMap,
1105
+ function: () => functionType,
1106
+ enum: () => enumType,
1107
+ effect: () => effectsType,
1108
+ discriminatedUnion: () => discriminatedUnionType,
1109
+ defaultErrorMap: () => en_default,
1110
+ datetimeRegex: () => datetimeRegex,
1111
+ date: () => dateType,
1112
+ custom: () => custom,
1113
+ coerce: () => coerce,
1114
+ boolean: () => booleanType,
1115
+ bigint: () => bigIntType,
1116
+ array: () => arrayType,
1117
+ any: () => anyType,
1118
+ addIssueToContext: () => addIssueToContext,
1119
+ ZodVoid: () => ZodVoid,
1120
+ ZodUnknown: () => ZodUnknown,
1121
+ ZodUnion: () => ZodUnion,
1122
+ ZodUndefined: () => ZodUndefined,
1123
+ ZodType: () => ZodType,
1124
+ ZodTuple: () => ZodTuple,
1125
+ ZodTransformer: () => ZodEffects,
1126
+ ZodSymbol: () => ZodSymbol,
1127
+ ZodString: () => ZodString,
1128
+ ZodSet: () => ZodSet,
1129
+ ZodSchema: () => ZodType,
1130
+ ZodRecord: () => ZodRecord,
1131
+ ZodReadonly: () => ZodReadonly,
1132
+ ZodPromise: () => ZodPromise,
1133
+ ZodPipeline: () => ZodPipeline,
1134
+ ZodParsedType: () => ZodParsedType,
1135
+ ZodOptional: () => ZodOptional,
1136
+ ZodObject: () => ZodObject,
1137
+ ZodNumber: () => ZodNumber,
1138
+ ZodNullable: () => ZodNullable,
1139
+ ZodNull: () => ZodNull,
1140
+ ZodNever: () => ZodNever,
1141
+ ZodNativeEnum: () => ZodNativeEnum,
1142
+ ZodNaN: () => ZodNaN,
1143
+ ZodMap: () => ZodMap,
1144
+ ZodLiteral: () => ZodLiteral,
1145
+ ZodLazy: () => ZodLazy,
1146
+ ZodIssueCode: () => ZodIssueCode,
1147
+ ZodIntersection: () => ZodIntersection,
1148
+ ZodFunction: () => ZodFunction,
1149
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
1150
+ ZodError: () => ZodError,
1151
+ ZodEnum: () => ZodEnum,
1152
+ ZodEffects: () => ZodEffects,
1153
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
1154
+ ZodDefault: () => ZodDefault,
1155
+ ZodDate: () => ZodDate,
1156
+ ZodCatch: () => ZodCatch,
1157
+ ZodBranded: () => ZodBranded,
1158
+ ZodBoolean: () => ZodBoolean,
1159
+ ZodBigInt: () => ZodBigInt,
1160
+ ZodArray: () => ZodArray,
1161
+ ZodAny: () => ZodAny,
1162
+ Schema: () => ZodType,
1163
+ ParseStatus: () => ParseStatus,
1164
+ OK: () => OK,
1165
+ NEVER: () => NEVER,
1166
+ INVALID: () => INVALID,
1167
+ EMPTY_PATH: () => EMPTY_PATH,
1168
+ DIRTY: () => DIRTY,
1169
+ BRAND: () => BRAND
1170
1170
  });
1171
1171
 
1172
1172
  // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
@@ -8138,10 +8138,6 @@ function applyTransform(source, output, context = {}) {
8138
8138
  }
8139
8139
  }
8140
8140
 
8141
- // src/lib/asset-plan.ts
8142
- import { createHash as createHash3 } from "crypto";
8143
- import { isAbsolute as isAbsolute2, posix, resolve as resolve3 } from "path";
8144
-
8145
8141
  // src/lib/provider-version.ts
8146
8142
  function providerVersionSatisfies(version, range) {
8147
8143
  const current = parseProviderVersion(version);
@@ -8186,6 +8182,8 @@ function compareProviderVersions(left, right) {
8186
8182
  }
8187
8183
 
8188
8184
  // src/lib/asset-plan.ts
8185
+ import { createHash as createHash3 } from "crypto";
8186
+ import { isAbsolute as isAbsolute2, posix, resolve as resolve3 } from "path";
8189
8187
  var ASSET_PLAN_SCHEMA = "hasna.instructions.asset-plan/v1";
8190
8188
  var ASSET_CAPABILITY_SCHEMA = "hasna.instructions.asset-capability/v1";
8191
8189
  var ASSET_BUNDLE_SCHEMA = "hasna.instructions.asset-bundle/v1";
@@ -9593,16 +9591,51 @@ function indexHeader(tool, profile) {
9593
9591
  ].join(`
9594
9592
  `);
9595
9593
  }
9596
- function buildNativeImportFiles(targetHome, adapter, profile, sources) {
9594
+ var CLAUDE_PATHS_RULES_VERSION_RANGE = ">=2.1.84";
9595
+ function isCompiledClaudeGlobSource(adapter, source, providerVersion) {
9596
+ if (adapter.tool !== "claude")
9597
+ return false;
9598
+ if (providerVersion && !providerVersionSatisfies(providerVersion, CLAUDE_PATHS_RULES_VERSION_RANGE))
9599
+ return false;
9600
+ const compiledBinding = source.provenance?.["profileBinding"];
9601
+ if (!compiledBinding || typeof compiledBinding !== "object")
9602
+ return false;
9603
+ const activation = source.metadata?.["activation"];
9604
+ return activation?.mode === "glob";
9605
+ }
9606
+ function claudeGlobRuleFile(targetHome, index, source) {
9607
+ const globs = source.globs ?? [];
9608
+ if (globs.length === 0)
9609
+ throw new Error(`Claude glob source ${source.id} has no paths.`);
9610
+ const n = String(index + 1).padStart(2, "0");
9611
+ const relativePath = posix2.join("rules", `${n}-${source.normalizedId}.md`);
9612
+ const content = [
9613
+ "---",
9614
+ "paths:",
9615
+ ...globs.map((glob) => ` - ${yamlQuote2(glob)}`),
9616
+ "---",
9617
+ "",
9618
+ sectionForSource(source),
9619
+ ...source.resolvedRules.flatMap((rule) => ["", sectionForRule(source, rule)])
9620
+ ].join(`
9621
+ `);
9622
+ return makeFile(targetHome, relativePath, "rule", content, [source.id, ...source.resolvedRules.map((rule) => rule.id)]);
9623
+ }
9624
+ function buildNativeImportFiles(targetHome, adapter, profile, sources, providerVersion) {
9597
9625
  const indexFile = adapter.indexFile;
9598
- const fragments = sources.flatMap((source, index2) => [
9599
- makeFile(targetHome, fragmentPath(adapter, index2, source), "fragment", sectionForSource(source), [source.id]),
9600
- ...source.resolvedRules.map((rule) => makeFile(targetHome, ruleFragmentPath(adapter, source, rule), "rule", sectionForRule(source, rule), [source.id, rule.id]))
9601
- ]);
9626
+ const fragments = sources.flatMap((source, index2) => {
9627
+ if (isCompiledClaudeGlobSource(adapter, source, providerVersion))
9628
+ return [];
9629
+ return [
9630
+ makeFile(targetHome, fragmentPath(adapter, index2, source), "fragment", sectionForSource(source), [source.id]),
9631
+ ...source.resolvedRules.map((rule) => makeFile(targetHome, ruleFragmentPath(adapter, source, rule), "rule", sectionForRule(source, rule), [source.id, rule.id]))
9632
+ ];
9633
+ });
9634
+ const conditionalRules = sources.flatMap((source, index2) => isCompiledClaudeGlobSource(adapter, source, providerVersion) ? [claudeGlobRuleFile(targetHome, index2, source)] : []);
9602
9635
  const imports = fragments.map((file) => `@${importPath(indexFile, file.relativePath)}`);
9603
9636
  const index = makeFile(targetHome, indexFile, "index", [indexHeader(adapter.tool, profile), ...imports].join(`
9604
9637
  `), sources.map((source) => source.id));
9605
- return [index, ...fragments];
9638
+ return [index, ...fragments, ...conditionalRules];
9606
9639
  }
9607
9640
  function buildFlattenedMarkdownFiles(targetHome, adapter, profile, sources) {
9608
9641
  const content = [
@@ -9790,10 +9823,10 @@ function makeAntigravityRuleFile(targetHome, relativePath, content, sourceIds) {
9790
9823
  }
9791
9824
  return file;
9792
9825
  }
9793
- function buildFiles(targetHome, adapter, profile, sources, providerConfig) {
9826
+ function buildFiles(targetHome, adapter, profile, sources, providerConfig, providerVersion) {
9794
9827
  switch (adapter.mode) {
9795
9828
  case "native-imports":
9796
- return buildNativeImportFiles(targetHome, adapter, profile, sources);
9829
+ return buildNativeImportFiles(targetHome, adapter, profile, sources, providerVersion);
9797
9830
  case "flattened-markdown":
9798
9831
  return buildFlattenedMarkdownFiles(targetHome, adapter, profile, sources);
9799
9832
  case "cursor-mdc":
@@ -10040,7 +10073,7 @@ function planSessionRender(input) {
10040
10073
  if (input.providerConfig && input.tool !== "opencode") {
10041
10074
  throw new Error("Provider base config is supported only for OpenCode session renders.");
10042
10075
  }
10043
- const baseFiles = blocked ? [] : buildFiles(targetHome, adapter, input.profile, orderedSources, input.providerConfig);
10076
+ const baseFiles = blocked ? [] : buildFiles(targetHome, adapter, input.profile, orderedSources, input.providerConfig, input.provider_version);
10044
10077
  const projectContext = blocked ? null : composeProjectContextSessionRender({
10045
10078
  tool: input.tool,
10046
10079
  adapter_mode: adapter.mode,
@@ -10665,7 +10698,12 @@ function capability(provider, providerVersionRange, selectedRepresentation, load
10665
10698
  });
10666
10699
  }
10667
10700
  var DEFAULT_PROVIDER_CAPABILITIES = Object.freeze({
10668
- claude: capability("claude", ">=1.0.0", "native-import", "CLAUDE.md @ imports", { native_imports: true, asset_surface: "code" }),
10701
+ claude: capability("claude", ">=1.0.0", "native-import", "CLAUDE.md @ imports plus path-gated rules", {
10702
+ activation_modes: ["always", "glob"],
10703
+ native_imports: true,
10704
+ conditional_artifacts: true,
10705
+ asset_surface: "code"
10706
+ }),
10669
10707
  codex: capability("codex", ">=0.1.0", "flattened", "AGENTS.md", { asset_surface: "cli" }),
10670
10708
  cursor: capability("cursor", ">=1.0.0", "cursor-rule", ".cursor/rules/*.mdc", { activation_modes: ["always", "glob"], conditional_artifacts: true, asset_surface: "ide" }),
10671
10709
  opencode: capability("opencode", ">=1.0.0", "managed-fragment", "opencode.json instructions", { provider_variant: "v1-instructions", session_surface: "opencode-config-instructions" }),
@@ -11011,7 +11049,6 @@ function planProfileSessionRender(input) {
11011
11049
  });
11012
11050
  const {
11013
11051
  profile_id: _profileId,
11014
- provider_version: _providerVersion,
11015
11052
  configs: _configs,
11016
11053
  bindings: _bindings,
11017
11054
  asset_configs: _assetConfigs,
@@ -12210,7 +12247,7 @@ async function applyPreparedConfig(config, opts) {
12210
12247
  changed: outputResults.some((output) => output.changed)
12211
12248
  };
12212
12249
  }
12213
- if (!opts.dryRun) {
12250
+ if (!opts.dryRun && result.changed) {
12214
12251
  await store.updateConfig(config.id, { synced_at: new Date().toISOString() });
12215
12252
  }
12216
12253
  return result;
@@ -12916,7 +12953,7 @@ async function getConfigsStatus(store = resolveConfigStore(), options = {}) {
12916
12953
  let unredactedSecretFindings = 0;
12917
12954
  let knownTargets = 0;
12918
12955
  for (const config of fileConfigs) {
12919
- unredactedSecretFindings += scanSecrets(config.content, config.format).length;
12956
+ unredactedSecretFindings += scanSecrets(config.content, redactFormatForTarget(config.target_path ?? "", config.format)).length;
12920
12957
  if (isRetiredOrUnsupportedConfigAgent(config.agent))
12921
12958
  continue;
12922
12959
  if (!config.target_path)
@@ -12928,7 +12965,7 @@ async function getConfigsStatus(store = resolveConfigStore(), options = {}) {
12928
12965
  continue;
12929
12966
  }
12930
12967
  const disk = readFileSync9(targetPath, "utf-8");
12931
- const { content: redactedDisk } = redactContent(disk, config.format);
12968
+ const { content: redactedDisk } = redactContent(disk, redactFormatForTarget(config.target_path, config.format));
12932
12969
  if (redactedDisk !== config.content) {
12933
12970
  driftedTargets += 1;
12934
12971
  }
@@ -13751,21 +13788,24 @@ function planFileResult(plan, file, targetHome, previousHashes, previousManifest
13751
13788
  function assertNotSilentManagedWipeout(plan, results) {
13752
13789
  if (plan.allowEmptySources)
13753
13790
  return;
13754
- const managedDir = plan.adapter.managedDir;
13755
- const underManagedDir = (relativePath) => relativePath === managedDir || relativePath.startsWith(`${managedDir}/`);
13756
- const staleDeletions = results.filter((result) => result.action === "delete" && underManagedDir(result.relativePath));
13791
+ const staleDeletions = results.filter((result) => result.action === "delete" && isPlanManagedFile(plan, result.relativePath, result.role));
13757
13792
  if (staleDeletions.length === 0)
13758
13793
  return;
13759
- const managedRetained = results.some((result) => result.action !== "delete" && underManagedDir(result.relativePath));
13794
+ const managedRetained = results.some((result) => result.action !== "delete" && isPlanManagedFile(plan, result.relativePath, result.role));
13760
13795
  if (managedRetained)
13761
13796
  return;
13762
- throw new SessionApplyError(`Session render plan for ${plan.tool} (${plan.adapter.mode}) would delete ${staleDeletions.length} ` + `previously managed file(s) under "${managedDir}" and create or update none there: ` + `${staleDeletions.map((result) => result.relativePath).join(", ")}. ` + "Pass --allow-empty-sources only for explicit empty renders.");
13797
+ throw new SessionApplyError(`Session render plan for ${plan.tool} (${plan.adapter.mode}) would delete ${staleDeletions.length} ` + "previously managed file(s) and create or update none: " + `${staleDeletions.map((result) => result.relativePath).join(", ")}. ` + "Pass --allow-empty-sources only for explicit empty renders.");
13798
+ }
13799
+ function isPlanManagedFile(plan, relativePath, role) {
13800
+ const managedDir = plan.adapter.managedDir;
13801
+ if (relativePath === managedDir || relativePath.startsWith(`${managedDir}/`))
13802
+ return true;
13803
+ return plan.tool === "claude" && role === "rule" && relativePath.startsWith("rules/");
13763
13804
  }
13764
13805
  function planStaleFileResults(plan, targetHome, previousManifest, currentRelativePaths, options) {
13765
13806
  if (!previousManifest)
13766
13807
  return [];
13767
- const managedPrefix = `${plan.adapter.managedDir}/`;
13768
- return previousManifest.files.filter((file) => !currentRelativePaths.has(file.relativePath)).filter((file) => file.relativePath === plan.adapter.managedDir || file.relativePath.startsWith(managedPrefix)).map((file) => planStaleFileResult(file, targetHome, options)).filter((result) => result !== null);
13808
+ return previousManifest.files.filter((file) => !currentRelativePaths.has(file.relativePath)).filter((file) => isPlanManagedFile(plan, file.relativePath, file.role)).map((file) => planStaleFileResult(file, targetHome, options)).filter((result) => result !== null);
13769
13809
  }
13770
13810
  function planStaleFileResult(file, targetHome, options) {
13771
13811
  const target = resolveManifestRelativePath(file.relativePath, targetHome);
@@ -14332,14 +14372,15 @@ async function syncFromDir(dir, opts = {}) {
14332
14372
  continue;
14333
14373
  }
14334
14374
  const targetPath = file.replace(home, "~");
14375
+ const redacted = redactContent(content, redactFormatForTarget(targetPath, detectFormat(file)));
14335
14376
  const existing = allConfigs.find((c) => c.target_path === targetPath);
14336
14377
  if (!existing) {
14337
14378
  if (!opts.dryRun)
14338
- 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 });
14339
14380
  result.added++;
14340
- } else if (existing.content !== content) {
14381
+ } else if (existing.content !== redacted.content) {
14341
14382
  if (!opts.dryRun)
14342
- await store.updateConfig(existing.id, { content });
14383
+ await store.updateConfig(existing.id, { content: redacted.content });
14343
14384
  result.updated++;
14344
14385
  } else {
14345
14386
  result.unchanged++;
@@ -14647,7 +14688,7 @@ async function syncKnown(opts = {}) {
14647
14688
  continue;
14648
14689
  }
14649
14690
  const fmt = known.format ?? detectFormat(abs);
14650
- const redacted = redactContent(rawContent, fmt);
14691
+ const redacted = redactContent(rawContent, redactFormatForTarget(abs, fmt));
14651
14692
  const machineAware = templateizeMachineContent(redacted.content, machine);
14652
14693
  const content = machineAware.content;
14653
14694
  const isTemplate2 = redacted.isTemplate || machineAware.changed;
@@ -15395,163 +15436,163 @@ function toPosix(path) {
15395
15436
  return path.split("\\").join("/");
15396
15437
  }
15397
15438
  export {
15398
- AGENT_OPERATING_RULES_SEMANTIC_POLICY_KEY,
15399
- AGENT_OPERATING_RULES_SENTINEL_PATTERN,
15400
- ASSET_BUNDLE_SCHEMA,
15401
- ASSET_CAPABILITY_DESCRIPTORS,
15402
- ASSET_CAPABILITY_SCHEMA,
15403
- ASSET_DESTINATION_STRATEGIES,
15404
- ASSET_KINDS,
15405
- ASSET_PLAN_SCHEMA,
15406
- ASSET_ROLLBACK_POLICIES,
15407
- ASSET_SCOPES,
15408
- ASSET_UNINSTALL_POLICIES,
15409
- AssetPlanValidationError,
15410
- CODEWITH_NATIVE_IMPORTS_ENV,
15411
- CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE,
15412
- CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT,
15413
- CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG,
15414
- CONFIG_AGENTS,
15415
- CONFIG_CATEGORIES,
15416
- CONFIG_FORMATS,
15417
- CONFIG_KINDS,
15418
- CONFIG_TRANSFORMS,
15419
- CloudConfigStore,
15420
- CloudHttpError,
15421
- ConfigApplyError,
15422
- ConfigNotFoundError,
15423
- DANGEROUS_OPERATION_GUARD_STANDARD_CONTENT,
15424
- DANGEROUS_OPERATION_GUARD_STANDARD_SLUG,
15425
- GLOBAL_AGENT_RULES_STANDARD_CONTENT,
15426
- GLOBAL_AGENT_RULES_STANDARD_SLUG,
15427
- INBOX_CONVERSATIONS_MINIMUM_VERSION,
15428
- INSTRUCTION_ACTIVATION_MODES,
15429
- INSTRUCTION_FALLBACKS,
15430
- INSTRUCTION_GRAPH_PLAN_SCHEMA,
15431
- InstructionGraphValidationError,
15432
- KNOWN_CONFIGS,
15433
- LEGACY_CONFIGS_COMPAT_VERSION,
15434
- LEGACY_CONFIGS_EXECUTABLE,
15435
- LEGACY_CONFIGS_PACKAGE,
15436
- LocalConfigStore,
15437
- PG_MIGRATIONS,
15438
- PLATFORM_PROFILE_PRESETS,
15439
- PROFILE_ASSET_BINDING_SCHEMA,
15440
- PROFILE_CONFIG_BINDING_SCHEMA,
15441
- PROJECT_CONFIG_FILES,
15442
- PROJECT_CONTEXT_CACHE_PATH,
15443
- PROJECT_CONTEXT_FRAGMENT_PATH,
15444
- PROJECT_CONTEXT_LOCK_PATH,
15445
- PROJECT_CONTEXT_MANAGED_COMMENT,
15446
- PROJECT_CONTEXT_MANIFEST_PATH,
15447
- PROJECT_CONTEXT_MAX_COMMANDS,
15448
- PROJECT_CONTEXT_MAX_INPUT_BYTES,
15449
- PROJECT_CONTEXT_MAX_RENDERED_BYTES,
15450
- PROJECT_CONTEXT_SCHEMA,
15451
- PROJECT_DASHBOARD_PROFILE_VARIABLES,
15452
- PROJECT_DASHBOARD_STANDARD_CONTENT,
15453
- PROJECT_DASHBOARD_STANDARD_SLUG,
15454
- PROVIDER_CAPABILITIES,
15455
- PROVIDER_CAPABILITY_DESCRIPTORS,
15456
- PROVIDER_CAPABILITY_SCHEMA,
15457
- ProfileNotFoundError,
15458
- ProjectContextError,
15459
- RAW_STORE_ROOT_ENV,
15460
- SESSION_INSTRUCTION_LAYERS,
15461
- SESSION_LAYER_RANK,
15462
- SESSION_RENDER_MANAGED_MARKER,
15463
- SESSION_RENDER_SCHEMA,
15464
- SESSION_RENDER_TOOLS,
15465
- SESSION_TOOL_ADAPTERS,
15466
- SessionApplyError,
15467
- TemplateRenderError,
15468
- applyConfig,
15469
- applyConfigs,
15470
- applyConfigsWithReport,
15471
- applyProjectContext,
15472
- applySessionRender,
15473
- applyTransform,
15474
- assetBundleFromConfig,
15475
- boundedReadPage,
15476
- buildCodexAgentsMd,
15477
- buildCursorMdc,
15478
- buildOpenCodeAgentsMd,
15479
- checkSessionRenderDrift,
15480
- cleanSessionPathInput,
15481
- compareAgentOperatingRulesVersions,
15482
- compileAssetPlan,
15483
- compileInstructionGraph,
15484
- computeProjectContextSourceHash,
15485
- configAssetDigest,
15486
- configAssetLocator,
15487
- currentArch2 as currentArch,
15488
- currentHostname2 as currentHostname,
15489
- currentOs,
15490
- detectAgent,
15491
- detectCategory,
15492
- detectFormat,
15493
- detectMachineContext,
15494
- diffConfig,
15495
- ensureCodewithSharedTodosStorageStandardConfig,
15496
- ensureDangerousOperationGuardStandardConfig,
15497
- ensureGlobalAgentRulesStandardConfig,
15498
- ensurePlatformProfiles,
15499
- ensureProjectDashboardStandardConfig,
15500
- expandPath,
15501
- exportConfigs,
15502
- extractTemplateVars,
15503
- getConfigsStatus,
15504
- getRawStoreRoot,
15505
- hasSecrets,
15506
- importConfigs,
15507
- inspectManagedSkillRuntimes,
15508
- isApiTransport,
15509
- isTemplate,
15510
- legacyProfileConfigBinding,
15511
- machineContextToVariables,
15512
- normalizeBoundedReadOptions,
15513
- normalizeOsFamily,
15514
- normalizeProfileAssetBinding,
15515
- normalizeProfileConfigBinding,
15516
- now,
15517
- parseAgentOperatingRulesVersion,
15518
- parseProjectContextBundle,
15519
- parseTemplateVars,
15520
- planProfileSessionRender,
15521
- planProjectContext,
15522
- planSessionRender,
15523
- previewConfigs,
15524
- providerVersionSatisfies,
15525
- reconcileManagedSkillRuntimes,
15526
- redactContent,
15527
- renderMachineAwareContent,
15528
- renderMachineAwareContentPreview,
15529
- renderTemplate,
15530
- renderTemplatePreview,
15531
- resolveAgentOperatingRulesPayload,
15532
- resolveAssetDestination,
15533
- resolveCloudConfig,
15534
- resolveConfigStore,
15535
- resolveProfileVariables,
15536
- resolveSessionPath,
15537
- resolveSessionTargetOwnership,
15538
- restoreSessionRenderSnapshot,
15539
- scanPackageManagerSecrets,
15540
- scanSecrets,
15541
- selectAssetCapability,
15542
- selectProfileConfigsForSessionRender,
15543
- selectProviderCapability,
15544
- slugify,
15545
- sourceFromConfig,
15546
- sourceFromFilePath,
15547
- sourcesFromIdentityExport,
15548
- stripClaudeOnlySections,
15549
- syncFromDir,
15550
- syncKnown,
15551
- syncProject,
15552
- syncToDir,
15553
- syncToDisk,
15554
- templateizeMachineContent,
15439
+ uuid,
15555
15440
  transformSkillContent,
15556
- uuid
15441
+ templateizeMachineContent,
15442
+ syncToDisk,
15443
+ syncToDir,
15444
+ syncProject,
15445
+ syncKnown,
15446
+ syncFromDir,
15447
+ stripClaudeOnlySections,
15448
+ sourcesFromIdentityExport,
15449
+ sourceFromFilePath,
15450
+ sourceFromConfig,
15451
+ slugify,
15452
+ selectProviderCapability,
15453
+ selectProfileConfigsForSessionRender,
15454
+ selectAssetCapability,
15455
+ scanSecrets,
15456
+ scanPackageManagerSecrets,
15457
+ restoreSessionRenderSnapshot,
15458
+ resolveSessionTargetOwnership,
15459
+ resolveSessionPath,
15460
+ resolveProfileVariables,
15461
+ resolveConfigStore,
15462
+ resolveCloudConfig,
15463
+ resolveAssetDestination,
15464
+ resolveAgentOperatingRulesPayload,
15465
+ renderTemplatePreview,
15466
+ renderTemplate,
15467
+ renderMachineAwareContentPreview,
15468
+ renderMachineAwareContent,
15469
+ redactContent,
15470
+ reconcileManagedSkillRuntimes,
15471
+ providerVersionSatisfies,
15472
+ previewConfigs,
15473
+ planSessionRender,
15474
+ planProjectContext,
15475
+ planProfileSessionRender,
15476
+ parseTemplateVars,
15477
+ parseProjectContextBundle,
15478
+ parseAgentOperatingRulesVersion,
15479
+ now,
15480
+ normalizeProfileConfigBinding,
15481
+ normalizeProfileAssetBinding,
15482
+ normalizeOsFamily,
15483
+ normalizeBoundedReadOptions,
15484
+ machineContextToVariables,
15485
+ legacyProfileConfigBinding,
15486
+ isTemplate,
15487
+ isApiTransport,
15488
+ inspectManagedSkillRuntimes,
15489
+ importConfigs,
15490
+ hasSecrets,
15491
+ getRawStoreRoot,
15492
+ getConfigsStatus,
15493
+ extractTemplateVars,
15494
+ exportConfigs,
15495
+ expandPath,
15496
+ ensureProjectDashboardStandardConfig,
15497
+ ensurePlatformProfiles,
15498
+ ensureGlobalAgentRulesStandardConfig,
15499
+ ensureDangerousOperationGuardStandardConfig,
15500
+ ensureCodewithSharedTodosStorageStandardConfig,
15501
+ diffConfig,
15502
+ detectMachineContext,
15503
+ detectFormat,
15504
+ detectCategory,
15505
+ detectAgent,
15506
+ currentOs,
15507
+ currentHostname2 as currentHostname,
15508
+ currentArch2 as currentArch,
15509
+ configAssetLocator,
15510
+ configAssetDigest,
15511
+ computeProjectContextSourceHash,
15512
+ compileInstructionGraph,
15513
+ compileAssetPlan,
15514
+ compareAgentOperatingRulesVersions,
15515
+ cleanSessionPathInput,
15516
+ checkSessionRenderDrift,
15517
+ buildOpenCodeAgentsMd,
15518
+ buildCursorMdc,
15519
+ buildCodexAgentsMd,
15520
+ boundedReadPage,
15521
+ assetBundleFromConfig,
15522
+ applyTransform,
15523
+ applySessionRender,
15524
+ applyProjectContext,
15525
+ applyConfigsWithReport,
15526
+ applyConfigs,
15527
+ applyConfig,
15528
+ TemplateRenderError,
15529
+ SessionApplyError,
15530
+ SESSION_TOOL_ADAPTERS,
15531
+ SESSION_RENDER_TOOLS,
15532
+ SESSION_RENDER_SCHEMA,
15533
+ SESSION_RENDER_MANAGED_MARKER,
15534
+ SESSION_LAYER_RANK,
15535
+ SESSION_INSTRUCTION_LAYERS,
15536
+ RAW_STORE_ROOT_ENV,
15537
+ ProjectContextError,
15538
+ ProfileNotFoundError,
15539
+ PROVIDER_CAPABILITY_SCHEMA,
15540
+ PROVIDER_CAPABILITY_DESCRIPTORS,
15541
+ PROVIDER_CAPABILITIES,
15542
+ PROJECT_DASHBOARD_STANDARD_SLUG,
15543
+ PROJECT_DASHBOARD_STANDARD_CONTENT,
15544
+ PROJECT_DASHBOARD_PROFILE_VARIABLES,
15545
+ PROJECT_CONTEXT_SCHEMA,
15546
+ PROJECT_CONTEXT_MAX_RENDERED_BYTES,
15547
+ PROJECT_CONTEXT_MAX_INPUT_BYTES,
15548
+ PROJECT_CONTEXT_MAX_COMMANDS,
15549
+ PROJECT_CONTEXT_MANIFEST_PATH,
15550
+ PROJECT_CONTEXT_MANAGED_COMMENT,
15551
+ PROJECT_CONTEXT_LOCK_PATH,
15552
+ PROJECT_CONTEXT_FRAGMENT_PATH,
15553
+ PROJECT_CONTEXT_CACHE_PATH,
15554
+ PROJECT_CONFIG_FILES,
15555
+ PROFILE_CONFIG_BINDING_SCHEMA,
15556
+ PROFILE_ASSET_BINDING_SCHEMA,
15557
+ PLATFORM_PROFILE_PRESETS,
15558
+ PG_MIGRATIONS,
15559
+ LocalConfigStore,
15560
+ LEGACY_CONFIGS_PACKAGE,
15561
+ LEGACY_CONFIGS_EXECUTABLE,
15562
+ LEGACY_CONFIGS_COMPAT_VERSION,
15563
+ KNOWN_CONFIGS,
15564
+ InstructionGraphValidationError,
15565
+ INSTRUCTION_GRAPH_PLAN_SCHEMA,
15566
+ INSTRUCTION_FALLBACKS,
15567
+ INSTRUCTION_ACTIVATION_MODES,
15568
+ INBOX_CONVERSATIONS_MINIMUM_VERSION,
15569
+ GLOBAL_AGENT_RULES_STANDARD_SLUG,
15570
+ GLOBAL_AGENT_RULES_STANDARD_CONTENT,
15571
+ DANGEROUS_OPERATION_GUARD_STANDARD_SLUG,
15572
+ DANGEROUS_OPERATION_GUARD_STANDARD_CONTENT,
15573
+ ConfigNotFoundError,
15574
+ ConfigApplyError,
15575
+ CloudHttpError,
15576
+ CloudConfigStore,
15577
+ CONFIG_TRANSFORMS,
15578
+ CONFIG_KINDS,
15579
+ CONFIG_FORMATS,
15580
+ CONFIG_CATEGORIES,
15581
+ CONFIG_AGENTS,
15582
+ CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG,
15583
+ CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT,
15584
+ CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE,
15585
+ CODEWITH_NATIVE_IMPORTS_ENV,
15586
+ AssetPlanValidationError,
15587
+ ASSET_UNINSTALL_POLICIES,
15588
+ ASSET_SCOPES,
15589
+ ASSET_ROLLBACK_POLICIES,
15590
+ ASSET_PLAN_SCHEMA,
15591
+ ASSET_KINDS,
15592
+ ASSET_DESTINATION_STRATEGIES,
15593
+ ASSET_CAPABILITY_SCHEMA,
15594
+ ASSET_CAPABILITY_DESCRIPTORS,
15595
+ ASSET_BUNDLE_SCHEMA,
15596
+ AGENT_OPERATING_RULES_SENTINEL_PATTERN,
15597
+ AGENT_OPERATING_RULES_SEMANTIC_POLICY_KEY
15557
15598
  };