@hasna/skills 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/index.js CHANGED
@@ -36868,7 +36868,7 @@ var package_default;
36868
36868
  var init_package = __esm(() => {
36869
36869
  package_default = {
36870
36870
  name: "@hasna/skills",
36871
- version: "0.9.6",
36871
+ version: "0.9.7",
36872
36872
  description: "Skills library for AI coding agents",
36873
36873
  type: "module",
36874
36874
  bin: {
@@ -108033,7 +108033,7 @@ var init_codex_hook_rpc = __esm(() => {
108033
108033
 
108034
108034
  // src/lib/codex-hook-trust-layout.ts
108035
108035
  import { isDeepStrictEqual as isDeepStrictEqual5 } from "util";
108036
- function codexTrustTextWitness(text3, keys3) {
108036
+ function codexTrustTextWitness(text3, keys3, canonicalize = true) {
108037
108037
  const parsed = Bun.TOML.parse(text3), wanted = new Set(keys3);
108038
108038
  const headers = [...text3.matchAll(/^[ \t]*(\[[^\r\n]+\])[ \t]*(#[^\r\n]*)?(?:\r?\n|$)/gm)];
108039
108039
  if (headers.length > 512)
@@ -108105,9 +108105,19 @@ function codexTrustTextWitness(text3, keys3) {
108105
108105
  let result2 = text3;
108106
108106
  for (const span of replacements2.reverse())
108107
108107
  result2 = result2.slice(0, span.start) + span.comments + result2.slice(span.end);
108108
- return canonicalizeTableOrder(result2).split(/\r?\n/).filter((line) => line.trim()).join(`
108108
+ return (canonicalize ? canonicalizeTableOrder(result2) : result2).split(/\r?\n/).filter((line) => line.trim()).join(`
108109
108109
  `);
108110
108110
  }
108111
+ function codexTrustReconcileWitness(text3, keys3) {
108112
+ return codexTrustTextWitness(text3, keys3, false).replace(/[ \t]+$/gm, "");
108113
+ }
108114
+ function codexTrustUnmanagedSemantic(text3, keys3) {
108115
+ const parsed = structuredClone(Bun.TOML.parse(text3));
108116
+ for (const key of keys3)
108117
+ if (parsed.hooks?.state?.[key] !== undefined)
108118
+ delete parsed.hooks.state[key];
108119
+ return JSON.stringify(stableSemantic(prune(parsed)));
108120
+ }
108111
108121
  var fail4 = () => new Error('CODEX_HOOK_TRUST_UNSUPPORTED_LAYOUT: preserve and convert hook trust to ordinary [hooks.state."<key>"] tables before enrollment'), prune = (value) => {
108112
108122
  if (value.hooks?.state && !Object.keys(value.hooks.state).length)
108113
108123
  delete value.hooks.state;
@@ -108146,6 +108156,12 @@ var fail4 = () => new Error('CODEX_HOOK_TRUST_UNSUPPORTED_LAYOUT: preserve and c
108146
108156
  const simple = blocks.filter((block) => !block.key.startsWith("[["));
108147
108157
  const arrays = blocks.filter((block) => block.key.startsWith("[["));
108148
108158
  return prefix + [...simple, ...arrays].map((block) => block.text).join("");
108159
+ }, stableSemantic = (value) => {
108160
+ if (Array.isArray(value))
108161
+ return value.map(stableSemantic);
108162
+ if (value && typeof value === "object")
108163
+ return Object.fromEntries(Object.keys(value).sort().map((key) => [key, stableSemantic(value[key])]));
108164
+ return value;
108149
108165
  };
108150
108166
  var init_codex_hook_trust_layout = () => {};
108151
108167
 
@@ -108268,7 +108284,9 @@ async function reconcileCodexNativeHooks(options, connect = connectCodexHookRpc)
108268
108284
  need4(isDeepStrictEqual6(intent.hooks, admitted.filter((hook) => !hook.enabled || hook.trustStatus !== "trusted")), "RECONCILE_INTENT_HOOKS_CHANGED");
108269
108285
  need4(configBefore.sha256 === intent.beforeSha256 && hooksBefore.sha256 === intent.hooksSha256 && policyBefore.sha256 === intent.policySha256, "RECONCILE_JOURNAL_CHANGED");
108270
108286
  const currentConfig = snapshot(intent.configPath, true);
108271
- need4(codexTrustTextWitness(configBefore.text, intent.hooks.map((h) => h.key)) === codexTrustTextWitness(currentConfig.text, intent.hooks.map((h) => h.key)), "RECONCILE_UNRELATED_CONFIG_CHANGED");
108287
+ const managedKeys = intent.hooks.map((h) => h.key);
108288
+ need4(codexTrustReconcileWitness(configBefore.text, managedKeys) === codexTrustReconcileWitness(currentConfig.text, managedKeys), "RECONCILE_UNRELATED_CONFIG_CHANGED");
108289
+ need4(codexTrustUnmanagedSemantic(configBefore.text, managedKeys) === codexTrustUnmanagedSemantic(currentConfig.text, managedKeys), "RECONCILE_UNRELATED_CONFIG_CHANGED");
108272
108290
  const before2 = structure(configBefore.text), current = structure(currentConfig.text), expectedConfig = structuredClone(before2);
108273
108291
  expectedConfig.hooks ??= {};
108274
108292
  expectedConfig.hooks.state ??= {};
@@ -108638,8 +108656,10 @@ function registerAgentIntegration(parent) {
108638
108656
  process.exitCode = 1;
108639
108657
  }
108640
108658
  });
108641
- const trust = hook.command("trust").requiredOption("--agent <agent>", "Native trust adapter (codex)").option("--codex-command <path>", "Installed Codex executable used for its native configuration API", "codex").option("--apply", "Enable and trust only the exact managed Skills hook identities", false).option("--plan-digest <sha256>", "Exact reviewed dry-run digest required with --apply").option("--json", "Output the native trust plan or receipt", false).description("Plan or enroll exact Skills hooks through Codex native trust controls").action(async (options) => {
108659
+ const trust = hook.command("trust").option("--agent <agent>", "Native trust adapter (codex)").option("--codex-command <path>", "Installed Codex executable used for its native configuration API", "codex").option("--apply", "Enable and trust only the exact managed Skills hook identities", false).option("--plan-digest <sha256>", "Exact reviewed dry-run digest required with --apply").option("--json", "Output the native trust plan or receipt", false).description("Plan or enroll exact Skills hooks through Codex native trust controls").action(async (options) => {
108642
108660
  try {
108661
+ if (!options.agent)
108662
+ throw new Error("Native trust enrollment requires --agent codex");
108643
108663
  if (options.agent !== "codex")
108644
108664
  throw new Error("Native trust enrollment currently supports --agent codex only");
108645
108665
  const result2 = await enrollCodexNativeHooks({ codexCommand: options.codexCommand, apply: options.apply, reviewedPlanDigest: options.planDigest });
package/bin/mcp.js CHANGED
@@ -20019,7 +20019,7 @@ var package_default;
20019
20019
  var init_package = __esm(() => {
20020
20020
  package_default = {
20021
20021
  name: "@hasna/skills",
20022
- version: "0.9.6",
20022
+ version: "0.9.7",
20023
20023
  description: "Skills library for AI coding agents",
20024
20024
  type: "module",
20025
20025
  bin: {
package/bin/migrate.js CHANGED
@@ -7,7 +7,7 @@ import { join as join5 } from "path";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@hasna/skills",
10
- version: "0.9.6",
10
+ version: "0.9.7",
11
11
  description: "Skills library for AI coding agents",
12
12
  type: "module",
13
13
  bin: {
package/bin/server.js CHANGED
@@ -24122,7 +24122,7 @@ var init_dist_es9 = __esm(() => {
24122
24122
  // package.json
24123
24123
  var package_default = {
24124
24124
  name: "@hasna/skills",
24125
- version: "0.9.6",
24125
+ version: "0.9.7",
24126
24126
  description: "Skills library for AI coding agents",
24127
24127
  type: "module",
24128
24128
  bin: {
package/bin/worker.js CHANGED
@@ -24125,7 +24125,7 @@ import { randomUUID as randomUUID6 } from "crypto";
24125
24125
  // package.json
24126
24126
  var package_default = {
24127
24127
  name: "@hasna/skills",
24128
- version: "0.9.6",
24128
+ version: "0.9.7",
24129
24129
  description: "Skills library for AI coding agents",
24130
24130
  type: "module",
24131
24131
  bin: {
package/dist/index.js CHANGED
@@ -11448,7 +11448,7 @@ import { isAbsolute as isAbsolute10, join as join20, resolve as resolve10 } from
11448
11448
  // package.json
11449
11449
  var package_default = {
11450
11450
  name: "@hasna/skills",
11451
- version: "0.9.6",
11451
+ version: "0.9.7",
11452
11452
  description: "Skills library for AI coding agents",
11453
11453
  type: "module",
11454
11454
  bin: {
@@ -1,3 +1,9 @@
1
1
  /** Conservative admission and text witness, never a TOML writer. Native Codex
2
2
  * performs the versioned write; unrecognized inline/dotted trust shapes refuse. */
3
- export declare function codexTrustTextWitness(text: string, keys: string[]): string;
3
+ export declare function codexTrustTextWitness(text: string, keys: string[], canonicalize?: boolean): string;
4
+ /** Reconciliation witness: retain table/array order while tolerating only
5
+ * blank-line and line-ending formatting emitted by the native writer. */
6
+ export declare function codexTrustReconcileWitness(text: string, keys: string[]): string;
7
+ /** Parsed unmanaged TOML semantics. Arrays retain order; managed trust entries
8
+ * are excluded by exact journal key and all other keys/values remain bound. */
9
+ export declare function codexTrustUnmanagedSemantic(text: string, keys: string[]): string;
package/dist/sdk/index.js CHANGED
@@ -32373,7 +32373,7 @@ var init_event_sink = __esm(() => {
32373
32373
  // package.json
32374
32374
  var package_default = {
32375
32375
  name: "@hasna/skills",
32376
- version: "0.9.6",
32376
+ version: "0.9.7",
32377
32377
  description: "Skills library for AI coding agents",
32378
32378
  type: "module",
32379
32379
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/skills",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Skills library for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {