@hasna/instructions 0.5.1 → 0.5.3
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/index.js +33 -4
- package/dist/index.js +12 -2
- package/dist/lib/cursor-authority.d.ts +11 -2
- package/dist/lib/cursor-authority.d.ts.map +1 -1
- package/dist/mcp/index.js +19 -3
- package/dist/server/index.js +73 -105
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -10828,8 +10828,18 @@ function isCursorGlobalAuthorityPath(path) {
|
|
|
10828
10828
|
return resolve4(path) === resolve4(join6(homeDir(), CURSOR_GLOBAL_AUTHORITY_RELATIVE_PATH));
|
|
10829
10829
|
}
|
|
10830
10830
|
function stampCursorGlobalAuthorityMarker(content) {
|
|
10831
|
-
|
|
10832
|
-
|
|
10831
|
+
const existing = content.match(CURSOR_GLOBAL_AUTHORITY_MARKER_PATTERN);
|
|
10832
|
+
if (existing) {
|
|
10833
|
+
const markerLine2 = existing[0];
|
|
10834
|
+
const index = existing.index ?? content.indexOf(markerLine2);
|
|
10835
|
+
const payload = markerPayload(content, markerLine2, index);
|
|
10836
|
+
if (sha2564(payload) === existing[1].slice("sha256:".length)) {
|
|
10837
|
+
return content;
|
|
10838
|
+
}
|
|
10839
|
+
const digest2 = sha2564(payload);
|
|
10840
|
+
const freshMarkerLine = `<!-- ${CURSOR_GLOBAL_AUTHORITY_MANAGED_MARKER} hash=sha256:${digest2} -->`;
|
|
10841
|
+
return content.slice(0, index) + freshMarkerLine + content.slice(index + markerLine2.length);
|
|
10842
|
+
}
|
|
10833
10843
|
const digest = sha2564(content);
|
|
10834
10844
|
const markerLine = `<!-- ${CURSOR_GLOBAL_AUTHORITY_MANAGED_MARKER} hash=sha256:${digest} -->`;
|
|
10835
10845
|
const frontmatter = content.match(CURSOR_GLOBAL_AUTHORITY_FRONTMATTER_PATTERN)?.[0];
|
|
@@ -20739,7 +20749,7 @@ projectContextCmd.command("apply").description("Atomically write project context
|
|
|
20739
20749
|
}
|
|
20740
20750
|
});
|
|
20741
20751
|
var sessionCmd = program.command("session").description("Plan and apply session-scoped agent instruction files");
|
|
20742
|
-
sessionCmd.command("plan").description("Produce a dry-run render plan for profile-scoped instruction injection").requiredOption("--tool <tool>", `target tool (${SESSION_RENDER_TOOLS.join("|")})`).requiredOption("--profile <profile>", "account/profile name that owns the rendered instruction home").option("--target-home <path>", "override generated profile-scoped target home").option("--project-root <path>", "repository root for project-scoped adapters such as Cursor").option("--session-id <id>", "session id to include in the manifest").option("--source <layer:id=path>", `instruction source file; layers: ${SESSION_SOURCE_LAYER_HELP}`, collectOption, []).option("--config <layer:id-or-slug>", "stored config source by id/slug; repeatable; layer aliases match --source", collectOption, []).option("--identity-export <path>", "OpenIdentities configs instruction export JSON; repeatable", collectOption, []).option("--replace-source <replacer-id>[=<target-source-id>]", "source id that broadly replaces earlier layers, or targets one earlier source", collectOption, []).option("--compile-profile <id-or-slug>", "compile persisted config bindings from this Instructions profile").option("--provider-version <semver>", "installed provider version used for capability matching").option("--provider-variant <variant>", "explicit provider capability variant (for example OpenCode v2-agents)").option("--model <model>", "active model used for model activation").option("--path <path>", "active path recorded in the graph context").option("--manual <config-id-or-slug>", "manually activate a binding; repeatable", collectOption, []).option("--asset-surface <surface>", "explicit provider asset surface (for example cline cli or ide)").option("--asset-scope <scope>", "asset scope (global|project|session)").option("--allow-asset-installers", "opt in to planned provider installers; planning never invokes them").option("--codewith-native-imports", "select the gated Codewith native @ import adapter").option("--allow-empty-sources", "allow an explicit empty render plan").option("--check-global-coverage", "
|
|
20752
|
+
sessionCmd.command("plan").description("Produce a dry-run render plan for profile-scoped instruction injection").requiredOption("--tool <tool>", `target tool (${SESSION_RENDER_TOOLS.join("|")})`).requiredOption("--profile <profile>", "account/profile name that owns the rendered instruction home").option("--target-home <path>", "override generated profile-scoped target home").option("--project-root <path>", "repository root for project-scoped adapters such as Cursor").option("--session-id <id>", "session id to include in the manifest").option("--source <layer:id=path>", `instruction source file; layers: ${SESSION_SOURCE_LAYER_HELP}`, collectOption, []).option("--config <layer:id-or-slug>", "stored config source by id/slug; repeatable; layer aliases match --source", collectOption, []).option("--identity-export <path>", "OpenIdentities configs instruction export JSON; repeatable", collectOption, []).option("--replace-source <replacer-id>[=<target-source-id>]", "source id that broadly replaces earlier layers, or targets one earlier source", collectOption, []).option("--compile-profile <id-or-slug>", "compile persisted config bindings from this Instructions profile").option("--provider-version <semver>", "installed provider version used for capability matching").option("--provider-variant <variant>", "explicit provider capability variant (for example OpenCode v2-agents)").option("--model <model>", "active model used for model activation").option("--path <path>", "active path recorded in the graph context").option("--manual <config-id-or-slug>", "manually activate a binding; repeatable", collectOption, []).option("--asset-surface <surface>", "explicit provider asset surface (for example cline cli or ide)").option("--asset-scope <scope>", "asset scope (global|project|session)").option("--allow-asset-installers", "opt in to planned provider installers; planning never invokes them").option("--codewith-native-imports", "select the gated Codewith native @ import adapter").option("--allow-empty-sources", "allow an explicit empty render plan").option("--check-global-coverage", "verify every registered, non-retired global-* source is in this render (expected read fresh from the registry, independent of this plan); on shortfall warn, exit non-zero, and for apply refuse to write (todos 102d6d0a, O15-00694)").option("--no-station-profile", "do not inject the cached station-profile source").option("--json", "output dry-run JSON").action(async (opts) => {
|
|
20743
20753
|
try {
|
|
20744
20754
|
const tool = opts.tool;
|
|
20745
20755
|
if (!SESSION_RENDER_TOOLS.includes(tool)) {
|
|
@@ -20756,6 +20766,8 @@ sessionCmd.command("plan").description("Produce a dry-run render plan for profil
|
|
|
20756
20766
|
});
|
|
20757
20767
|
if (plan.blocked)
|
|
20758
20768
|
process.exitCode = 1;
|
|
20769
|
+
if (globalCoverage && !globalCoverage.complete)
|
|
20770
|
+
process.exitCode = 1;
|
|
20759
20771
|
return;
|
|
20760
20772
|
}
|
|
20761
20773
|
console.log(chalk.bold(`${plan.tool} session render plan`) + chalk.dim(` (${plan.adapter.mode})`));
|
|
@@ -20784,13 +20796,15 @@ sessionCmd.command("plan").description("Produce a dry-run render plan for profil
|
|
|
20784
20796
|
}
|
|
20785
20797
|
if (plan.blocked)
|
|
20786
20798
|
process.exitCode = 1;
|
|
20799
|
+
if (globalCoverage && !globalCoverage.complete)
|
|
20800
|
+
process.exitCode = 1;
|
|
20787
20801
|
console.log(chalk.dim("Dry run only. No files were written."));
|
|
20788
20802
|
} catch (e) {
|
|
20789
20803
|
console.error(chalk.red(formatCliError(e)));
|
|
20790
20804
|
process.exit(1);
|
|
20791
20805
|
}
|
|
20792
20806
|
});
|
|
20793
|
-
sessionCmd.command("apply").description("Write a session render plan to its managed target home or explicit project root").requiredOption("--tool <tool>", `target tool (${SESSION_RENDER_TOOLS.join("|")})`).requiredOption("--profile <profile>", "account/profile name that owns the rendered instruction home").option("--target-home <path>", "override generated profile-scoped target home").option("--project-root <path>", "repository root for project-scoped adapters such as Cursor").option("--session-id <id>", "session id to include in the manifest").option("--source <layer:id=path>", `instruction source file; layers: ${SESSION_SOURCE_LAYER_HELP}`, collectOption, []).option("--config <layer:id-or-slug>", "stored config source by id/slug; repeatable; layer aliases match --source", collectOption, []).option("--identity-export <path>", "OpenIdentities configs instruction export JSON; repeatable", collectOption, []).option("--replace-source <replacer-id>[=<target-source-id>]", "source id that broadly replaces earlier layers, or targets one earlier source", collectOption, []).option("--compile-profile <id-or-slug>", "compile persisted config bindings from this Instructions profile").option("--provider-version <semver>", "installed provider version used for capability matching").option("--provider-variant <variant>", "explicit provider capability variant (for example OpenCode v2-agents)").option("--model <model>", "active model used for model activation").option("--path <path>", "active path recorded in the graph context").option("--manual <config-id-or-slug>", "manually activate a binding; repeatable", collectOption, []).option("--asset-surface <surface>", "explicit provider asset surface (for example cline cli or ide)").option("--asset-scope <scope>", "asset scope (global|project|session)").option("--codewith-native-imports", "select the gated Codewith native @ import adapter").option("--allow-empty-sources", "allow an explicit empty render").option("--check-global-coverage", "
|
|
20807
|
+
sessionCmd.command("apply").description("Write a session render plan to its managed target home or explicit project root").requiredOption("--tool <tool>", `target tool (${SESSION_RENDER_TOOLS.join("|")})`).requiredOption("--profile <profile>", "account/profile name that owns the rendered instruction home").option("--target-home <path>", "override generated profile-scoped target home").option("--project-root <path>", "repository root for project-scoped adapters such as Cursor").option("--session-id <id>", "session id to include in the manifest").option("--source <layer:id=path>", `instruction source file; layers: ${SESSION_SOURCE_LAYER_HELP}`, collectOption, []).option("--config <layer:id-or-slug>", "stored config source by id/slug; repeatable; layer aliases match --source", collectOption, []).option("--identity-export <path>", "OpenIdentities configs instruction export JSON; repeatable", collectOption, []).option("--replace-source <replacer-id>[=<target-source-id>]", "source id that broadly replaces earlier layers, or targets one earlier source", collectOption, []).option("--compile-profile <id-or-slug>", "compile persisted config bindings from this Instructions profile").option("--provider-version <semver>", "installed provider version used for capability matching").option("--provider-variant <variant>", "explicit provider capability variant (for example OpenCode v2-agents)").option("--model <model>", "active model used for model activation").option("--path <path>", "active path recorded in the graph context").option("--manual <config-id-or-slug>", "manually activate a binding; repeatable", collectOption, []).option("--asset-surface <surface>", "explicit provider asset surface (for example cline cli or ide)").option("--asset-scope <scope>", "asset scope (global|project|session)").option("--codewith-native-imports", "select the gated Codewith native @ import adapter").option("--allow-empty-sources", "allow an explicit empty render").option("--check-global-coverage", "verify every registered, non-retired global-* source is in this render (expected read fresh from the registry, independent of this plan); on shortfall warn, exit non-zero, and for apply refuse to write (todos 102d6d0a, O15-00694)").option("--no-station-profile", "do not inject the cached station-profile source").option("--dry-run", "preview writes and conflicts without writing").option("--force", "overwrite existing unmanaged files").option("--json", "output apply JSON").action(async (opts) => {
|
|
20794
20808
|
try {
|
|
20795
20809
|
const tool = opts.tool;
|
|
20796
20810
|
if (!SESSION_RENDER_TOOLS.includes(tool)) {
|
|
@@ -20800,6 +20814,21 @@ sessionCmd.command("apply").description("Write a session render plan to its mana
|
|
|
20800
20814
|
const store = resolveConfigStore();
|
|
20801
20815
|
const plan = await buildSessionRenderPlan(opts, tool, store, "apply");
|
|
20802
20816
|
const globalCoverage = opts.checkGlobalCoverage ? await checkGlobalSourceCoverage(plan, store) : null;
|
|
20817
|
+
if (globalCoverage && !globalCoverage.complete) {
|
|
20818
|
+
if (opts.json) {
|
|
20819
|
+
printJson({
|
|
20820
|
+
...planJsonForOutput(plan),
|
|
20821
|
+
globalSourceCoverage: globalCoverage
|
|
20822
|
+
});
|
|
20823
|
+
} else {
|
|
20824
|
+
for (const warning of formatGlobalSourceCoverageWarnings(globalCoverage)) {
|
|
20825
|
+
console.error(chalk.red(`refused: ${warning}`));
|
|
20826
|
+
}
|
|
20827
|
+
console.error(chalk.red(`Refusing to apply: ${globalCoverage.missingSlugs.length} registered global-* source(s) absent from this render. Wire them into --config or tag them retired-global-source.`));
|
|
20828
|
+
}
|
|
20829
|
+
process.exitCode = 1;
|
|
20830
|
+
return;
|
|
20831
|
+
}
|
|
20803
20832
|
const ownedClaudeAuthorities = tool === "claude" ? await loadOwnedClaudeAuthorities(store) : undefined;
|
|
20804
20833
|
const result = applySessionRender(plan, { dryRun: opts.dryRun, force: opts.force, ownedClaudeAuthorities });
|
|
20805
20834
|
if (opts.json) {
|
package/dist/index.js
CHANGED
|
@@ -8773,8 +8773,18 @@ function isCursorGlobalAuthorityPath(path) {
|
|
|
8773
8773
|
return resolve4(path) === resolve4(join5(homeDir(), CURSOR_GLOBAL_AUTHORITY_RELATIVE_PATH));
|
|
8774
8774
|
}
|
|
8775
8775
|
function stampCursorGlobalAuthorityMarker(content) {
|
|
8776
|
-
|
|
8777
|
-
|
|
8776
|
+
const existing = content.match(CURSOR_GLOBAL_AUTHORITY_MARKER_PATTERN);
|
|
8777
|
+
if (existing) {
|
|
8778
|
+
const markerLine2 = existing[0];
|
|
8779
|
+
const index = existing.index ?? content.indexOf(markerLine2);
|
|
8780
|
+
const payload = markerPayload(content, markerLine2, index);
|
|
8781
|
+
if (sha2564(payload) === existing[1].slice("sha256:".length)) {
|
|
8782
|
+
return content;
|
|
8783
|
+
}
|
|
8784
|
+
const digest2 = sha2564(payload);
|
|
8785
|
+
const freshMarkerLine = `<!-- ${CURSOR_GLOBAL_AUTHORITY_MANAGED_MARKER} hash=sha256:${digest2} -->`;
|
|
8786
|
+
return content.slice(0, index) + freshMarkerLine + content.slice(index + markerLine2.length);
|
|
8787
|
+
}
|
|
8778
8788
|
const digest = sha2564(content);
|
|
8779
8789
|
const markerLine = `<!-- ${CURSOR_GLOBAL_AUTHORITY_MANAGED_MARKER} hash=sha256:${digest} -->`;
|
|
8780
8790
|
const frontmatter = content.match(CURSOR_GLOBAL_AUTHORITY_FRONTMATTER_PATTERN)?.[0];
|
|
@@ -79,8 +79,17 @@ export declare function isCursorGlobalAuthorityPath(path: string): boolean;
|
|
|
79
79
|
* opens with a `---` frontmatter block is stamped AFTER the closing `---`,
|
|
80
80
|
* matching how the package's own session-render cursor files place their
|
|
81
81
|
* managed marker; plain content without frontmatter is stamped at the top.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
*
|
|
83
|
+
* Idempotency is hash-correctness-based, not presence-based: content whose
|
|
84
|
+
* existing marker's hash still matches its current payload is returned
|
|
85
|
+
* unchanged (re-apply no-op), while content carrying a STALE marker — the
|
|
86
|
+
* payload changed after stamping, e.g. a template re-render that expanded
|
|
87
|
+
* {{VAR}} placeholders — is re-stamped in place with the hash of the current
|
|
88
|
+
* payload. Presence-based idempotency propagated an invalid stamp forever:
|
|
89
|
+
* the observer recomputed the payload hash, reported
|
|
90
|
+
* marker-integrity-mismatch, and every re-apply reproduced the same invalid
|
|
91
|
+
* file, leaving the cursor project render blocked with no repair path
|
|
92
|
+
* (H-00154, station01 ~/.cursor/rules/hasna-global.mdc).
|
|
84
93
|
*/
|
|
85
94
|
export declare function stampCursorGlobalAuthorityMarker(content: string): string;
|
|
86
95
|
export declare function detectCursorAuthorityConflicts(observation?: CursorAuthorityObservation): CursorAuthorityConflict[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-authority.d.ts","sourceRoot":"","sources":["../../src/lib/cursor-authority.ts"],"names":[],"mappings":"AAKA,eA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AAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAI/F;AAUD;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,GAAE,iCAAsC,GAC9C,0BAA0B,CAI5B;AAED,wBAAgB,kCAAkC,CAChD,aAAa,EAAE,MAAM,GACpB,0BAA0B,CAK5B;AAoKD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoBxE;AAED,wBAAgB,8BAA8B,CAC5C,WAAW,6BAAiC,GAC3C,uBAAuB,EAAE,CAsB3B"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -5709,12 +5709,28 @@ function sha256(content) {
|
|
|
5709
5709
|
function homeDir() {
|
|
5710
5710
|
return process.env["HOME"] || homedir3();
|
|
5711
5711
|
}
|
|
5712
|
+
function markerPayload(content, markerLine, markerIndex) {
|
|
5713
|
+
const index = markerIndex ?? content.indexOf(markerLine);
|
|
5714
|
+
if (index < 0)
|
|
5715
|
+
return content;
|
|
5716
|
+
return content.slice(0, index) + content.slice(index + markerLine.length).replace(/^\n/, "");
|
|
5717
|
+
}
|
|
5712
5718
|
function isCursorGlobalAuthorityPath(path) {
|
|
5713
5719
|
return resolve3(path) === resolve3(join6(homeDir(), CURSOR_GLOBAL_AUTHORITY_RELATIVE_PATH));
|
|
5714
5720
|
}
|
|
5715
5721
|
function stampCursorGlobalAuthorityMarker(content) {
|
|
5716
|
-
|
|
5717
|
-
|
|
5722
|
+
const existing = content.match(CURSOR_GLOBAL_AUTHORITY_MARKER_PATTERN);
|
|
5723
|
+
if (existing) {
|
|
5724
|
+
const markerLine2 = existing[0];
|
|
5725
|
+
const index = existing.index ?? content.indexOf(markerLine2);
|
|
5726
|
+
const payload = markerPayload(content, markerLine2, index);
|
|
5727
|
+
if (sha256(payload) === existing[1].slice("sha256:".length)) {
|
|
5728
|
+
return content;
|
|
5729
|
+
}
|
|
5730
|
+
const digest2 = sha256(payload);
|
|
5731
|
+
const freshMarkerLine = `<!-- ${CURSOR_GLOBAL_AUTHORITY_MANAGED_MARKER} hash=sha256:${digest2} -->`;
|
|
5732
|
+
return content.slice(0, index) + freshMarkerLine + content.slice(index + markerLine2.length);
|
|
5733
|
+
}
|
|
5718
5734
|
const digest = sha256(content);
|
|
5719
5735
|
const markerLine = `<!-- ${CURSOR_GLOBAL_AUTHORITY_MANAGED_MARKER} hash=sha256:${digest} -->`;
|
|
5720
5736
|
const frontmatter = content.match(CURSOR_GLOBAL_AUTHORITY_FRONTMATTER_PATTERN)?.[0];
|
|
@@ -8062,7 +8078,7 @@ var init_sync_dir = __esm(() => {
|
|
|
8062
8078
|
var require_package = __commonJS((exports, module) => {
|
|
8063
8079
|
module.exports = {
|
|
8064
8080
|
name: "@hasna/instructions",
|
|
8065
|
-
version: "0.5.
|
|
8081
|
+
version: "0.5.3",
|
|
8066
8082
|
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.",
|
|
8067
8083
|
type: "module",
|
|
8068
8084
|
main: "dist/index.js",
|
package/dist/server/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var __export = (target, all) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __require = import.meta.require;
|
|
18
18
|
|
|
19
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
19
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/compose.js
|
|
20
20
|
var compose = (middleware, onError, onNotFound) => {
|
|
21
21
|
return (context, next) => {
|
|
22
22
|
let index = -1;
|
|
@@ -60,10 +60,10 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
63
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/request/constants.js
|
|
64
64
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
65
65
|
|
|
66
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
66
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/utils/buffer.js
|
|
67
67
|
var bufferToFormData = (arrayBuffer, contentType) => {
|
|
68
68
|
const response = new Response(arrayBuffer, {
|
|
69
69
|
headers: {
|
|
@@ -73,7 +73,7 @@ var bufferToFormData = (arrayBuffer, contentType) => {
|
|
|
73
73
|
return response.formData();
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
76
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/utils/body.js
|
|
77
77
|
var isRawRequest = (request) => ("headers" in request);
|
|
78
78
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
79
79
|
const { all = false, dot = false } = options;
|
|
@@ -155,7 +155,7 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
155
155
|
});
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
158
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/utils/url.js
|
|
159
159
|
var splitPath = (path) => {
|
|
160
160
|
const paths = path.split("/");
|
|
161
161
|
if (paths[0] === "") {
|
|
@@ -353,7 +353,7 @@ var getQueryParams = (url, key) => {
|
|
|
353
353
|
};
|
|
354
354
|
var decodeURIComponent_ = decodeURIComponent;
|
|
355
355
|
|
|
356
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
356
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/request.js
|
|
357
357
|
var HonoRequest = class {
|
|
358
358
|
raw;
|
|
359
359
|
#validatedData;
|
|
@@ -464,7 +464,7 @@ var HonoRequest = class {
|
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
467
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/utils/html.js
|
|
468
468
|
var HtmlEscapedCallbackPhase = {
|
|
469
469
|
Stringify: 1,
|
|
470
470
|
BeforeStream: 2,
|
|
@@ -502,7 +502,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
502
502
|
}
|
|
503
503
|
};
|
|
504
504
|
|
|
505
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
505
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/context.js
|
|
506
506
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
507
507
|
var setDefaultContentType = (contentType, headers) => {
|
|
508
508
|
return {
|
|
@@ -684,7 +684,7 @@ var Context = class {
|
|
|
684
684
|
};
|
|
685
685
|
};
|
|
686
686
|
|
|
687
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
687
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router.js
|
|
688
688
|
var METHOD_NAME_ALL = "ALL";
|
|
689
689
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
690
690
|
var METHODS = ["get", "post", "put", "delete", "options", "patch", "query"];
|
|
@@ -692,10 +692,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
692
692
|
var UnsupportedPathError = class extends Error {
|
|
693
693
|
};
|
|
694
694
|
|
|
695
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
695
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/utils/constants.js
|
|
696
696
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
697
697
|
|
|
698
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
698
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/hono-base.js
|
|
699
699
|
var notFoundHandler = (c) => {
|
|
700
700
|
return c.text("404 Not Found", 404);
|
|
701
701
|
};
|
|
@@ -920,7 +920,7 @@ var Hono = class _Hono {
|
|
|
920
920
|
};
|
|
921
921
|
};
|
|
922
922
|
|
|
923
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
923
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
924
924
|
var emptyParam = [];
|
|
925
925
|
function match(method, path) {
|
|
926
926
|
const matchers = this.buildAllMatchers();
|
|
@@ -941,7 +941,7 @@ function match(method, path) {
|
|
|
941
941
|
return match2(method, path);
|
|
942
942
|
}
|
|
943
943
|
|
|
944
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
944
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
945
945
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
946
946
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
947
947
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -1044,7 +1044,7 @@ var Node = class _Node {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
};
|
|
1046
1046
|
|
|
1047
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1047
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
1048
1048
|
var Trie = class {
|
|
1049
1049
|
#context = { varIndex: 0 };
|
|
1050
1050
|
#root = new Node;
|
|
@@ -1107,7 +1107,7 @@ var Trie = class {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
};
|
|
1109
1109
|
|
|
1110
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1110
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
1111
1111
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
1112
1112
|
function buildWildcardRegExp(path) {
|
|
1113
1113
|
return wildcardRegExpCache[path] ??= new RegExp(path === "*" ? "" : `^${path.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
|
|
@@ -1258,7 +1258,7 @@ var RegExpRouter = class {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
};
|
|
1260
1260
|
|
|
1261
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1261
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/reg-exp-router/prepared-router.js
|
|
1262
1262
|
var PreparedRegExpRouter = class {
|
|
1263
1263
|
name = "PreparedRegExpRouter";
|
|
1264
1264
|
#matchers;
|
|
@@ -1330,7 +1330,7 @@ var PreparedRegExpRouter = class {
|
|
|
1330
1330
|
match = match;
|
|
1331
1331
|
};
|
|
1332
1332
|
|
|
1333
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1333
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/smart-router/router.js
|
|
1334
1334
|
var SmartRouter = class {
|
|
1335
1335
|
name = "SmartRouter";
|
|
1336
1336
|
#routers = [];
|
|
@@ -1385,78 +1385,53 @@ var SmartRouter = class {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
};
|
|
1387
1387
|
|
|
1388
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1388
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/trie-router/node.js
|
|
1389
1389
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
1390
|
-
var
|
|
1391
|
-
for (const _ in children) {
|
|
1392
|
-
return true;
|
|
1393
|
-
}
|
|
1394
|
-
return false;
|
|
1395
|
-
};
|
|
1390
|
+
var order = 0;
|
|
1396
1391
|
var Node2 = class _Node2 {
|
|
1397
|
-
#methods;
|
|
1398
|
-
#children;
|
|
1399
|
-
#patterns;
|
|
1400
|
-
#
|
|
1392
|
+
#methods = [];
|
|
1393
|
+
#children = /* @__PURE__ */ Object.create(null);
|
|
1394
|
+
#patterns = [];
|
|
1395
|
+
#pattern;
|
|
1401
1396
|
#params = emptyParams;
|
|
1402
|
-
constructor(method, handler, children) {
|
|
1403
|
-
this.#children = children || /* @__PURE__ */ Object.create(null);
|
|
1404
|
-
this.#methods = [];
|
|
1405
|
-
if (method && handler) {
|
|
1406
|
-
const m = /* @__PURE__ */ Object.create(null);
|
|
1407
|
-
m[method] = { handler, possibleKeys: [], score: 0 };
|
|
1408
|
-
this.#methods = [m];
|
|
1409
|
-
}
|
|
1410
|
-
this.#patterns = [];
|
|
1411
|
-
}
|
|
1412
1397
|
insert(method, path, handler) {
|
|
1413
|
-
this.#order = ++this.#order;
|
|
1414
1398
|
let curNode = this;
|
|
1415
1399
|
const parts = splitRoutingPath(path);
|
|
1416
|
-
const possibleKeys =
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
const nextP = parts[i
|
|
1420
|
-
const pattern = getPattern(p, nextP);
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
continue;
|
|
1400
|
+
const possibleKeys = /* @__PURE__ */ new Set;
|
|
1401
|
+
let i = 0;
|
|
1402
|
+
for (const p of parts) {
|
|
1403
|
+
const nextP = parts[++i];
|
|
1404
|
+
const pattern = getPattern(p, nextP) || (nextP === undefined && p && p.indexOf("*") === p.length - 1 ? p : null);
|
|
1405
|
+
const isParam = Array.isArray(pattern);
|
|
1406
|
+
const key = isParam ? pattern[0] : pattern || p;
|
|
1407
|
+
const child = curNode.#children[key] ||= new _Node2;
|
|
1408
|
+
if (pattern && !child.#pattern) {
|
|
1409
|
+
child.#pattern = pattern;
|
|
1410
|
+
curNode.#patterns.push(child);
|
|
1428
1411
|
}
|
|
1429
|
-
curNode
|
|
1430
|
-
if (
|
|
1431
|
-
|
|
1432
|
-
possibleKeys.push(pattern[1]);
|
|
1412
|
+
curNode = child;
|
|
1413
|
+
if (isParam) {
|
|
1414
|
+
possibleKeys.add(pattern[1]);
|
|
1433
1415
|
}
|
|
1434
|
-
curNode = curNode.#children[key];
|
|
1435
1416
|
}
|
|
1436
1417
|
curNode.#methods.push({
|
|
1437
1418
|
[method]: {
|
|
1438
1419
|
handler,
|
|
1439
|
-
possibleKeys: possibleKeys
|
|
1440
|
-
score:
|
|
1420
|
+
possibleKeys: [...possibleKeys],
|
|
1421
|
+
score: ++order
|
|
1441
1422
|
}
|
|
1442
1423
|
});
|
|
1443
|
-
return curNode;
|
|
1444
1424
|
}
|
|
1445
1425
|
#pushHandlerSets(handlerSets, node, method, nodeParams, params) {
|
|
1446
1426
|
for (let i = 0, len = node.#methods.length;i < len; i++) {
|
|
1447
1427
|
const m = node.#methods[i];
|
|
1448
1428
|
const handlerSet = m[method] || m[METHOD_NAME_ALL];
|
|
1449
|
-
|
|
1450
|
-
if (handlerSet !== undefined) {
|
|
1429
|
+
if (handlerSet) {
|
|
1451
1430
|
handlerSet.params = /* @__PURE__ */ Object.create(null);
|
|
1452
1431
|
handlerSets.push(handlerSet);
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
const processed = processedSet[handlerSet.score];
|
|
1457
|
-
handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key];
|
|
1458
|
-
processedSet[handlerSet.score] = true;
|
|
1459
|
-
}
|
|
1432
|
+
for (let i2 = 0, len2 = handlerSet.possibleKeys.length;i2 < len2; i2++) {
|
|
1433
|
+
const key = handlerSet.possibleKeys[i2];
|
|
1434
|
+
handlerSet.params[key] = params?.[key] && !i2 ? params[key] : nodeParams[key] ?? params?.[key];
|
|
1460
1435
|
}
|
|
1461
1436
|
}
|
|
1462
1437
|
}
|
|
@@ -1488,33 +1463,33 @@ var Node2 = class _Node2 {
|
|
|
1488
1463
|
tempNodes.push(nextNode);
|
|
1489
1464
|
}
|
|
1490
1465
|
}
|
|
1491
|
-
for (
|
|
1492
|
-
const pattern =
|
|
1466
|
+
for (const child of node.#patterns) {
|
|
1467
|
+
const pattern = child.#pattern;
|
|
1493
1468
|
const params = node.#params === emptyParams ? {} : { ...node.#params };
|
|
1494
|
-
if (pattern === "
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1469
|
+
if (typeof pattern === "string") {
|
|
1470
|
+
if (pattern === "*" || part.startsWith(pattern.slice(0, -1))) {
|
|
1471
|
+
this.#pushHandlerSets(handlerSets, child, method, node.#params);
|
|
1472
|
+
if (pattern === "*") {
|
|
1473
|
+
child.#params = params;
|
|
1474
|
+
tempNodes.push(child);
|
|
1475
|
+
}
|
|
1500
1476
|
}
|
|
1501
1477
|
continue;
|
|
1502
1478
|
}
|
|
1503
|
-
const [
|
|
1504
|
-
if (!part &&
|
|
1479
|
+
const [, name, matcher] = pattern;
|
|
1480
|
+
if (!part && matcher === true) {
|
|
1505
1481
|
continue;
|
|
1506
1482
|
}
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
partOffsets = new Array(len);
|
|
1483
|
+
if (matcher !== true) {
|
|
1484
|
+
if (!partOffsets) {
|
|
1485
|
+
partOffsets = [];
|
|
1511
1486
|
let offset = path[0] === "/" ? 1 : 0;
|
|
1512
1487
|
for (let p = 0;p < len; p++) {
|
|
1513
1488
|
partOffsets[p] = offset;
|
|
1514
1489
|
offset += parts[p].length + 1;
|
|
1515
1490
|
}
|
|
1516
1491
|
}
|
|
1517
|
-
const restPathString = path.
|
|
1492
|
+
const restPathString = path.slice(partOffsets[i]);
|
|
1518
1493
|
const m = matcher.exec(restPathString);
|
|
1519
1494
|
if (m) {
|
|
1520
1495
|
params[name] = m[0];
|
|
@@ -1522,11 +1497,12 @@ var Node2 = class _Node2 {
|
|
|
1522
1497
|
if (m[0].length === restPathString.length && child.#children["*"]) {
|
|
1523
1498
|
this.#pushHandlerSets(handlerSets, child.#children["*"], method, node.#params, params);
|
|
1524
1499
|
}
|
|
1525
|
-
|
|
1500
|
+
for (const _ in child.#children) {
|
|
1526
1501
|
child.#params = params;
|
|
1527
1502
|
const componentCount = m[0].match(/\//g)?.length ?? 0;
|
|
1528
1503
|
const targetCurNodes = curNodesQueue[componentCount] ||= [];
|
|
1529
1504
|
targetCurNodes.push(child);
|
|
1505
|
+
break;
|
|
1530
1506
|
}
|
|
1531
1507
|
continue;
|
|
1532
1508
|
}
|
|
@@ -1548,7 +1524,7 @@ var Node2 = class _Node2 {
|
|
|
1548
1524
|
const shifted = curNodesQueue.shift();
|
|
1549
1525
|
curNodes = shifted ? tempNodes.concat(shifted) : tempNodes;
|
|
1550
1526
|
}
|
|
1551
|
-
if (handlerSets
|
|
1527
|
+
if (handlerSets[1]) {
|
|
1552
1528
|
handlerSets.sort((a, b) => {
|
|
1553
1529
|
return a.score - b.score;
|
|
1554
1530
|
});
|
|
@@ -1557,29 +1533,21 @@ var Node2 = class _Node2 {
|
|
|
1557
1533
|
}
|
|
1558
1534
|
};
|
|
1559
1535
|
|
|
1560
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1536
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/router/trie-router/router.js
|
|
1561
1537
|
var TrieRouter = class {
|
|
1562
1538
|
name = "TrieRouter";
|
|
1563
|
-
#node;
|
|
1564
|
-
constructor() {
|
|
1565
|
-
this.#node = new Node2;
|
|
1566
|
-
}
|
|
1539
|
+
#node = new Node2;
|
|
1567
1540
|
add(method, path, handler) {
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
for (let i = 0, len = results.length;i < len; i++) {
|
|
1571
|
-
this.#node.insert(method, results[i], handler);
|
|
1572
|
-
}
|
|
1573
|
-
return;
|
|
1541
|
+
for (const result of checkOptionalParameter(path) || [path]) {
|
|
1542
|
+
this.#node.insert(method, result, handler);
|
|
1574
1543
|
}
|
|
1575
|
-
this.#node.insert(method, path, handler);
|
|
1576
1544
|
}
|
|
1577
1545
|
match(method, path) {
|
|
1578
1546
|
return this.#node.search(method, path);
|
|
1579
1547
|
}
|
|
1580
1548
|
};
|
|
1581
1549
|
|
|
1582
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1550
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/hono.js
|
|
1583
1551
|
var Hono2 = class extends Hono {
|
|
1584
1552
|
constructor(options = {}) {
|
|
1585
1553
|
super(options);
|
|
@@ -1589,7 +1557,7 @@ var Hono2 = class extends Hono {
|
|
|
1589
1557
|
}
|
|
1590
1558
|
};
|
|
1591
1559
|
|
|
1592
|
-
// ../../node_modules/.bun/hono@4.13.
|
|
1560
|
+
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/middleware/cors/index.js
|
|
1593
1561
|
var cors = (options) => {
|
|
1594
1562
|
const opts = {
|
|
1595
1563
|
origin: "*",
|
|
@@ -1639,7 +1607,7 @@ var cors = (options) => {
|
|
|
1639
1607
|
}
|
|
1640
1608
|
if (c.req.method === "OPTIONS") {
|
|
1641
1609
|
if (opts.origin !== "*") {
|
|
1642
|
-
|
|
1610
|
+
c.res.headers.append("Vary", "Origin");
|
|
1643
1611
|
}
|
|
1644
1612
|
if (opts.maxAge != null) {
|
|
1645
1613
|
set("Access-Control-Max-Age", opts.maxAge.toString());
|
|
@@ -1747,7 +1715,7 @@ class ProfileNotFoundError extends Error {
|
|
|
1747
1715
|
}
|
|
1748
1716
|
}
|
|
1749
1717
|
|
|
1750
|
-
//
|
|
1718
|
+
// ../../node_modules/.bun/@hasna+contracts@0.14.0+e8014c875821e0be/node_modules/@hasna/contracts/dist/auth/index.js
|
|
1751
1719
|
import { createHash, createHmac, randomBytes, timingSafeEqual } from "crypto";
|
|
1752
1720
|
var MAX_TENANT_ID_LENGTH = 64;
|
|
1753
1721
|
var TENANT_ID_PATTERN = new RegExp(`^[A-Za-z0-9][A-Za-z0-9._-]{0,${MAX_TENANT_ID_LENGTH - 1}}$`);
|
|
@@ -8132,9 +8100,9 @@ async function deleteProfile2(client, idOrSlug) {
|
|
|
8132
8100
|
async function addConfigToProfile2(client, profileIdOrSlug, configId) {
|
|
8133
8101
|
const profile = await getProfile2(client, profileIdOrSlug);
|
|
8134
8102
|
const maxRow = await client.get("SELECT MAX(sort_order) AS max_order FROM profile_configs WHERE profile_id = $1", [profile.id]);
|
|
8135
|
-
const
|
|
8103
|
+
const order2 = (maxRow?.max_order ?? -1) + 1;
|
|
8136
8104
|
await client.execute(`INSERT INTO profile_configs (profile_id, config_id, sort_order)
|
|
8137
|
-
VALUES ($1,$2,$3) ON CONFLICT (profile_id, config_id) DO NOTHING`, [profile.id, configId,
|
|
8105
|
+
VALUES ($1,$2,$3) ON CONFLICT (profile_id, config_id) DO NOTHING`, [profile.id, configId, order2]);
|
|
8138
8106
|
}
|
|
8139
8107
|
async function getProfileConfigBindings2(client, profileIdOrSlug) {
|
|
8140
8108
|
const profile = await getProfile2(client, profileIdOrSlug);
|
|
@@ -8166,8 +8134,8 @@ async function addAssetToProfile2(client, profileIdOrSlug, sourceConfigId, bindi
|
|
|
8166
8134
|
await getConfig2(client, sourceConfigId);
|
|
8167
8135
|
const normalized = normalizeProfileAssetBinding(binding);
|
|
8168
8136
|
const maxRow = await client.get("SELECT MAX(sort_order) AS max_order FROM profile_assets WHERE profile_id = $1", [profile.id]);
|
|
8169
|
-
const
|
|
8170
|
-
await client.execute("INSERT INTO profile_assets (profile_id, source_config_id, asset_key, sort_order, binding) VALUES ($1,$2,$3,$4,$5::jsonb)", [profile.id, sourceConfigId, normalized.assetKey,
|
|
8137
|
+
const order2 = (maxRow?.max_order ?? -1) + 1;
|
|
8138
|
+
await client.execute("INSERT INTO profile_assets (profile_id, source_config_id, asset_key, sort_order, binding) VALUES ($1,$2,$3,$4,$5::jsonb)", [profile.id, sourceConfigId, normalized.assetKey, order2, JSON.stringify(normalized)]);
|
|
8171
8139
|
return (await getProfileAssetBindings2(client, profile.id)).find((row) => row.binding.assetKey === normalized.assetKey);
|
|
8172
8140
|
}
|
|
8173
8141
|
async function setProfileAssetBinding2(client, profileIdOrSlug, assetKey, binding) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/instructions",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
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",
|