@axiom-lattice/local-stores 5.5.3 → 5.6.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/local-stores@5.5.3 build /home/runner/work/agentic/agentic/packages/local-stores
2
+ > @axiom-lattice/local-stores@5.6.0 build /home/runner/work/agentic/agentic/packages/local-stores
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 304.13 KB
12
- CJS dist/index.js.map 556.26 KB
13
- CJS ⚡️ Build success in 609ms
14
- ESM dist/index.mjs 298.58 KB
15
- ESM dist/index.mjs.map 551.87 KB
16
- ESM ⚡️ Build success in 612ms
11
+ ESM dist/index.mjs 299.06 KB
12
+ ESM dist/index.mjs.map 552.52 KB
13
+ ESM ⚡️ Build success in 775ms
14
+ CJS dist/index.js 304.64 KB
15
+ CJS dist/index.js.map 556.92 KB
16
+ CJS ⚡️ Build success in 787ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 11440ms
19
- DTS dist/index.d.ts 56.40 KB
20
- DTS dist/index.d.mts 56.40 KB
18
+ DTS ⚡️ Build success in 10381ms
19
+ DTS dist/index.d.ts 56.42 KB
20
+ DTS dist/index.d.mts 56.42 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # @axiom-lattice/local-stores
2
2
 
3
+ ## 5.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4b4f79b: ## Channel attachments: delivery, parsing, and safety
8
+
9
+ Outbound channel attachments now use delivery-sized deadlines: the router and
10
+ durable reply dispatcher default attachment materialization/send to 5 minutes
11
+ (while text and failure notices keep the 15s send deadline). When a text-bearing
12
+ reply delivers its text but the attachment delivery fails or times out, a
13
+ separate best-effort failure notice is sent so files are not silently lost;
14
+ notices never fail the already-delivered text.
15
+
16
+ Attachment-only replies whose `attachments` fence contains no valid refs (invalid
17
+ JSON or only unsafe paths) now send the same failure notice instead of being
18
+ dropped or retried as empty output. `ParsedOutboundAttachments` exposes `hadBlock`
19
+ so callers can distinguish "no output" from "a block was present but unusable".
20
+
21
+ Lark `post` parsing now skips unknown tags (for example `emotion`), non-object
22
+ entries, `a` blocks without text, and invalid `img` keys while keeping the valid
23
+ text and images; a post is only dropped when it has no usable content. Lark
24
+ inbound downloads also enforce the shared 50 MiB aggregate cap and report
25
+ `附件数量或大小超过限制` distinctly from a download failure.
26
+
27
+ WeCom only maps `audio/silk` and `audio/amr` to voice messages; other `audio/*`
28
+ files are sent as ordinary files. Channel READMEs document the no-project
29
+ `/agent/uploads/channel/...` fallback and best-effort WeCom file names, and the
30
+ `ChannelAdapterProtocol.sendAttachments` docs now state that files are separate
31
+ platform messages.
32
+
33
+ ## Return entry IDs from `search_collection`
34
+
35
+ `search_collection` (Open MCP `collection_search_collection`) now prefixes each
36
+ result with its entry ID, e.g. `1. [b35e3cb8-…] <content>`, so an agent can feed
37
+ the match straight into `update_entry` / `delete_entries` without a second
38
+ `list_entries` lookup (which only lists the first 20 entries and has no
39
+ pagination).
40
+
41
+ The ID comes from `metadata._id`; other underscore-prefixed metadata stays
42
+ hidden from the rendered metadata line. Results without an `_id` keep the
43
+ previous format.
44
+
45
+ The tool contract also documents the exact metadata `filter` (equality plus
46
+ `in`/`notIn`/`arrayContains`/`gt`/`gte`/`lt`/`lte`/`neq`, top-level keys only,
47
+ pre-filter before vector ranking, Mongo-style `$` operators unsupported), and
48
+ `update_entry` / `list_entries` now point at the returned IDs (including the
49
+ 20-entry listing limit). Open MCP inherits these descriptions because exposed
50
+ tool metadata falls back to the LangChain tool description.
51
+
52
+ ## Scope scheduled-run claims to the expected occurrence
53
+
54
+ `ScheduleStorage.claimScheduledRun(taskId, expectedFireAt)` now requires the
55
+ occurrence the caller armed (`executeAt` for one-time tasks, `nextRunAt` for
56
+ cron tasks) and only claims when the stored occurrence still matches and is due.
57
+ This prevents a stale replica timer from re-claiming the next cron occurrence
58
+ after another replica has already written the task back to `pending`, which
59
+ could execute the same occurrence twice in multi-replica deployments.
60
+
61
+ `DefaultScheduleClient` passes the expected occurrence, and Memory / Local
62
+ SQLite / PostgreSQL implementations plus the multi-replica worker were updated.
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [4b4f79b]
67
+ - @axiom-lattice/protocols@7.10.0
68
+ - @axiom-lattice/core@13.6.0
69
+
3
70
  ## 5.5.3
4
71
 
