@unson/brainbase-mcp 0.44.0 → 0.44.1

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.
Files changed (72) hide show
  1. package/contracts/canonical-task/operation-schema.sql +58 -0
  2. package/contracts/canonical-task/search-indexes.sql +10 -0
  3. package/contracts/canonical-task/store-schema.sql +77 -0
  4. package/dist/automation-run.d.ts +213 -0
  5. package/dist/automation-run.js +479 -0
  6. package/dist/canonical-task-operations.d.ts +205 -0
  7. package/dist/canonical-task-operations.js +700 -0
  8. package/dist/canonical-task-postgres.d.ts +139 -0
  9. package/dist/canonical-task-postgres.js +554 -0
  10. package/dist/canonical-task-service.d.ts +13 -0
  11. package/dist/canonical-task-service.js +55 -3
  12. package/dist/canonical-task-store-config.d.ts +31 -0
  13. package/dist/canonical-task-store-config.js +53 -0
  14. package/dist/config-parser.d.ts +298 -0
  15. package/dist/config-parser.js +593 -0
  16. package/dist/connected-onboarding.d.ts +57 -0
  17. package/dist/connected-onboarding.js +37 -0
  18. package/dist/durable-wait-http.d.ts +3 -1
  19. package/dist/durable-wait-http.js +73 -6
  20. package/dist/durable-waits.d.ts +93 -3
  21. package/dist/durable-waits.js +320 -8
  22. package/dist/honcho.d.ts +25 -0
  23. package/dist/honcho.js +81 -0
  24. package/dist/judgment-event-adapter.d.ts +72 -0
  25. package/dist/judgment-event-adapter.js +114 -0
  26. package/dist/judgment-event-outbox.d.ts +182 -0
  27. package/dist/judgment-event-outbox.js +568 -0
  28. package/dist/judgment-execution-outcome.d.ts +46 -0
  29. package/dist/judgment-execution-outcome.js +149 -0
  30. package/dist/judgment-host.d.ts +18 -7
  31. package/dist/judgment-host.js +82 -34
  32. package/dist/judgment-lifecycle-core.d.ts +198 -0
  33. package/dist/judgment-lifecycle-core.js +464 -0
  34. package/dist/judgment-node-evidence.d.ts +57 -0
  35. package/dist/judgment-node-evidence.js +297 -0
  36. package/dist/judgment-runtime-resolution.d.ts +264 -0
  37. package/dist/judgment-runtime-resolution.js +1248 -0
  38. package/dist/judgment-runtime-resolution.public.d.ts +255 -0
  39. package/dist/knowledge-event.d.ts +28 -0
  40. package/dist/knowledge-event.js +114 -0
  41. package/dist/mcp-runtime.d.ts +75 -0
  42. package/dist/mcp-runtime.js +188 -0
  43. package/dist/meeting-automation-runtime.d.ts +102 -0
  44. package/dist/meeting-automation-runtime.js +249 -0
  45. package/dist/meeting-automation.d.ts +155 -0
  46. package/dist/meeting-automation.js +341 -0
  47. package/dist/meeting-minutes-context-receipt.d.ts +91 -0
  48. package/dist/meeting-minutes-context-receipt.js +280 -0
  49. package/dist/meeting-source-sync.d.ts +89 -0
  50. package/dist/meeting-source-sync.js +230 -0
  51. package/dist/mesh.d.ts +58 -0
  52. package/dist/mesh.js +134 -0
  53. package/dist/onboarding-runtime.d.ts +47 -0
  54. package/dist/onboarding-runtime.js +4719 -0
  55. package/dist/routine-cycle.d.ts +51 -0
  56. package/dist/routine-cycle.js +153 -0
  57. package/dist/routine-liveness.d.ts +49 -0
  58. package/dist/routine-liveness.js +227 -0
  59. package/dist/routine-runtime.d.ts +101 -0
  60. package/dist/routine-runtime.js +237 -0
  61. package/dist/routines.d.ts +3 -0
  62. package/dist/routines.js +3 -0
  63. package/dist/run-receipt.d.ts +40 -0
  64. package/dist/run-receipt.js +635 -0
  65. package/dist/runtime-host.d.ts +64 -0
  66. package/dist/runtime-host.js +70 -0
  67. package/dist/world-work.d.ts +16 -0
  68. package/package.json +115 -3
  69. package/ui/objective-editor.js +47 -11
  70. package/ui/world/world-district.js +18 -3
  71. package/ui/world/world-placement.js +13 -0
  72. package/ui/world/world-work-rail.js +7 -1
