@segmentstream/ontology 0.145.0 → 0.146.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.
- package/CHANGELOG.md +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/replication/shadow.js +9 -2
- package/dist/replication/store.d.ts +7 -0
- package/dist/replication/store.js +16 -0
- package/dist/runtime-source.d.ts +5 -0
- package/dist/runtime-source.js +5 -0
- package/dist/service/mcp/server.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.146.1
|
|
4
|
+
|
|
5
|
+
Ontology replication sends what a warehouse load committed only once. A generation whose events a
|
|
6
|
+
load put in the warehouse no longer sends them all again through Pub/Sub when it starts serving,
|
|
7
|
+
oldest first, ahead of every change written since. Records whose projection a deploy did not change
|
|
8
|
+
stayed on such a generation, so their changes reached the warehouse hours or days late. Delivery
|
|
9
|
+
records the events an earlier version loaded as delivered on its next pass, with no deploy needed.
|
|
10
|
+
|
|
11
|
+
## 0.146.0
|
|
12
|
+
|
|
13
|
+
`initialize` lists the channels a tool call's runtime source may name (`telegram`, `slack`,
|
|
14
|
+
`whatsapp`), so that an agent sends a Slack or WhatsApp message's source only to an ontology that
|
|
15
|
+
reads it. `RUNTIME_SOURCE_PROVIDERS` exports the list.
|
|
16
|
+
|
|
3
17
|
## 0.145.0
|
|
4
18
|
|
|
5
19
|
`agent_chat.send` takes `buttons` under a text: rows of links (`{ text, url }`) and workspace
|
package/dist/index.d.ts
CHANGED
|
@@ -114,6 +114,7 @@ export { sqlAgentStore, resolveChannelIdentity, resolveChannelSignIn } from "./r
|
|
|
114
114
|
export { DEFAULT_AGENT_LIMITS, PLATFORM_CHANNEL_LIMITS, clampChannelLimits, effectiveChannelLimits, } from "./runtime/agent-counters.js";
|
|
115
115
|
export type { ChannelAppProvider } from "./service/channel/provider.js";
|
|
116
116
|
export type { RuntimeSource, ActionRuntime } from "./runtime-source.js";
|
|
117
|
+
export { RUNTIME_SOURCE_PROVIDERS } from "./runtime-source.js";
|
|
117
118
|
export { callbackIdentityToken, serveWorkflowCallback } from "./service/workflow-callback.js";
|
|
118
119
|
export { compiledWorkflowId, triggerPath, vercelWorkflowEngine, WorkflowStepFailed, } from "./service/workflows.js";
|
|
119
120
|
export type { WorkflowEngine, WorkflowPage, WorkflowRunRecord, WorkflowStepRecord, } from "./service/workflows.js";
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,7 @@ export { runBlobStorageMaintenance } from "./storage/operator.js";
|
|
|
77
77
|
export { runNewUserHook } from "./runtime/new-user-hook.js";
|
|
78
78
|
export { sqlAgentStore, resolveChannelIdentity, resolveChannelSignIn } from "./runtime/agents.js";
|
|
79
79
|
export { DEFAULT_AGENT_LIMITS, PLATFORM_CHANNEL_LIMITS, clampChannelLimits, effectiveChannelLimits, } from "./runtime/agent-counters.js";
|
|
80
|
+
export { RUNTIME_SOURCE_PROVIDERS } from "./runtime-source.js";
|
|
80
81
|
export { callbackIdentityToken, serveWorkflowCallback } from "./service/workflow-callback.js";
|
|
81
82
|
export { compiledWorkflowId, triggerPath, vercelWorkflowEngine, WorkflowStepFailed, } from "./service/workflows.js";
|
|
82
83
|
export { validateBrowserSignIn } from "./sign-in.js";
|
|
@@ -460,8 +460,15 @@ export const finishShadowSegment = (sql, segment, owner) => sql.withTransaction(
|
|
|
460
460
|
if (!completed) {
|
|
461
461
|
return false;
|
|
462
462
|
}
|
|
463
|
-
|
|
464
|
-
|
|
463
|
+
// The committed load put the segment's events in the warehouse: they are delivered, as a
|
|
464
|
+
// Pub/Sub receipt would record. Left pending, the generation would send them all again once
|
|
465
|
+
// it serves, oldest first, ahead of every change written since.
|
|
466
|
+
yield* sql.unsafe(`WITH loaded AS (
|
|
467
|
+
UPDATE _ontology_replication_delivery
|
|
468
|
+
SET committed_at=now(), accepted_at=COALESCE(accepted_at, now())
|
|
469
|
+
WHERE segment_id=$1::uuid RETURNING generation, event_id, accepted_at
|
|
470
|
+
) INSERT INTO _ontology_replication_receipts (generation, event_id, accepted_at)
|
|
471
|
+
SELECT generation, event_id, accepted_at FROM loaded ON CONFLICT DO NOTHING`, [segment.id]);
|
|
465
472
|
return true;
|
|
466
473
|
}));
|
|
467
474
|
export const retryShadowSegment = (sql, segment, owner, failure) => sql.unsafe(`UPDATE _ontology_replication_segments SET attempt=attempt+1,
|
|
@@ -26,6 +26,13 @@ export declare const pendingReplicationEvents: (sql: SqlClient.SqlClient, target
|
|
|
26
26
|
readonly historyId: string;
|
|
27
27
|
readonly event: ReplicationEvent;
|
|
28
28
|
}[], import("effect/unstable/sql/SqlError").SqlError, never>;
|
|
29
|
+
/**
|
|
30
|
+
* Records as delivered, with receipts, the events of a generation an earlier SDK loaded into the
|
|
31
|
+
* warehouse without recording them, so that serving delivery does not send them through Pub/Sub
|
|
32
|
+
* again ahead of the changes written since. A committed load now records its own; this reads only
|
|
33
|
+
* the generation's undelivered rows.
|
|
34
|
+
*/
|
|
35
|
+
export declare const recordLoadedReplicationEvents: (sql: SqlClient.SqlClient, generation: string) => Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, never>;
|
|
29
36
|
/** Acceptance comes only from Pub/Sub receipts; historical verification columns are not used. */
|
|
30
37
|
export declare const replicationStatus: (sql: SqlClient.SqlClient, target: ReplicationTarget) => Effect.Effect<{
|
|
31
38
|
total: string;
|
|
@@ -229,6 +229,22 @@ export const pendingReplicationEvents = (sql, target, options = {}) => Effect.ge
|
|
|
229
229
|
}
|
|
230
230
|
return result;
|
|
231
231
|
});
|
|
232
|
+
// @legacy ontology.replication-loaded-events-pending
|
|
233
|
+
/**
|
|
234
|
+
* Records as delivered, with receipts, the events of a generation an earlier SDK loaded into the
|
|
235
|
+
* warehouse without recording them, so that serving delivery does not send them through Pub/Sub
|
|
236
|
+
* again ahead of the changes written since. A committed load now records its own; this reads only
|
|
237
|
+
* the generation's undelivered rows.
|
|
238
|
+
*/
|
|
239
|
+
export const recordLoadedReplicationEvents = (sql, generation) => sql.withTransaction(Effect.gen(function* () {
|
|
240
|
+
yield* shareReplicationLifecycle(sql);
|
|
241
|
+
yield* sql.unsafe(`WITH loaded AS (
|
|
242
|
+
UPDATE _ontology_replication_delivery SET accepted_at = committed_at
|
|
243
|
+
WHERE generation = $1::uuid AND accepted_at IS NULL AND committed_at IS NOT NULL
|
|
244
|
+
RETURNING event_id, accepted_at
|
|
245
|
+
) INSERT INTO _ontology_replication_receipts (generation, event_id, accepted_at)
|
|
246
|
+
SELECT $1::uuid, event_id, accepted_at FROM loaded ON CONFLICT DO NOTHING`, [generation]);
|
|
247
|
+
}));
|
|
232
248
|
/** Lost publish responses deliberately leave the same immutable IDs pending. */
|
|
233
249
|
const acknowledgeReplicationV4 = (sql, generation, ids) => sql.withTransaction(Effect.gen(function* () {
|
|
234
250
|
// Receipt foreign keys touch targets after delivery rows; drain before migration table locks.
|
package/dist/runtime-source.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* The channels whose message a tool call's runtime source can name. `initialize` lists them, so
|
|
4
|
+
* that an agent sends only a source its ontology reads.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RUNTIME_SOURCE_PROVIDERS: readonly ["telegram", "slack", "whatsapp"];
|
|
2
7
|
/** Decoded only at a verified runtime boundary; ordinary action arguments never establish provenance. */
|
|
3
8
|
export declare const RuntimeSource: Schema.Union<readonly [Schema.Struct<{
|
|
4
9
|
readonly provider: Schema.Literal<"telegram">;
|
package/dist/runtime-source.js
CHANGED
|
@@ -11,6 +11,11 @@ const TelegramLocation = Schema.Struct({
|
|
|
11
11
|
horizontal_accuracy: Schema.optionalKey(Schema.Number.check(Schema.isBetween({ minimum: 0, maximum: 1500 }))),
|
|
12
12
|
live_period: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
|
|
13
13
|
});
|
|
14
|
+
/**
|
|
15
|
+
* The channels whose message a tool call's runtime source can name. `initialize` lists them, so
|
|
16
|
+
* that an agent sends only a source its ontology reads.
|
|
17
|
+
*/
|
|
18
|
+
export const RUNTIME_SOURCE_PROVIDERS = ["telegram", "slack", "whatsapp"];
|
|
14
19
|
/** A Telegram chat, with the references Telegram's own actions and attachments use. */
|
|
15
20
|
const TelegramRuntimeSource = Schema.Struct({
|
|
16
21
|
provider: Schema.Literal("telegram"),
|
|
@@ -13,6 +13,7 @@ import { currentCaller } from "../caller-context.js";
|
|
|
13
13
|
import { requireRuntimeOperation, runtimeManifest } from "./runtime-policy.js";
|
|
14
14
|
import { CONFIRMATION_PREVIEW_METHOD, previewLocale, withoutConfirmation } from "./confirmation.js";
|
|
15
15
|
import { consumeChatEnvelope, CurrentChatCall } from "../chat/envelope.js";
|
|
16
|
+
import { RUNTIME_SOURCE_PROVIDERS } from "../../runtime-source.js";
|
|
16
17
|
import { ChatList, ChatHistory, ChatPostWire, RuntimeChatPostWire } from "../chat/schemas.js";
|
|
17
18
|
import { ChatPostResult } from "../../chat.js";
|
|
18
19
|
import { chatKind, listedChatProviders } from "../chat/providers/index.js";
|
|
@@ -672,9 +673,10 @@ function dispatch(server, message, request) {
|
|
|
672
673
|
capabilities: {
|
|
673
674
|
tools: {},
|
|
674
675
|
resources: {},
|
|
675
|
-
// The agent runtime learns that tool calls accept its chat source
|
|
676
|
-
// the catalog. The `me` tool keeps its `_meta` marker for
|
|
677
|
-
|
|
676
|
+
// The agent runtime learns that tool calls accept its chat source, and from which
|
|
677
|
+
// channels, without listing the catalog. The `me` tool keeps its `_meta` marker for
|
|
678
|
+
// older agents.
|
|
679
|
+
experimental: { [RUNTIME_SOURCE_META]: { providers: [...RUNTIME_SOURCE_PROVIDERS] } },
|
|
678
680
|
},
|
|
679
681
|
serverInfo: {
|
|
680
682
|
name: "segmentstream-ontology",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segmentstream/ontology",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.146.1",
|
|
4
4
|
"description": "Define a SegmentStream workspace app's ontology: entities, relationships, roles and actions, written with Effect.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "SegmentStream",
|