@hasna/instructions 0.4.39 → 0.4.42
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 +200 -161
- package/dist/index.js +326 -286
- package/dist/lib/instruction-graph.d.ts.map +1 -1
- package/dist/lib/session-render.d.ts +2 -0
- package/dist/lib/session-render.d.ts.map +1 -1
- package/dist/mcp/index.js +140 -135
- package/dist/server/cloud-auth.test.d.ts +2 -0
- package/dist/server/cloud-auth.test.d.ts.map +1 -0
- package/dist/server/cloud.d.ts +5 -2
- package/dist/server/cloud.d.ts.map +1 -1
- package/dist/server/cloud.test.d.ts +2 -0
- package/dist/server/cloud.test.d.ts.map +1 -0
- package/dist/server/index.js +185 -108
- package/package.json +2 -2
package/dist/server/index.js
CHANGED
|
@@ -1258,6 +1258,78 @@ var RegExpRouter = class {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
};
|
|
1260
1260
|
|
|
1261
|
+
// ../../node_modules/.bun/hono@4.13.1/node_modules/hono/dist/router/reg-exp-router/prepared-router.js
|
|
1262
|
+
var PreparedRegExpRouter = class {
|
|
1263
|
+
name = "PreparedRegExpRouter";
|
|
1264
|
+
#matchers;
|
|
1265
|
+
#relocateMap;
|
|
1266
|
+
constructor(matchers, relocateMap) {
|
|
1267
|
+
this.#matchers = matchers;
|
|
1268
|
+
this.#relocateMap = relocateMap;
|
|
1269
|
+
}
|
|
1270
|
+
#addWildcard(method, handlerData) {
|
|
1271
|
+
const matcher = this.#matchers[method];
|
|
1272
|
+
matcher[1].forEach((list) => list && list.push(handlerData));
|
|
1273
|
+
Object.values(matcher[2]).forEach((list) => list[0].push(handlerData));
|
|
1274
|
+
}
|
|
1275
|
+
#addPath(method, path, handler, indexes, map) {
|
|
1276
|
+
const matcher = this.#matchers[method];
|
|
1277
|
+
if (!map) {
|
|
1278
|
+
matcher[2][path][0].push([handler, {}]);
|
|
1279
|
+
} else {
|
|
1280
|
+
indexes.forEach((index) => {
|
|
1281
|
+
if (typeof index === "number") {
|
|
1282
|
+
matcher[1][index].push([handler, map]);
|
|
1283
|
+
} else {
|
|
1284
|
+
matcher[2][index || path][0].push([handler, map]);
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
add(method, path, handler) {
|
|
1290
|
+
if (!this.#matchers[method]) {
|
|
1291
|
+
const all = this.#matchers[METHOD_NAME_ALL];
|
|
1292
|
+
const staticMap = {};
|
|
1293
|
+
for (const key in all[2]) {
|
|
1294
|
+
staticMap[key] = [all[2][key][0].slice(), emptyParam];
|
|
1295
|
+
}
|
|
1296
|
+
this.#matchers[method] = [
|
|
1297
|
+
all[0],
|
|
1298
|
+
all[1].map((list) => Array.isArray(list) ? list.slice() : 0),
|
|
1299
|
+
staticMap
|
|
1300
|
+
];
|
|
1301
|
+
}
|
|
1302
|
+
if (path === "/*" || path === "*") {
|
|
1303
|
+
const handlerData = [handler, {}];
|
|
1304
|
+
if (method === METHOD_NAME_ALL) {
|
|
1305
|
+
for (const m in this.#matchers) {
|
|
1306
|
+
this.#addWildcard(m, handlerData);
|
|
1307
|
+
}
|
|
1308
|
+
} else {
|
|
1309
|
+
this.#addWildcard(method, handlerData);
|
|
1310
|
+
}
|
|
1311
|
+
return;
|
|
1312
|
+
}
|
|
1313
|
+
const data = this.#relocateMap[path];
|
|
1314
|
+
if (!data) {
|
|
1315
|
+
throw new Error(`Path ${path} is not registered`);
|
|
1316
|
+
}
|
|
1317
|
+
for (const [indexes, map] of data) {
|
|
1318
|
+
if (method === METHOD_NAME_ALL) {
|
|
1319
|
+
for (const m in this.#matchers) {
|
|
1320
|
+
this.#addPath(m, path, handler, indexes, map);
|
|
1321
|
+
}
|
|
1322
|
+
} else {
|
|
1323
|
+
this.#addPath(method, path, handler, indexes, map);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
buildAllMatchers() {
|
|
1328
|
+
return this.#matchers;
|
|
1329
|
+
}
|
|
1330
|
+
match = match;
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1261
1333
|
// ../../node_modules/.bun/hono@4.13.1/node_modules/hono/dist/router/smart-router/router.js
|
|
1262
1334
|
var SmartRouter = class {
|
|
1263
1335
|
name = "SmartRouter";
|
|
@@ -2724,7 +2796,7 @@ function getHonoAuthMiddleware(requiredScopes) {
|
|
|
2724
2796
|
const mw = honoApiKey({
|
|
2725
2797
|
app: INSTRUCTIONS_APP_SLUG,
|
|
2726
2798
|
signingSecret,
|
|
2727
|
-
|
|
2799
|
+
keyStatus: store.keyStatus,
|
|
2728
2800
|
requiredScopes
|
|
2729
2801
|
});
|
|
2730
2802
|
honoMiddlewareCache.set(key, mw);
|
|
@@ -3112,113 +3184,113 @@ import { basename, dirname as dirname2, isAbsolute, join as join2, parse, relati
|
|
|
3112
3184
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
3113
3185
|
var exports_external = {};
|
|
3114
3186
|
__export(exports_external, {
|
|
3115
|
-
|
|
3116
|
-
DIRTY: () => DIRTY,
|
|
3117
|
-
EMPTY_PATH: () => EMPTY_PATH,
|
|
3118
|
-
INVALID: () => INVALID,
|
|
3119
|
-
NEVER: () => NEVER,
|
|
3120
|
-
OK: () => OK,
|
|
3121
|
-
ParseStatus: () => ParseStatus,
|
|
3122
|
-
Schema: () => ZodType,
|
|
3123
|
-
ZodAny: () => ZodAny,
|
|
3124
|
-
ZodArray: () => ZodArray,
|
|
3125
|
-
ZodBigInt: () => ZodBigInt,
|
|
3126
|
-
ZodBoolean: () => ZodBoolean,
|
|
3127
|
-
ZodBranded: () => ZodBranded,
|
|
3128
|
-
ZodCatch: () => ZodCatch,
|
|
3129
|
-
ZodDate: () => ZodDate,
|
|
3130
|
-
ZodDefault: () => ZodDefault,
|
|
3131
|
-
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
3132
|
-
ZodEffects: () => ZodEffects,
|
|
3133
|
-
ZodEnum: () => ZodEnum,
|
|
3134
|
-
ZodError: () => ZodError,
|
|
3135
|
-
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
3136
|
-
ZodFunction: () => ZodFunction,
|
|
3137
|
-
ZodIntersection: () => ZodIntersection,
|
|
3138
|
-
ZodIssueCode: () => ZodIssueCode,
|
|
3139
|
-
ZodLazy: () => ZodLazy,
|
|
3140
|
-
ZodLiteral: () => ZodLiteral,
|
|
3141
|
-
ZodMap: () => ZodMap,
|
|
3142
|
-
ZodNaN: () => ZodNaN,
|
|
3143
|
-
ZodNativeEnum: () => ZodNativeEnum,
|
|
3144
|
-
ZodNever: () => ZodNever,
|
|
3145
|
-
ZodNull: () => ZodNull,
|
|
3146
|
-
ZodNullable: () => ZodNullable,
|
|
3147
|
-
ZodNumber: () => ZodNumber,
|
|
3148
|
-
ZodObject: () => ZodObject,
|
|
3149
|
-
ZodOptional: () => ZodOptional,
|
|
3150
|
-
ZodParsedType: () => ZodParsedType,
|
|
3151
|
-
ZodPipeline: () => ZodPipeline,
|
|
3152
|
-
ZodPromise: () => ZodPromise,
|
|
3153
|
-
ZodReadonly: () => ZodReadonly,
|
|
3154
|
-
ZodRecord: () => ZodRecord,
|
|
3155
|
-
ZodSchema: () => ZodType,
|
|
3156
|
-
ZodSet: () => ZodSet,
|
|
3157
|
-
ZodString: () => ZodString,
|
|
3158
|
-
ZodSymbol: () => ZodSymbol,
|
|
3159
|
-
ZodTransformer: () => ZodEffects,
|
|
3160
|
-
ZodTuple: () => ZodTuple,
|
|
3161
|
-
ZodType: () => ZodType,
|
|
3162
|
-
ZodUndefined: () => ZodUndefined,
|
|
3163
|
-
ZodUnion: () => ZodUnion,
|
|
3164
|
-
ZodUnknown: () => ZodUnknown,
|
|
3165
|
-
ZodVoid: () => ZodVoid,
|
|
3166
|
-
addIssueToContext: () => addIssueToContext,
|
|
3167
|
-
any: () => anyType,
|
|
3168
|
-
array: () => arrayType,
|
|
3169
|
-
bigint: () => bigIntType,
|
|
3170
|
-
boolean: () => booleanType,
|
|
3171
|
-
coerce: () => coerce,
|
|
3172
|
-
custom: () => custom,
|
|
3173
|
-
date: () => dateType,
|
|
3174
|
-
datetimeRegex: () => datetimeRegex,
|
|
3175
|
-
defaultErrorMap: () => en_default,
|
|
3176
|
-
discriminatedUnion: () => discriminatedUnionType,
|
|
3177
|
-
effect: () => effectsType,
|
|
3178
|
-
enum: () => enumType,
|
|
3179
|
-
function: () => functionType,
|
|
3180
|
-
getErrorMap: () => getErrorMap,
|
|
3181
|
-
getParsedType: () => getParsedType,
|
|
3182
|
-
instanceof: () => instanceOfType,
|
|
3183
|
-
intersection: () => intersectionType,
|
|
3184
|
-
isAborted: () => isAborted,
|
|
3185
|
-
isAsync: () => isAsync,
|
|
3186
|
-
isDirty: () => isDirty,
|
|
3187
|
-
isValid: () => isValid,
|
|
3188
|
-
late: () => late,
|
|
3189
|
-
lazy: () => lazyType,
|
|
3190
|
-
literal: () => literalType,
|
|
3191
|
-
makeIssue: () => makeIssue,
|
|
3192
|
-
map: () => mapType,
|
|
3193
|
-
nan: () => nanType,
|
|
3194
|
-
nativeEnum: () => nativeEnumType,
|
|
3195
|
-
never: () => neverType,
|
|
3196
|
-
null: () => nullType,
|
|
3197
|
-
nullable: () => nullableType,
|
|
3198
|
-
number: () => numberType,
|
|
3199
|
-
object: () => objectType,
|
|
3200
|
-
objectUtil: () => objectUtil,
|
|
3201
|
-
oboolean: () => oboolean,
|
|
3202
|
-
onumber: () => onumber,
|
|
3203
|
-
optional: () => optionalType,
|
|
3204
|
-
ostring: () => ostring,
|
|
3205
|
-
pipeline: () => pipelineType,
|
|
3206
|
-
preprocess: () => preprocessType,
|
|
3207
|
-
promise: () => promiseType,
|
|
3208
|
-
quotelessJson: () => quotelessJson,
|
|
3209
|
-
record: () => recordType,
|
|
3210
|
-
set: () => setType,
|
|
3211
|
-
setErrorMap: () => setErrorMap,
|
|
3212
|
-
strictObject: () => strictObjectType,
|
|
3213
|
-
string: () => stringType,
|
|
3214
|
-
symbol: () => symbolType,
|
|
3215
|
-
transformer: () => effectsType,
|
|
3216
|
-
tuple: () => tupleType,
|
|
3217
|
-
undefined: () => undefinedType,
|
|
3218
|
-
union: () => unionType,
|
|
3219
|
-
unknown: () => unknownType,
|
|
3187
|
+
void: () => voidType,
|
|
3220
3188
|
util: () => util,
|
|
3221
|
-
|
|
3189
|
+
unknown: () => unknownType,
|
|
3190
|
+
union: () => unionType,
|
|
3191
|
+
undefined: () => undefinedType,
|
|
3192
|
+
tuple: () => tupleType,
|
|
3193
|
+
transformer: () => effectsType,
|
|
3194
|
+
symbol: () => symbolType,
|
|
3195
|
+
string: () => stringType,
|
|
3196
|
+
strictObject: () => strictObjectType,
|
|
3197
|
+
setErrorMap: () => setErrorMap,
|
|
3198
|
+
set: () => setType,
|
|
3199
|
+
record: () => recordType,
|
|
3200
|
+
quotelessJson: () => quotelessJson,
|
|
3201
|
+
promise: () => promiseType,
|
|
3202
|
+
preprocess: () => preprocessType,
|
|
3203
|
+
pipeline: () => pipelineType,
|
|
3204
|
+
ostring: () => ostring,
|
|
3205
|
+
optional: () => optionalType,
|
|
3206
|
+
onumber: () => onumber,
|
|
3207
|
+
oboolean: () => oboolean,
|
|
3208
|
+
objectUtil: () => objectUtil,
|
|
3209
|
+
object: () => objectType,
|
|
3210
|
+
number: () => numberType,
|
|
3211
|
+
nullable: () => nullableType,
|
|
3212
|
+
null: () => nullType,
|
|
3213
|
+
never: () => neverType,
|
|
3214
|
+
nativeEnum: () => nativeEnumType,
|
|
3215
|
+
nan: () => nanType,
|
|
3216
|
+
map: () => mapType,
|
|
3217
|
+
makeIssue: () => makeIssue,
|
|
3218
|
+
literal: () => literalType,
|
|
3219
|
+
lazy: () => lazyType,
|
|
3220
|
+
late: () => late,
|
|
3221
|
+
isValid: () => isValid,
|
|
3222
|
+
isDirty: () => isDirty,
|
|
3223
|
+
isAsync: () => isAsync,
|
|
3224
|
+
isAborted: () => isAborted,
|
|
3225
|
+
intersection: () => intersectionType,
|
|
3226
|
+
instanceof: () => instanceOfType,
|
|
3227
|
+
getParsedType: () => getParsedType,
|
|
3228
|
+
getErrorMap: () => getErrorMap,
|
|
3229
|
+
function: () => functionType,
|
|
3230
|
+
enum: () => enumType,
|
|
3231
|
+
effect: () => effectsType,
|
|
3232
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
3233
|
+
defaultErrorMap: () => en_default,
|
|
3234
|
+
datetimeRegex: () => datetimeRegex,
|
|
3235
|
+
date: () => dateType,
|
|
3236
|
+
custom: () => custom,
|
|
3237
|
+
coerce: () => coerce,
|
|
3238
|
+
boolean: () => booleanType,
|
|
3239
|
+
bigint: () => bigIntType,
|
|
3240
|
+
array: () => arrayType,
|
|
3241
|
+
any: () => anyType,
|
|
3242
|
+
addIssueToContext: () => addIssueToContext,
|
|
3243
|
+
ZodVoid: () => ZodVoid,
|
|
3244
|
+
ZodUnknown: () => ZodUnknown,
|
|
3245
|
+
ZodUnion: () => ZodUnion,
|
|
3246
|
+
ZodUndefined: () => ZodUndefined,
|
|
3247
|
+
ZodType: () => ZodType,
|
|
3248
|
+
ZodTuple: () => ZodTuple,
|
|
3249
|
+
ZodTransformer: () => ZodEffects,
|
|
3250
|
+
ZodSymbol: () => ZodSymbol,
|
|
3251
|
+
ZodString: () => ZodString,
|
|
3252
|
+
ZodSet: () => ZodSet,
|
|
3253
|
+
ZodSchema: () => ZodType,
|
|
3254
|
+
ZodRecord: () => ZodRecord,
|
|
3255
|
+
ZodReadonly: () => ZodReadonly,
|
|
3256
|
+
ZodPromise: () => ZodPromise,
|
|
3257
|
+
ZodPipeline: () => ZodPipeline,
|
|
3258
|
+
ZodParsedType: () => ZodParsedType,
|
|
3259
|
+
ZodOptional: () => ZodOptional,
|
|
3260
|
+
ZodObject: () => ZodObject,
|
|
3261
|
+
ZodNumber: () => ZodNumber,
|
|
3262
|
+
ZodNullable: () => ZodNullable,
|
|
3263
|
+
ZodNull: () => ZodNull,
|
|
3264
|
+
ZodNever: () => ZodNever,
|
|
3265
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
3266
|
+
ZodNaN: () => ZodNaN,
|
|
3267
|
+
ZodMap: () => ZodMap,
|
|
3268
|
+
ZodLiteral: () => ZodLiteral,
|
|
3269
|
+
ZodLazy: () => ZodLazy,
|
|
3270
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
3271
|
+
ZodIntersection: () => ZodIntersection,
|
|
3272
|
+
ZodFunction: () => ZodFunction,
|
|
3273
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
3274
|
+
ZodError: () => ZodError,
|
|
3275
|
+
ZodEnum: () => ZodEnum,
|
|
3276
|
+
ZodEffects: () => ZodEffects,
|
|
3277
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
3278
|
+
ZodDefault: () => ZodDefault,
|
|
3279
|
+
ZodDate: () => ZodDate,
|
|
3280
|
+
ZodCatch: () => ZodCatch,
|
|
3281
|
+
ZodBranded: () => ZodBranded,
|
|
3282
|
+
ZodBoolean: () => ZodBoolean,
|
|
3283
|
+
ZodBigInt: () => ZodBigInt,
|
|
3284
|
+
ZodArray: () => ZodArray,
|
|
3285
|
+
ZodAny: () => ZodAny,
|
|
3286
|
+
Schema: () => ZodType,
|
|
3287
|
+
ParseStatus: () => ParseStatus,
|
|
3288
|
+
OK: () => OK,
|
|
3289
|
+
NEVER: () => NEVER,
|
|
3290
|
+
INVALID: () => INVALID,
|
|
3291
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
3292
|
+
DIRTY: () => DIRTY,
|
|
3293
|
+
BRAND: () => BRAND
|
|
3222
3294
|
});
|
|
3223
3295
|
|
|
3224
3296
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
@@ -7516,7 +7588,12 @@ function capability(provider, providerVersionRange, selectedRepresentation, load
|
|
|
7516
7588
|
});
|
|
7517
7589
|
}
|
|
7518
7590
|
var DEFAULT_PROVIDER_CAPABILITIES = Object.freeze({
|
|
7519
|
-
claude: capability("claude", ">=1.0.0", "native-import", "CLAUDE.md @ imports
|
|
7591
|
+
claude: capability("claude", ">=1.0.0", "native-import", "CLAUDE.md @ imports plus path-gated rules", {
|
|
7592
|
+
activation_modes: ["always", "glob"],
|
|
7593
|
+
native_imports: true,
|
|
7594
|
+
conditional_artifacts: true,
|
|
7595
|
+
asset_surface: "code"
|
|
7596
|
+
}),
|
|
7520
7597
|
codex: capability("codex", ">=0.1.0", "flattened", "AGENTS.md", { asset_surface: "cli" }),
|
|
7521
7598
|
cursor: capability("cursor", ">=1.0.0", "cursor-rule", ".cursor/rules/*.mdc", { activation_modes: ["always", "glob"], conditional_artifacts: true, asset_surface: "ide" }),
|
|
7522
7599
|
opencode: capability("opencode", ">=1.0.0", "managed-fragment", "opencode.json instructions", { provider_variant: "v1-instructions", session_surface: "opencode-config-instructions" }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/instructions",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.42",
|
|
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",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"author": "Andrei Hasna <andrei@hasna.com>",
|
|
77
77
|
"license": "Apache-2.0",
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@hasna/contracts": "0.13.
|
|
79
|
+
"@hasna/contracts": "0.13.3",
|
|
80
80
|
"@hasna/events": "^0.1.16",
|
|
81
81
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
82
82
|
"chalk": "^5.4.1",
|