@@ -0,0 +1,139 @@
1
+ type JsonRecord = Record<string, unknown>;
2
+ export interface CanonicalTaskPgQueryResult {
3
+ rows: any[];
4
+ rowCount?: number | null;
5
+ }
6
+ export interface CanonicalTaskPgClient {
7
+ query(text: string, values?: unknown[]): Promise<CanonicalTaskPgQueryResult>;
8
+ release?(): void;
9
+ }
10
+ /** A node-postgres compatible pool. `connect` is needed for guarded updates. */
11
+ export interface CanonicalTaskPgPool extends CanonicalTaskPgClient {
12
+ connect?(): Promise<CanonicalTaskPgClient>;
13
+ }
14
+ /** Identifies rows imported from an earlier table. Tenant configuration, never a default. */
15
+ export interface CanonicalTaskLegacyIdentity {
16
+ baseId: string;
17
+ tableId: string;
18
+ }
19
+ export interface CanonicalTaskTaskLocator {
20
+ column: 'id' | 'legacy_nocodb_id';
21
+ value: string;
22
+ }
23
+ /**
24
+ * Host-supplied visibility for list and search. It reads the filters the
25
+ * host policy put there (for example a verified organization scope) and
26
+ * returns one SQL condition over `canonical_tasks`, or null. `param` appends a
27
+ * value and returns its placeholder. The adapter does not interpret it.
28
+ */
29
+ export type CanonicalTaskScopeCondition = (input: {
30
+ filters: JsonRecord;
31
+ param: (value: unknown) => string;
32
+ }) => string | null | undefined;
33
+ /**
34
+ * Checked inside the transaction that holds the Task row lock, before an
35
+ * update that completes a Task or changes its completion contract. A host
36
+ * whose typed children (for example agent delegations) take the same row lock
37
+ * can refuse the mutation by throwing; the error reaches the caller unchanged.
38
+ */
39
+ export interface CanonicalTaskMutationGuard {
40
+ check(input: {
41
+ client: CanonicalTaskPgClient;
42
+ rowId: string;
43
+ patch: JsonRecord;
44
+ completes: boolean;
45
+ changesCompletionContract: boolean;
46
+ }): Promise<void>;
47
+ }
48
+ export interface CanonicalTaskPostgresRepositoryOptions {
49
+ pool: CanonicalTaskPgPool;
50
+ schemaVersion: string;
51
+ idSecret: string;
52
+ legacyIdentity?: CanonicalTaskLegacyIdentity | null;
53
+ webBaseUrl?: string | null;
54
+ scopeCondition?: CanonicalTaskScopeCondition | null;
55
+ mutationGuard?: CanonicalTaskMutationGuard | null;
56
+ /** Error codes a mutation guard may raise that must pass through unwrapped. */
57
+ passthroughErrorCodes?: Iterable<string>;
58
+ }
59
+ export interface CanonicalTaskPurposeLabels {
60
+ labels: Array<{
61
+ purpose_label: string;
62
+ task_count: number;
63
+ }>;
64
+ truncated: boolean;
65
+ }
66
+ export declare function encodeCanonicalTaskCursor(offset: number): string;
67
+ export declare function decodeCanonicalTaskCursor(cursor: unknown): number;
68
+ /** The disabled backend: every operation reports that no store is configured. */
69
+ export declare class CanonicalTaskUnavailableRepository {
70
+ private unavailable;
71
+ assertAvailable(): never;
72
+ list(): never;
73
+ search(): never;
74
+ get(): never;
75
+ findByIdempotencyKey(): never;
76
+ create(): never;
77
+ update(): never;
78
+ delete(): never;
79
+ listPurposeLabels(): never;
80
+ }
81
+ /**
82
+ * PostgreSQL persistence for Canonical Tasks (`canonical_tasks`, see
83
+ * `contracts/canonical-task/store-schema.sql`).
84
+ *
85
+ * Task IDs are opaque HMAC-signed `ct1.` tokens. The adapter does not decide
86
+ * who may see a Task: list/search visibility comes from the host's
87
+ * `scopeCondition`, and authorization stays in the service policy.
88
+ */
89
+ export declare class CanonicalTaskPostgresRepository {
90
+ /**
91
+ * PostgreSQL is a durable mutation boundary. Services must bind it to the
92
+ * persisted release readiness gate before exposing mutations.
93
+ */
94
+ readonly requiresReadiness = true;
95
+ readonly pool: CanonicalTaskPgPool;
96
+ readonly schemaVersion: string;
97
+ readonly legacyIdentity: CanonicalTaskLegacyIdentity | null;
98
+ readonly webBaseUrl: string | null;
99
+ private readonly idSecret;
100
+ private readonly scopeCondition;
101
+ private readonly mutationGuard;
102
+ private readonly passthroughErrorCodes;
103
+ constructor(options: CanonicalTaskPostgresRepositoryOptions);
104
+ private sign;
105
+ private encodePayload;
106
+ /** The public ID of a stored row. */
107
+ encodeTaskId(row: {
108
+ id?: unknown;
109
+ legacy_nocodb_id?: unknown;
110
+ }): string;
111
+ /** The stored row a public ID names. A tampered or foreign ID is task_not_found. */
112
+ decodeTaskLocator(taskId: unknown): CanonicalTaskTaskLocator;
113
+ normalize(row: JsonRecord | null | undefined): JsonRecord | null;
114
+ /** Store failures become task_store_unavailable; meaningful errors pass through. */
115
+ private unavailable;
116
+ query(text: string, values?: unknown[]): Promise<CanonicalTaskPgQueryResult>;
117
+ withTransaction<T>(callback: (client: CanonicalTaskPgClient) => Promise<T>): Promise<T>;
118
+ private rejectStorageScope;
119
+ private visibility;
120
+ list(filters?: JsonRecord, storageScope?: string): Promise<JsonRecord>;
121
+ search(filters?: JsonRecord, storageScope?: string): Promise<JsonRecord>;
122
+ get(taskId: string, storageScope?: string): Promise<JsonRecord | null>;
123
+ /** Tasks one meeting run created in one project, matched on the source reference. */
124
+ listByMeetingMinutesRun({ projectCode, runId, limit }?: {
125
+ projectCode?: unknown;
126
+ runId?: unknown;
127
+ limit?: number;
128
+ }): Promise<(JsonRecord | null)[]>;
129
+ findByIdempotencyKey(key: string, storageScope?: string): Promise<JsonRecord | null>;
130
+ create(input: JsonRecord, storageScope?: string): Promise<JsonRecord>;
131
+ update(taskId: string, patch: JsonRecord, storageScope?: string): Promise<JsonRecord>;
132
+ listPurposeLabels({ projectCode, assigneePersonId, limit }: {
133
+ projectCode: string;
134
+ assigneePersonId?: string | null;
135
+ limit?: number;
136
+ }): Promise<CanonicalTaskPurposeLabels>;
137
+ delete(taskId: string, expectedVersion: number, storageScope?: string): Promise<void>;
138
+ }
139
+ export {};