agentsmesh 0.29.0 → 0.30.0

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/engine.js CHANGED
@@ -2940,6 +2940,18 @@ var init_linter = __esm({
2940
2940
  }
2941
2941
  });
2942
2942
 
2943
+ // src/core/hook-types.ts
2944
+ var BEST_EFFORT_HOOK_EVENTS;
2945
+ var init_hook_types = __esm({
2946
+ "src/core/hook-types.ts"() {
2947
+ BEST_EFFORT_HOOK_EVENTS = /* @__PURE__ */ new Set([
2948
+ "UserPromptSubmit",
2949
+ "PostToolUseFailure",
2950
+ "SessionStart"
2951
+ ]);
2952
+ }
2953
+ });
2954
+
2943
2955
  // src/core/lint/shared/helpers.ts
2944
2956
  function createWarning(file, target31, message) {
2945
2957
  return {
@@ -2955,6 +2967,13 @@ function formatOxfordComma(items) {
2955
2967
  if (items.length === 2) return `${items[0]} and ${items[1]}`;
2956
2968
  return `${items.slice(0, -1).join(", ")}, and ${items[items.length - 1]}`;
2957
2969
  }
2970
+ function unsupportedHookEventNames(hooks, supportedEvents) {
2971
+ if (!hooks) return [];
2972
+ const supported = new Set(supportedEvents);
2973
+ return Object.keys(hooks).filter(
2974
+ (event) => !supported.has(event) && !BEST_EFFORT_HOOK_EVENTS.has(event)
2975
+ );
2976
+ }
2958
2977
  function createUnsupportedHookWarning(event, target31, supportedEvents, options) {
2959
2978
  const by = options?.unsupportedBy ?? target31;
2960
2979
  const supported = formatOxfordComma(supportedEvents);
@@ -2966,6 +2985,7 @@ function createUnsupportedHookWarning(event, target31, supportedEvents, options)
2966
2985
  }
2967
2986
  var init_helpers = __esm({
2968
2987
  "src/core/lint/shared/helpers.ts"() {
2988
+ init_hook_types();
2969
2989
  }
2970
2990
  });
2971
2991
 
@@ -6309,8 +6329,7 @@ var init_linter5 = __esm({
6309
6329
  // src/targets/augment-code/lint.ts
6310
6330
  function lintHooks3(canonical) {
6311
6331
  if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
6312
- const supportedSet = new Set(SUPPORTED_HOOK_EVENTS);
6313
- return Object.keys(canonical.hooks).filter((event) => !supportedSet.has(event)).map(
6332
+ return unsupportedHookEventNames(canonical.hooks, SUPPORTED_HOOK_EVENTS).map(
6314
6333
  (event) => createUnsupportedHookWarning(event, "augment-code", SUPPORTED_HOOK_EVENTS, {
6315
6334
  unsupportedBy: "AugmentCode hooks"
6316
6335
  })
@@ -10315,8 +10334,7 @@ function lintCommands3(canonical) {
10315
10334
  function lintHooks5(canonical) {
10316
10335
  if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
10317
10336
  const supported = ["PreToolUse", "PostToolUse", "Notification", "UserPromptSubmit"];
10318
- const supportedSet = new Set(supported);
10319
- const diagnostics = Object.keys(canonical.hooks).filter((event) => !supportedSet.has(event)).map(
10337
+ const diagnostics = unsupportedHookEventNames(canonical.hooks, supported).map(
10320
10338
  (event) => createUnsupportedHookWarning(event, "copilot", supported, {
10321
10339
  unsupportedBy: "Copilot hooks"
10322
10340
  })
@@ -11434,7 +11452,7 @@ var init_permissions2 = __esm({
11434
11452
  // src/targets/cursor/hook-format.ts
11435
11453
  function unmappedCursorHookEvents(hooks) {
11436
11454
  return Object.keys(hooks).filter(
11437
- (event) => Array.isArray(hooks[event]) && hooks[event].length > 0 && !(event in CANONICAL_TO_CURSOR)
11455
+ (event) => Array.isArray(hooks[event]) && hooks[event].length > 0 && !(event in CANONICAL_TO_CURSOR) && !BEST_EFFORT_HOOK_EVENTS.has(event)
11438
11456
  );
11439
11457
  }
11440
11458
  function toCursorHooks(hooks) {
@@ -11482,6 +11500,7 @@ function cursorHooksToCanonical(hooks) {
11482
11500
  var CANONICAL_TO_CURSOR, CURSOR_TO_CANONICAL;
11483
11501
  var init_hook_format = __esm({
11484
11502
  "src/targets/cursor/hook-format.ts"() {
11503
+ init_hook_types();
11485
11504
  init_hook_command();
11486
11505
  CANONICAL_TO_CURSOR = {
11487
11506
  PreToolUse: "preToolUse",
@@ -13932,8 +13951,9 @@ function lintCommands6(canonical) {
13932
13951
  function lintHooks7(canonical) {
13933
13952
  if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
13934
13953
  const supported = ["PreToolUse", "PostToolUse", "Notification"];
13935
- const supportedSet = new Set(supported);
13936
- return Object.keys(canonical.hooks).filter((event) => !supportedSet.has(event)).map((event) => createUnsupportedHookWarning(event, "gemini-cli", supported));
13954
+ return unsupportedHookEventNames(canonical.hooks, supported).map(
13955
+ (event) => createUnsupportedHookWarning(event, "gemini-cli", supported)
13956
+ );
13937
13957
  }
13938
13958
  var init_lint14 = __esm({
13939
13959
  "src/targets/gemini-cli/lint.ts"() {
@@ -16185,8 +16205,7 @@ var init_linter20 = __esm({
16185
16205
  function lintHooks10(canonical) {
16186
16206
  if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
16187
16207
  const supported = ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SubagentStop"];
16188
- const supportedSet = new Set(supported);
16189
- return Object.keys(canonical.hooks).filter((event) => !supportedSet.has(event)).map(
16208
+ return unsupportedHookEventNames(canonical.hooks, supported).map(
16190
16209
  (event) => createUnsupportedHookWarning(event, "kiro", supported, { unsupportedBy: "Kiro hooks" })
16191
16210
  );
16192
16211
  }
@@ -24281,7 +24300,7 @@ function lintRuleScopeInversion(input) {
24281
24300
  }
24282
24301
  return out2;
24283
24302
  }
24284
- var CURRENT_GRAPH_VERSION = 1;
24303
+ var VersionSchema = z.union([z.literal(1), z.literal(2)]);
24285
24304
  var IdSchema = z.string().regex(/^[a-z0-9-]+$/, "id must be kebab-case");
24286
24305
  var DateSchema = z.string().regex(
24287
24306
  /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z?)?$/,
@@ -24304,10 +24323,17 @@ var LessonSchema = z.object({
24304
24323
  evidence: z.array(z.string().min(1)),
24305
24324
  status: LessonStatusSchema,
24306
24325
  supersededBy: IdSchema.optional(),
24307
- createdAt: DateSchema
24326
+ createdAt: DateSchema,
24327
+ /**
24328
+ * `'always'` marks an ALWAYS-ON lesson: a universal standard delivered on
24329
+ * every task (via the UserPromptSubmit hook / a `--always` recall) rather than
24330
+ * matched by triggers. Such a lesson needs no trigger and is excluded from
24331
+ * triggered recall. Absent = a normal triggered lesson.
24332
+ */
24333
+ scope: z.literal("always").optional()
24308
24334
  }).strict();
24309
24335
  var LessonsGraphSchema = z.object({
24310
- version: z.literal(CURRENT_GRAPH_VERSION),
24336
+ version: VersionSchema,
24311
24337
  lessons: z.record(IdSchema, LessonSchema),
24312
24338
  topics: z.record(IdSchema, TopicSchema),
24313
24339
  triggers: z.record(IdSchema, TriggerSchema)