@hasna/instructions 0.4.25 → 0.4.27

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/mcp/index.js CHANGED
@@ -5729,11 +5729,13 @@ function isSafeSingleLine(value) {
5729
5729
  function isSafeCommandArgument(value) {
5730
5730
  return /^[A-Za-z0-9_./:@+=,-]+$/.test(value) && !value.includes("://") && !value.startsWith("-") || /^--[a-z][a-z0-9-]*$/.test(value);
5731
5731
  }
5732
- var PROJECT_CONTEXT_SCHEMA = "hasna.projects.project_context_bundle.v1", PROJECT_CONTEXT_MAX_INPUT_BYTES, PROJECT_CONTEXT_MAX_RENDERED_BYTES, PROJECT_CONTEXT_MAX_COMMANDS = 6, PROJECT_CONTEXT_FRAGMENT_PATH = ".hasna/instructions/project-context.md", PROJECT_CONTEXT_CACHE_SCHEMA = "hasna.instructions.project-context-cache/v1", SESSION_COMPATIBILITY_MANIFEST_MAX_BYTES, FOREIGN_INPUT_MAX_BYTES, SESSION_MANAGED_OUTPUT_MAX_BYTES, SESSION_MANAGED_OUTPUT_WARN_BYTES, PROJECT_CONTEXT_LOCK_STALE_MS, PROJECT_KINDS, PROJECT_STATUSES, LINK_STATES, RESOLUTION_SOURCES, safeId, nullableId, producerSlug, producerName, safeOptionalDisplay, isoTimestamp, revisionSchema, hashSchema, absolutePath, commandArg, commandSchema, projectContextBundleSchema, storedManifestProjectContextSchema, storedManifestFileSchema, storedManifestObservationSchema, projectContextCacheSchema;
5732
+ var PROJECT_CONTEXT_SCHEMA = "hasna.projects.project_context_bundle.v1", PROJECT_CONTEXT_SCHEMA_V2 = "hasna.projects.project_context_bundle.v2", PROJECT_CONTEXT_SUPPORTED_SCHEMAS, projectContextSchema, PROJECT_CONTEXT_MAX_INPUT_BYTES, PROJECT_CONTEXT_MAX_RENDERED_BYTES, PROJECT_CONTEXT_MAX_COMMANDS = 6, PROJECT_CONTEXT_FRAGMENT_PATH = ".hasna/instructions/project-context.md", PROJECT_CONTEXT_CACHE_SCHEMA = "hasna.instructions.project-context-cache/v1", SESSION_COMPATIBILITY_MANIFEST_MAX_BYTES, FOREIGN_INPUT_MAX_BYTES, SESSION_MANAGED_OUTPUT_MAX_BYTES, SESSION_MANAGED_OUTPUT_WARN_BYTES, PROJECT_CONTEXT_LOCK_STALE_MS, PROJECT_KINDS, PROJECT_STATUSES, LINK_STATES, RESOLUTION_SOURCES, safeId, nullableId, producerSlug, producerName, safeOptionalDisplay, isoTimestamp, revisionSchema, hashSchema, absolutePath, commandArg, commandSchema, projectContextBundleSchema, storedManifestProjectContextSchema, storedManifestFileSchema, storedManifestObservationSchema, projectContextMetadataSnapshotSchema, projectContextCacheSchema;
5733
5733
  var init_project_context = __esm(() => {
5734
5734
  init_zod();
5735
5735
  init_redact();
5736
5736
  init_session_render_contract();
5737
+ PROJECT_CONTEXT_SUPPORTED_SCHEMAS = [PROJECT_CONTEXT_SCHEMA, PROJECT_CONTEXT_SCHEMA_V2];
5738
+ projectContextSchema = exports_external.enum(PROJECT_CONTEXT_SUPPORTED_SCHEMAS);
5737
5739
  PROJECT_CONTEXT_MAX_INPUT_BYTES = 8 * 1024;
5738
5740
  PROJECT_CONTEXT_MAX_RENDERED_BYTES = 4 * 1024;
5739
5741
  SESSION_COMPATIBILITY_MANIFEST_MAX_BYTES = 8 * 1024 * 1024;
@@ -5772,7 +5774,7 @@ var init_project_context = __esm(() => {
5772
5774
  argv: exports_external.array(commandArg).min(1).max(8)
5773
5775
  }).strict();
5774
5776
  projectContextBundleSchema = exports_external.object({
5775
- schema: exports_external.literal(PROJECT_CONTEXT_SCHEMA),
5777
+ schema: projectContextSchema,
5776
5778
  generated_at: isoTimestamp,
5777
5779
  hash: hashSchema,
5778
5780
  revision: revisionSchema,
@@ -5820,7 +5822,7 @@ var init_project_context = __esm(() => {
5820
5822
  commands: exports_external.array(commandSchema).max(PROJECT_CONTEXT_MAX_COMMANDS)
5821
5823
  }).strict();
5822
5824
  storedManifestProjectContextSchema = exports_external.object({
5823
- schema: exports_external.literal(PROJECT_CONTEXT_SCHEMA),
5825
+ schema: projectContextSchema,
5824
5826
  projectId: safeId,
5825
5827
  revision: revisionSchema,
5826
5828
  hash: hashSchema,
@@ -5860,6 +5862,25 @@ var init_project_context = __esm(() => {
5860
5862
  });
5861
5863
  }
5862
5864
  });
5865
+ projectContextMetadataSnapshotSchema = exports_external.object({
5866
+ schema: exports_external.literal("hasna.configs.session-render-snapshot/v1"),
5867
+ kind: exports_external.literal("project-context-metadata"),
5868
+ createdAt: isoTimestamp,
5869
+ projectId: safeId,
5870
+ revision: revisionSchema,
5871
+ hash: hashSchema,
5872
+ status: exports_external.enum(["fresh", "stale-source", "stale-cache"]),
5873
+ files: exports_external.array(exports_external.object({
5874
+ relativePath: exports_external.enum([
5875
+ PROJECT_CONTEXT_FRAGMENT_PATH,
5876
+ "CLAUDE.md",
5877
+ ".codewith/CODEWITH.md",
5878
+ "AGENTS.md"
5879
+ ]),
5880
+ role: exports_external.enum(["fragment", "index"]),
5881
+ sha256: exports_external.string().regex(/^[a-f0-9]{64}$/)
5882
+ }).strict()).min(1).max(2)
5883
+ }).strict();
5863
5884
  projectContextCacheSchema = exports_external.object({
5864
5885
  schema: exports_external.literal(PROJECT_CONTEXT_CACHE_SCHEMA),
5865
5886
  cached_at: isoTimestamp,
@@ -7239,7 +7260,7 @@ var init_sync_dir = __esm(() => {
7239
7260
  var require_package = __commonJS((exports, module) => {
7240
7261
  module.exports = {
7241
7262
  name: "@hasna/instructions",
7242
- version: "0.4.25",
7263
+ version: "0.4.27",
7243
7264
  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.",
7244
7265
  type: "module",
7245
7266
  main: "dist/index.js",
@@ -3141,6 +3141,27 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
3141
3141
  variables: { type: "object" }
3142
3142
  }
3143
3143
  },
3144
+ AddProfileConfigInput: {
3145
+ type: "object",
3146
+ required: ["config_id"],
3147
+ properties: {
3148
+ config_id: { type: "string" }
3149
+ }
3150
+ },
3151
+ ProfileConfigAddedResponse: {
3152
+ type: "object",
3153
+ required: ["added"],
3154
+ properties: {
3155
+ added: { type: "boolean", const: true }
3156
+ }
3157
+ },
3158
+ ProfileConfigRemovedResponse: {
3159
+ type: "object",
3160
+ required: ["removed"],
3161
+ properties: {
3162
+ removed: { type: "boolean", const: true }
3163
+ }
3164
+ },
3144
3165
  ProfileWithConfigs: {
3145
3166
  type: "object",
3146
3167
  properties: {
@@ -3378,6 +3399,55 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
3378
3399
  responses: { "200": { content: { "application/json": { schema: { type: "object", properties: { deleted: { type: "boolean" }, id: { type: "string" } } } } } } }
3379
3400
  }
3380
3401
  },
3402
+ "/v1/profiles/{id}/configs": {
3403
+ post: {
3404
+ operationId: "addConfigToProfile",
3405
+ summary: "Add a config to a profile",
3406
+ description: "Requires an API key with the `instructions:write` scope.",
3407
+ security: [{ apiKey: [] }],
3408
+ parameters: [
3409
+ { name: "id", in: "path", required: true, schema: { type: "string" } }
3410
+ ],
3411
+ requestBody: {
3412
+ required: true,
3413
+ content: {
3414
+ "application/json": {
3415
+ schema: { $ref: "#/components/schemas/AddProfileConfigInput" }
3416
+ }
3417
+ }
3418
+ },
3419
+ responses: {
3420
+ "200": {
3421
+ content: {
3422
+ "application/json": {
3423
+ schema: { $ref: "#/components/schemas/ProfileConfigAddedResponse" }
3424
+ }
3425
+ }
3426
+ }
3427
+ }
3428
+ }
3429
+ },
3430
+ "/v1/profiles/{id}/configs/{configId}": {
3431
+ delete: {
3432
+ operationId: "removeConfigFromProfile",
3433
+ summary: "Remove a config from a profile",
3434
+ description: "Requires an API key with the `instructions:write` scope.",
3435
+ security: [{ apiKey: [] }],
3436
+ parameters: [
3437
+ { name: "id", in: "path", required: true, schema: { type: "string" } },
3438
+ { name: "configId", in: "path", required: true, schema: { type: "string" } }
3439
+ ],
3440
+ responses: {
3441
+ "200": {
3442
+ content: {
3443
+ "application/json": {
3444
+ schema: { $ref: "#/components/schemas/ProfileConfigRemovedResponse" }
3445
+ }
3446
+ }
3447
+ }
3448
+ }
3449
+ }
3450
+ },
3381
3451
  "/v1/stats": {
3382
3452
  get: {
3383
3453
  operationId: "getStats",
@@ -198,6 +198,35 @@ export declare function buildV1OpenApiDocument(version?: string): {
198
198
  };
199
199
  };
200
200
  };
201
+ AddProfileConfigInput: {
202
+ type: string;
203
+ required: string[];
204
+ properties: {
205
+ config_id: {
206
+ type: string;
207
+ };
208
+ };
209
+ };
210
+ ProfileConfigAddedResponse: {
211
+ type: string;
212
+ required: string[];
213
+ properties: {
214
+ added: {
215
+ type: string;
216
+ const: boolean;
217
+ };
218
+ };
219
+ };
220
+ ProfileConfigRemovedResponse: {
221
+ type: string;
222
+ required: string[];
223
+ properties: {
224
+ removed: {
225
+ type: string;
226
+ const: boolean;
227
+ };
228
+ };
229
+ };
201
230
  ProfileWithConfigs: {
202
231
  type: string;
203
232
  properties: {
@@ -777,6 +806,74 @@ export declare function buildV1OpenApiDocument(version?: string): {
777
806
  };
778
807
  };
779
808
  };
809
+ "/v1/profiles/{id}/configs": {
810
+ post: {
811
+ operationId: string;
812
+ summary: string;
813
+ description: string;
814
+ security: {
815
+ apiKey: never[];
816
+ }[];
817
+ parameters: {
818
+ name: string;
819
+ in: string;
820
+ required: boolean;
821
+ schema: {
822
+ type: string;
823
+ };
824
+ }[];
825
+ requestBody: {
826
+ required: boolean;
827
+ content: {
828
+ "application/json": {
829
+ schema: {
830
+ $ref: string;
831
+ };
832
+ };
833
+ };
834
+ };
835
+ responses: {
836
+ "200": {
837
+ content: {
838
+ "application/json": {
839
+ schema: {
840
+ $ref: string;
841
+ };
842
+ };
843
+ };
844
+ };
845
+ };
846
+ };
847
+ };
848
+ "/v1/profiles/{id}/configs/{configId}": {
849
+ delete: {
850
+ operationId: string;
851
+ summary: string;
852
+ description: string;
853
+ security: {
854
+ apiKey: never[];
855
+ }[];
856
+ parameters: {
857
+ name: string;
858
+ in: string;
859
+ required: boolean;
860
+ schema: {
861
+ type: string;
862
+ };
863
+ }[];
864
+ responses: {
865
+ "200": {
866
+ content: {
867
+ "application/json": {
868
+ schema: {
869
+ $ref: string;
870
+ };
871
+ };
872
+ };
873
+ };
874
+ };
875
+ };
876
+ };
780
877
  "/v1/stats": {
781
878
  get: {
782
879
  operationId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"AA4CA,wBAAgB,sBAAsB,CAAC,OAAO,SAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmXnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/instructions",
3
- "version": "0.4.25",
3
+ "version": "0.4.27",
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",