@automagik/omni 2.260908.5 → 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.
- package/db/drizzle/0062_agent_event_manifest.sql +26 -0
- package/db/drizzle/meta/_journal.json +7 -0
- package/dist/commands/agents.d.ts +59 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/index.js +14909 -14743
- package/dist/sdk/client.d.ts +11 -0
- package/dist/sdk/client.d.ts.map +1 -1
- package/dist/sdk/index.js +15 -0
- package/dist/sdk/types.generated.d.ts +393 -0
- package/dist/sdk/types.generated.d.ts.map +1 -1
- package/dist/server/index.js +119 -2
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -435,6 +435,13 @@
|
|
|
435
435
|
"when": 1786100000000,
|
|
436
436
|
"tag": "0061_automation_transactional_emissions",
|
|
437
437
|
"breakpoints": true
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"idx": 62,
|
|
441
|
+
"version": "7",
|
|
442
|
+
"when": 1786200000000,
|
|
443
|
+
"tag": "0062_agent_event_manifest",
|
|
444
|
+
"breakpoints": true
|
|
438
445
|
}
|
|
439
446
|
]
|
|
440
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
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsJpC,8EAA8E;AAC9E,iBAAS,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE/D;AAED;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAS7E;AAED;;;GAGG;AACH,iBAAS,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CASlE;AAED,4EAA4E;AAC5E,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,EAAE,CAAC;QAChE,SAAS,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KACjC,GAAG,IAAI,CAAC;CACV;AAED,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAQD;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,EAAE,CAc7D;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,EAAE,CAcnF;AAED,oCAAoC;AACpC,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,OAAO,CA0Q7C"}
|