@hasna/instructions 0.4.32 → 0.4.33
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 +28 -7
- package/dist/data/config-store.d.ts.map +1 -1
- package/dist/index.js +27 -7
- package/dist/mcp/index.js +29 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -13655,7 +13655,17 @@ class CloudConfigStore {
|
|
|
13655
13655
|
return parseBoundedOrLegacyPage(data.configs, data.profile.configs, normalized, "profile membership");
|
|
13656
13656
|
}
|
|
13657
13657
|
async getProfileConfigBindings(idOrSlug) {
|
|
13658
|
-
const { data } = await this.requestProfileRoute(idOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/bindings`, (value) => Array.isArray(value?.bindings));
|
|
13658
|
+
const { status, data } = await this.requestProfileRoute(idOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/bindings`, (value) => Array.isArray(value?.bindings));
|
|
13659
|
+
if (status === 404) {
|
|
13660
|
+
const profile = await this.getProfile(idOrSlug);
|
|
13661
|
+
const configs = await this.getProfileConfigs(idOrSlug);
|
|
13662
|
+
return configs.map((config, sort_order) => ({
|
|
13663
|
+
profile_id: profile.id,
|
|
13664
|
+
config_id: config.id,
|
|
13665
|
+
sort_order,
|
|
13666
|
+
binding: legacyProfileConfigBinding()
|
|
13667
|
+
}));
|
|
13668
|
+
}
|
|
13659
13669
|
if (!data || !Array.isArray(data.bindings))
|
|
13660
13670
|
throw new ProfileNotFoundError(idOrSlug);
|
|
13661
13671
|
return data.bindings;
|
|
@@ -13667,8 +13677,11 @@ class CloudConfigStore {
|
|
|
13667
13677
|
return this.request("GET", pathForId(profileId), undefined, { allow404: true });
|
|
13668
13678
|
};
|
|
13669
13679
|
const first = await request(idOrSlug);
|
|
13670
|
-
if (first.status !== 404
|
|
13671
|
-
|
|
13680
|
+
if (first.status !== 404) {
|
|
13681
|
+
if (isUsable(first.data))
|
|
13682
|
+
return first;
|
|
13683
|
+
throw new CloudHttpError(502, "profile follow-up returned an invalid response", first.data);
|
|
13684
|
+
}
|
|
13672
13685
|
const profiles = await this.listProfiles();
|
|
13673
13686
|
const profile = profiles.find((candidate) => candidate.id === idOrSlug || candidate.slug === idOrSlug);
|
|
13674
13687
|
if (!profile)
|
|
@@ -13677,10 +13690,13 @@ class CloudConfigStore {
|
|
|
13677
13690
|
if (attempted.has(candidate))
|
|
13678
13691
|
continue;
|
|
13679
13692
|
const response = await request(candidate);
|
|
13680
|
-
if (response.status !== 404
|
|
13681
|
-
|
|
13693
|
+
if (response.status !== 404) {
|
|
13694
|
+
if (isUsable(response.data))
|
|
13695
|
+
return response;
|
|
13696
|
+
throw new CloudHttpError(502, "profile follow-up returned an invalid response", response.data);
|
|
13697
|
+
}
|
|
13682
13698
|
}
|
|
13683
|
-
|
|
13699
|
+
return { status: 404, data: null };
|
|
13684
13700
|
}
|
|
13685
13701
|
async createProfile(input) {
|
|
13686
13702
|
const { data } = await this.request("POST", "/profiles", input, {
|
|
@@ -13710,7 +13726,11 @@ class CloudConfigStore {
|
|
|
13710
13726
|
await this.request("DELETE", `/profiles/${encodeURIComponent(profileIdOrSlug)}/configs/${encodeURIComponent(configId)}`, undefined, { allow404: true });
|
|
13711
13727
|
}
|
|
13712
13728
|
async getProfileAssetBindings(profileIdOrSlug) {
|
|
13713
|
-
const { data } = await this.requestProfileRoute(profileIdOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/assets`, (value) => Array.isArray(value?.assets));
|
|
13729
|
+
const { status, data } = await this.requestProfileRoute(profileIdOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/assets`, (value) => Array.isArray(value?.assets));
|
|
13730
|
+
if (status === 404) {
|
|
13731
|
+
await this.getProfile(profileIdOrSlug);
|
|
13732
|
+
return [];
|
|
13733
|
+
}
|
|
13714
13734
|
if (!data || !Array.isArray(data.assets))
|
|
13715
13735
|
throw new ProfileNotFoundError(profileIdOrSlug);
|
|
13716
13736
|
return data.assets;
|
|
@@ -13811,6 +13831,7 @@ var init_config_store = __esm(() => {
|
|
|
13811
13831
|
init_database();
|
|
13812
13832
|
init_types();
|
|
13813
13833
|
init_bounded_read();
|
|
13834
|
+
init_instruction_graph();
|
|
13814
13835
|
CloudHttpError = class CloudHttpError extends Error {
|
|
13815
13836
|
status;
|
|
13816
13837
|
body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-store.d.ts","sourceRoot":"","sources":["../../src/data/config-store.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAuC3C,OAAO,EAAkF,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvI,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-store.d.ts","sourceRoot":"","sources":["../../src/data/config-store.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAuC3C,OAAO,EAAkF,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvI,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,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AAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAShF,wBAAwB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAI3E,4BAA4B,CAChC,OAAO,CAAC,EAAE,cAAc,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,qBAAqB,CAAC;IAgD3B,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUhF,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,YAAY,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAKlC,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IASjD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAM7B;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,WAAW,CAGpF"}
|
package/dist/index.js
CHANGED
|
@@ -11663,7 +11663,17 @@ class CloudConfigStore {
|
|
|
11663
11663
|
return parseBoundedOrLegacyPage(data.configs, data.profile.configs, normalized, "profile membership");
|
|
11664
11664
|
}
|
|
11665
11665
|
async getProfileConfigBindings(idOrSlug) {
|
|
11666
|
-
const { data } = await this.requestProfileRoute(idOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/bindings`, (value) => Array.isArray(value?.bindings));
|
|
11666
|
+
const { status, data } = await this.requestProfileRoute(idOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/bindings`, (value) => Array.isArray(value?.bindings));
|
|
11667
|
+
if (status === 404) {
|
|
11668
|
+
const profile = await this.getProfile(idOrSlug);
|
|
11669
|
+
const configs = await this.getProfileConfigs(idOrSlug);
|
|
11670
|
+
return configs.map((config, sort_order) => ({
|
|
11671
|
+
profile_id: profile.id,
|
|
11672
|
+
config_id: config.id,
|
|
11673
|
+
sort_order,
|
|
11674
|
+
binding: legacyProfileConfigBinding()
|
|
11675
|
+
}));
|
|
11676
|
+
}
|
|
11667
11677
|
if (!data || !Array.isArray(data.bindings))
|
|
11668
11678
|
throw new ProfileNotFoundError(idOrSlug);
|
|
11669
11679
|
return data.bindings;
|
|
@@ -11675,8 +11685,11 @@ class CloudConfigStore {
|
|
|
11675
11685
|
return this.request("GET", pathForId(profileId), undefined, { allow404: true });
|
|
11676
11686
|
};
|
|
11677
11687
|
const first = await request(idOrSlug);
|
|
11678
|
-
if (first.status !== 404
|
|
11679
|
-
|
|
11688
|
+
if (first.status !== 404) {
|
|
11689
|
+
if (isUsable(first.data))
|
|
11690
|
+
return first;
|
|
11691
|
+
throw new CloudHttpError(502, "profile follow-up returned an invalid response", first.data);
|
|
11692
|
+
}
|
|
11680
11693
|
const profiles = await this.listProfiles();
|
|
11681
11694
|
const profile = profiles.find((candidate) => candidate.id === idOrSlug || candidate.slug === idOrSlug);
|
|
11682
11695
|
if (!profile)
|
|
@@ -11685,10 +11698,13 @@ class CloudConfigStore {
|
|
|
11685
11698
|
if (attempted.has(candidate))
|
|
11686
11699
|
continue;
|
|
11687
11700
|
const response = await request(candidate);
|
|
11688
|
-
if (response.status !== 404
|
|
11689
|
-
|
|
11701
|
+
if (response.status !== 404) {
|
|
11702
|
+
if (isUsable(response.data))
|
|
11703
|
+
return response;
|
|
11704
|
+
throw new CloudHttpError(502, "profile follow-up returned an invalid response", response.data);
|
|
11705
|
+
}
|
|
11690
11706
|
}
|
|
11691
|
-
|
|
11707
|
+
return { status: 404, data: null };
|
|
11692
11708
|
}
|
|
11693
11709
|
async createProfile(input) {
|
|
11694
11710
|
const { data } = await this.request("POST", "/profiles", input, {
|
|
@@ -11718,7 +11734,11 @@ class CloudConfigStore {
|
|
|
11718
11734
|
await this.request("DELETE", `/profiles/${encodeURIComponent(profileIdOrSlug)}/configs/${encodeURIComponent(configId)}`, undefined, { allow404: true });
|
|
11719
11735
|
}
|
|
11720
11736
|
async getProfileAssetBindings(profileIdOrSlug) {
|
|
11721
|
-
const { data } = await this.requestProfileRoute(profileIdOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/assets`, (value) => Array.isArray(value?.assets));
|
|
11737
|
+
const { status, data } = await this.requestProfileRoute(profileIdOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/assets`, (value) => Array.isArray(value?.assets));
|
|
11738
|
+
if (status === 404) {
|
|
11739
|
+
await this.getProfile(profileIdOrSlug);
|
|
11740
|
+
return [];
|
|
11741
|
+
}
|
|
11722
11742
|
if (!data || !Array.isArray(data.assets))
|
|
11723
11743
|
throw new ProfileNotFoundError(profileIdOrSlug);
|
|
11724
11744
|
return data.assets;
|
package/dist/mcp/index.js
CHANGED
|
@@ -6608,7 +6608,17 @@ class CloudConfigStore {
|
|
|
6608
6608
|
return parseBoundedOrLegacyPage(data.configs, data.profile.configs, normalized, "profile membership");
|
|
6609
6609
|
}
|
|
6610
6610
|
async getProfileConfigBindings(idOrSlug) {
|
|
6611
|
-
const { data } = await this.requestProfileRoute(idOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/bindings`, (value) => Array.isArray(value?.bindings));
|
|
6611
|
+
const { status, data } = await this.requestProfileRoute(idOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/bindings`, (value) => Array.isArray(value?.bindings));
|
|
6612
|
+
if (status === 404) {
|
|
6613
|
+
const profile = await this.getProfile(idOrSlug);
|
|
6614
|
+
const configs = await this.getProfileConfigs(idOrSlug);
|
|
6615
|
+
return configs.map((config, sort_order) => ({
|
|
6616
|
+
profile_id: profile.id,
|
|
6617
|
+
config_id: config.id,
|
|
6618
|
+
sort_order,
|
|
6619
|
+
binding: legacyProfileConfigBinding()
|
|
6620
|
+
}));
|
|
6621
|
+
}
|
|
6612
6622
|
if (!data || !Array.isArray(data.bindings))
|
|
6613
6623
|
throw new ProfileNotFoundError(idOrSlug);
|
|
6614
6624
|
return data.bindings;
|
|
@@ -6620,8 +6630,11 @@ class CloudConfigStore {
|
|
|
6620
6630
|
return this.request("GET", pathForId(profileId), undefined, { allow404: true });
|
|
6621
6631
|
};
|
|
6622
6632
|
const first = await request(idOrSlug);
|
|
6623
|
-
if (first.status !== 404
|
|
6624
|
-
|
|
6633
|
+
if (first.status !== 404) {
|
|
6634
|
+
if (isUsable(first.data))
|
|
6635
|
+
return first;
|
|
6636
|
+
throw new CloudHttpError(502, "profile follow-up returned an invalid response", first.data);
|
|
6637
|
+
}
|
|
6625
6638
|
const profiles = await this.listProfiles();
|
|
6626
6639
|
const profile = profiles.find((candidate) => candidate.id === idOrSlug || candidate.slug === idOrSlug);
|
|
6627
6640
|
if (!profile)
|
|
@@ -6630,10 +6643,13 @@ class CloudConfigStore {
|
|
|
6630
6643
|
if (attempted.has(candidate))
|
|
6631
6644
|
continue;
|
|
6632
6645
|
const response = await request(candidate);
|
|
6633
|
-
if (response.status !== 404
|
|
6634
|
-
|
|
6646
|
+
if (response.status !== 404) {
|
|
6647
|
+
if (isUsable(response.data))
|
|
6648
|
+
return response;
|
|
6649
|
+
throw new CloudHttpError(502, "profile follow-up returned an invalid response", response.data);
|
|
6650
|
+
}
|
|
6635
6651
|
}
|
|
6636
|
-
|
|
6652
|
+
return { status: 404, data: null };
|
|
6637
6653
|
}
|
|
6638
6654
|
async createProfile(input) {
|
|
6639
6655
|
const { data } = await this.request("POST", "/profiles", input, {
|
|
@@ -6663,7 +6679,11 @@ class CloudConfigStore {
|
|
|
6663
6679
|
await this.request("DELETE", `/profiles/${encodeURIComponent(profileIdOrSlug)}/configs/${encodeURIComponent(configId)}`, undefined, { allow404: true });
|
|
6664
6680
|
}
|
|
6665
6681
|
async getProfileAssetBindings(profileIdOrSlug) {
|
|
6666
|
-
const { data } = await this.requestProfileRoute(profileIdOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/assets`, (value) => Array.isArray(value?.assets));
|
|
6682
|
+
const { status, data } = await this.requestProfileRoute(profileIdOrSlug, (profileId) => `/profiles/${encodeURIComponent(profileId)}/assets`, (value) => Array.isArray(value?.assets));
|
|
6683
|
+
if (status === 404) {
|
|
6684
|
+
await this.getProfile(profileIdOrSlug);
|
|
6685
|
+
return [];
|
|
6686
|
+
}
|
|
6667
6687
|
if (!data || !Array.isArray(data.assets))
|
|
6668
6688
|
throw new ProfileNotFoundError(profileIdOrSlug);
|
|
6669
6689
|
return data.assets;
|
|
@@ -6764,6 +6784,7 @@ var init_config_store = __esm(() => {
|
|
|
6764
6784
|
init_database();
|
|
6765
6785
|
init_types();
|
|
6766
6786
|
init_bounded_read();
|
|
6787
|
+
init_instruction_graph();
|
|
6767
6788
|
CloudHttpError = class CloudHttpError extends Error {
|
|
6768
6789
|
status;
|
|
6769
6790
|
body;
|
|
@@ -7927,7 +7948,7 @@ var init_sync_dir = __esm(() => {
|
|
|
7927
7948
|
var require_package = __commonJS((exports, module) => {
|
|
7928
7949
|
module.exports = {
|
|
7929
7950
|
name: "@hasna/instructions",
|
|
7930
|
-
version: "0.4.
|
|
7951
|
+
version: "0.4.33",
|
|
7931
7952
|
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.",
|
|
7932
7953
|
type: "module",
|
|
7933
7954
|
main: "dist/index.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/instructions",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.33",
|
|
4
4
|
"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.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|