5
72
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -960,7 +960,7 @@ declare class LocalScheduleStorage implements ScheduleStorage {
960
960
  save(task: ScheduledTaskDefinition): Promise<void>;
961
961
  get(taskId: string): Promise<ScheduledTaskDefinition | null>;
962
962
  update(taskId: string, updates: Partial<ScheduledTaskDefinition>): Promise<void>;
963
- claimScheduledRun(taskId: string): Promise<boolean>;
963
+ claimScheduledRun(taskId: string, expectedFireAt: number): Promise<boolean>;
964
964
  /**
965
965
  * Requeues `running` tasks whose `updated_at` is older than `olderThanMs` back
966
966
  * to `pending` (recovery after a crash that left a claim unsettled).
package/dist/index.d.ts CHANGED
@@ -960,7 +960,7 @@ declare class LocalScheduleStorage implements ScheduleStorage {
960
960
  save(task: ScheduledTaskDefinition): Promise<void>;
961
961
  get(taskId: string): Promise<ScheduledTaskDefinition | null>;
962
962
  update(taskId: string, updates: Partial<ScheduledTaskDefinition>): Promise<void>;
963
- claimScheduledRun(taskId: string): Promise<boolean>;
963
+ claimScheduledRun(taskId: string, expectedFireAt: number): Promise<boolean>;
964
964
  /**
965
965
  * Requeues `running` tasks whose `updated_at` is older than `olderThanMs` back
966
966
  * to `pending` (recovery after a crash that left a claim unsettled).
package/dist/index.js CHANGED
@@ -6590,6 +6590,7 @@ function mapRowToSkill(row) {
6590
6590
  }
6591
6591
 
6592
6592
  // src/stores/LocalScheduleStorage.ts
6593
+ var import_protocols14 = require("@axiom-lattice/protocols");
6593
6594
  var DDL30 = `
6594
6595
  CREATE TABLE IF NOT EXISTS lt_scheduled_tasks (
6595
6596
  task_id TEXT PRIMARY KEY,
@@ -6768,10 +6769,27 @@ var LocalScheduleStorage = class {
6768
6769
  `UPDATE lt_scheduled_tasks SET ${setClauses.join(", ")} WHERE task_id = ?`
6769
6770
  ).run(...values);
6770
6771
  }
6771
- async claimScheduledRun(taskId) {
6772
+ async claimScheduledRun(taskId, expectedFireAt) {
6773
+ const now = (/* @__PURE__ */ new Date()).toISOString();
6774
+ const expected = new Date(expectedFireAt).toISOString();
6772
6775
  const result = this.db.prepare(
6773
- `UPDATE lt_scheduled_tasks SET status = 'running', updated_at = ? WHERE task_id = ? AND status = 'pending'`
6774
- ).run((/* @__PURE__ */ new Date()).toISOString(), taskId);
6776
+ `UPDATE lt_scheduled_tasks
6777
+ SET status = 'running', updated_at = ?
6778
+ WHERE task_id = ? AND status = 'pending'
6779
+ AND (
6780
+ (execution_type = ? AND execute_at = ? AND execute_at <= ?)
6781
+ OR (execution_type = ? AND next_run_at = ? AND next_run_at <= ?)
6782
+ )`
6783
+ ).run(
6784
+ now,
6785
+ taskId,
6786
+ import_protocols14.ScheduleExecutionType.ONCE,
6787
+ expected,
6788
+ now,
6789
+ import_protocols14.ScheduleExecutionType.CRON,
6790
+ expected,
6791
+ now
6792
+ );
6775
6793
  return result.changes > 0;
6776
6794
  }
6777
6795
  /**
@@ -6940,7 +6958,7 @@ function mapRowToTask(row) {
6940
6958
  }
6941
6959
 
6942
6960
  // src/stores/LocalTaskStore.ts
6943
- var import_protocols14 = require("@axiom-lattice/protocols");
6961
+ var import_protocols15 = require("@axiom-lattice/protocols");
6944
6962
  var import_crypto6 = require("crypto");
6945
6963
  var MAX_CANONICAL_TASK_TIME = "9999-12-31T23:59:59.999Z";
6946
6964
  var TASK_STATUSES = /* @__PURE__ */ new Set([
@@ -7129,7 +7147,7 @@ var LocalTaskStore = class {
7129
7147
  if (filter.metadata) {
7130
7148
  for (const [key, value] of Object.entries(filter.metadata)) {
7131
7149
  const safeKey = key.replace(/[^a-zA-Z0-9_]/g, "");
7132
- const expected = (0, import_protocols14.normalizeTaskMetadataScalar)(value);
7150
+ const expected = (0, import_protocols15.normalizeTaskMetadataScalar)(value);
7133
7151
  if (!safeKey || expected === void 0) continue;
7134
7152
  if (expected === "true" || expected === "false") {
7135
7153
  conditions.push(
@@ -7704,7 +7722,7 @@ var LocalTaskStore = class {
7704
7722
  };
7705
7723
 
7706
7724
  // src/stores/LocalTaskWorkItemStore.ts
7707
- var import_protocols15 = require("@axiom-lattice/protocols");
7725
+ var import_protocols16 = require("@axiom-lattice/protocols");
7708
7726
  var import_uuid2 = require("uuid");
7709
7727
  var PROJECT_LIFECYCLE_ACTIONS = /* @__PURE__ */ new Set([
7710
7728
  "in_progress",
@@ -7929,8 +7947,8 @@ var LocalTaskWorkItemStore = class {
7929
7947
  }
7930
7948
  /** List pending execution results using one bounded SQLite anti-join query. */
7931
7949
  async listPendingExecutionResults(params) {
7932
- if (!Number.isSafeInteger(params.limit) || params.limit < 0 || params.limit > import_protocols15.MAX_PENDING_EXECUTION_RESULTS_LIMIT) {
7933
- const error = new RangeError(`limit must be a safe integer between 0 and ${import_protocols15.MAX_PENDING_EXECUTION_RESULTS_LIMIT}`);
7950
+ if (!Number.isSafeInteger(params.limit) || params.limit < 0 || params.limit > import_protocols16.MAX_PENDING_EXECUTION_RESULTS_LIMIT) {
7951
+ const error = new RangeError(`limit must be a safe integer between 0 and ${import_protocols16.MAX_PENDING_EXECUTION_RESULTS_LIMIT}`);
7934
7952
  error.code = "INVALID_LIMIT";
7935
7953
  throw error;
7936
7954
  }