@automagik/omni 2.260908.4 → 2.260908.6

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.
@@ -0,0 +1,26 @@
1
+ -- Per-automation transactional publication flag (issue #988, RFC #925 G5).
2
+ --
3
+ -- The automation executor continues on action failure by design, so an
4
+ -- `emit_event` that ran before a later failed action leaves a partial effect
5
+ -- on the bus — "partial effects on the bus are the default" (RFC #925 G5).
6
+ -- This adds the opt-in per-automation switch:
7
+ --
8
+ -- automations.transactional_emissions when true, the run's emit_event
9
+ -- publishes are accumulated in a
10
+ -- run-scoped buffer and flushed IN
11
+ -- ORDER only when every action of the
12
+ -- run succeeded; a failed/cancelled
13
+ -- run publishes zero. The DLQ retry
14
+ -- restarts clean and the #958 derived
15
+ -- idempotency keys guarantee a
16
+ -- successful retry does not duplicate.
17
+ -- Default false: existing automations
18
+ -- keep today's immediate mid-sequence
19
+ -- publishing byte-for-byte.
20
+ --
21
+ -- Hand-written following the 0043/0044/0052 precedent (additive, idempotent).
22
+ -- No explicit BEGIN/COMMIT — the boot migrator executes this file on a pooled
23
+ -- postgres-js connection, which rejects raw transaction control.
24
+
25
+ ALTER TABLE "automations"
26
+ ADD COLUMN IF NOT EXISTS "transactional_emissions" boolean NOT NULL DEFAULT false;
@@ -0,0 +1,26 @@
1
+ -- Agent event subscription manifest (#985, RFC #925 G4a).
2
+ --
3
+ -- Adds `agents.event_manifest` jsonb: the declarative accepts/publishes
4
+ -- contract for an agent, e.g.
5
+ --
6
+ -- { "accepts": [{ "event": "custom.clickup.task.status_changed",
7
+ -- "filter": { "list_id": "901300373349" } }],
8
+ -- "publishes": [{ "event": "custom.review.parecer.ready" }] }
9
+ --
10
+ -- The DB is the source of truth (RFC open question 3); git-versioned files
11
+ -- are applied via `omni agents manifest apply`. Shape is validated by
12
+ -- `AgentEventManifestSchema` in @omni/core at every write boundary. This
13
+ -- slice is storage + read surface only — G4b (#986) compiles `accepts` into
14
+ -- automations, G4c (#987) enforces `publishes` at emission time.
15
+ --
16
+ -- A jsonb column on the existing `agents` row (rather than a dedicated
17
+ -- table) keeps RLS/tenancy untouched: `agents` is already a G2 tenant table
18
+ -- with its policies in place, while a new table would need ownership specs,
19
+ -- RLS policies, and tenant triggers of its own.
20
+ --
21
+ -- Hand-written following the 0043/0044/0052 precedent (additive, idempotent).
22
+ --
23
+ -- NOTE: no explicit BEGIN/COMMIT — the boot migrator executes this file on a
24
+ -- pooled postgres-js connection, which rejects raw transaction control.
25
+
26
+ ALTER TABLE "agents" ADD COLUMN IF NOT EXISTS "event_manifest" jsonb;
@@ -428,6 +428,20 @@
428
428
  "when": 1786000000000,
429
429
  "tag": "0060_webhook_source_strict_schemas",
430
430
  "breakpoints": true
431
+ },
432
+ {
433
+ "idx": 61,
434
+ "version": "7",
435
+ "when": 1786100000000,
436
+ "tag": "0061_automation_transactional_emissions",
437
+ "breakpoints": true
438
+ },
439
+ {
440
+ "idx": 62,
441
+ "version": "7",
442
+ "when": 1786200000000,
443
+ "tag": "0062_agent_event_manifest",
444
+ "breakpoints": true
431
445
  }
432
446
  ]
433
447
  }
@@ -8,7 +8,66 @@
8
8
  * omni agents update <id> [--name <name>] [--model <model>] [--provider <provider>] [--agent-provider <id>] [--type <type>] [--active|--inactive]
9
9
  * [--provider-agent-id <id>] [--config-path <path>] [--metadata <json>]
10
10
  * omni agents delete <id>
11
+ * omni agents manifest get <id>
12
+ * omni agents manifest apply <id> --file <path>
13
+ * omni agents graph [--type <event>]
11
14
  */
15
+ import type { AgentEventManifest } from '@omni/core';
12
16
  import { Command } from 'commander';
17
+ /** Detect the manifest file format from its extension (.yaml/.yml → YAML). */
18
+ declare function detectManifestFormat(filePath: string): 'json' | 'yaml';
19
+ /**
20
+ * Parse a manifest file's contents. YAML is parsed with Bun's built-in
21
+ * `Bun.YAML` (no extra dependency); JSON with JSON.parse. Throws with a
22
+ * readable message on parse failure.
23
+ */
24
+ declare function parseManifestSource(source: string, format: 'json' | 'yaml'): unknown;
25
+ /**
26
+ * Validate a parsed manifest document against the shared Zod schema
27
+ * (client-side, before any network call). Throws with per-field messages.
28
+ */
29
+ declare function validateManifestDocument(raw: unknown): AgentEventManifest;
30
+ /** Minimal agent shape the graph helpers need (matches SDK list output). */
31
+ interface GraphAgentInput {
32
+ name: string;
33
+ eventManifest?: {
34
+ accepts?: {
35
+ event: string;
36
+ filter?: Record<string, unknown>;
37
+ }[];
38
+ publishes?: {
39
+ event: string;
40
+ }[];
41
+ } | null;
42
+ }
43
+ interface GraphRow {
44
+ agent: string;
45
+ consumes: string;
46
+ produces: string;
47
+ }
48
+ /**
49
+ * Build the producer/consumer table: one row per agent that declares at least
50
+ * one accepts/publishes entry. Agents without a manifest are omitted.
51
+ */
52
+ declare function buildGraphRows(agents: GraphAgentInput[]): GraphRow[];
53
+ interface TypeGraphRow {
54
+ agent: string;
55
+ role: 'consumes' | 'produces';
56
+ filter: string;
57
+ }
58
+ /**
59
+ * Answer "who listens to / who may emit this event type": one row per
60
+ * declaration matching the given type.
61
+ */
62
+ declare function buildTypeRows(agents: GraphAgentInput[], eventType: string): TypeGraphRow[];
63
+ /** Exported for unit tests only. */
64
+ export declare const __testables: {
65
+ detectManifestFormat: typeof detectManifestFormat;
66
+ parseManifestSource: typeof parseManifestSource;
67
+ validateManifestDocument: typeof validateManifestDocument;
68
+ buildGraphRows: typeof buildGraphRows;
69
+ buildTypeRows: typeof buildTypeRows;
70
+ };
13
71
  export declare function createAgentsCommand(): Command;
72
+ export {};
14
73
  //# sourceMappingURL=agents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoJpC,wBAAgB,mBAAmB,IAAI,OAAO,CAsL7C"}
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[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;;;CAMvB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,OAAO,CA0Q7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../src/commands/automations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuFpC,wBAAgB,wBAAwB,IAAI,OAAO,CAkTlD"}
1
+ {"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../src/commands/automations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0FpC,wBAAgB,wBAAwB,IAAI,OAAO,CAwUlD"}