@coffer-org/server 7.1.0 → 7.3.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.
- package/dist/auth-api.d.ts +4 -0
- package/dist/auth-api.js +53 -0
- package/dist/auth-store.d.ts +2 -0
- package/dist/auth-store.js +1 -0
- package/dist/background-scheduler.d.ts +1 -0
- package/dist/background-scheduler.js +2 -1
- package/dist/entity-schema.d.ts +2 -0
- package/dist/entity-schema.js +26 -0
- package/dist/identity-link.d.ts +15 -0
- package/dist/identity-link.js +76 -0
- package/dist/index.js +8 -1
- package/dist/mcp-contract/schema.d.ts +34 -1
- package/dist/mcp-contract/schema.js +32 -9
- package/dist/mcp-contract/tools.js +3 -1
- package/dist/mcp-http.js +7 -3
- package/dist/mcp-tools.d.ts +7 -5
- package/dist/mcp-tools.js +95 -91
- package/dist/media/image.d.ts +23 -0
- package/dist/media/image.js +103 -0
- package/dist/media/index.d.ts +1 -0
- package/dist/media/index.js +1 -0
- package/dist/migrations.js +1 -1
- package/dist/orchestrator/agent-capabilities.d.ts +2 -2
- package/dist/orchestrator/agent-capabilities.js +3 -3
- package/dist/orchestrator/allow.d.ts +1 -16
- package/dist/orchestrator/allow.js +3 -53
- package/dist/orchestrator/config.js +0 -1
- package/dist/orchestrator/context-facts.d.ts +27 -0
- package/dist/orchestrator/context-facts.js +89 -0
- package/dist/orchestrator/conversation-access.d.ts +9 -0
- package/dist/orchestrator/conversation-access.js +12 -0
- package/dist/orchestrator/environment.d.ts +1 -0
- package/dist/orchestrator/environment.js +10 -0
- package/dist/orchestrator/file-inspection.d.ts +2 -2
- package/dist/orchestrator/file-inspection.js +41 -19
- package/dist/orchestrator/index.d.ts +16 -9
- package/dist/orchestrator/index.js +14 -7
- package/dist/orchestrator/live-message.d.ts +7 -4
- package/dist/orchestrator/live-message.js +48 -31
- package/dist/orchestrator/pipeline.d.ts +25 -4
- package/dist/orchestrator/pipeline.js +214 -94
- package/dist/orchestrator/registry.d.ts +4 -2
- package/dist/orchestrator/registry.js +10 -1
- package/dist/orchestrator/system-areas.d.ts +12 -0
- package/dist/orchestrator/system-areas.js +63 -0
- package/dist/orchestrator/system-capabilities.js +1 -1
- package/dist/orchestrator/turn-context.d.ts +18 -0
- package/dist/orchestrator/turn-context.js +39 -0
- package/dist/orchestrator/types.d.ts +106 -44
- package/dist/plugin-hooks.d.ts +26 -0
- package/dist/plugin-http-mounts.d.ts +18 -0
- package/dist/plugin-http-mounts.js +94 -0
- package/dist/plugin-runtime.js +2 -2
- package/dist/records-api.js +15 -3
- package/dist/system-settings.js +0 -1
- package/dist/thread-state.d.ts +14 -0
- package/dist/thread-state.js +71 -11
- package/dist/thread-store.d.ts +5 -3
- package/dist/thread-store.js +12 -9
- package/dist/turn-gate.d.ts +8 -0
- package/dist/turn-gate.js +39 -0
- package/package.json +7 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const turns = new Map();
|
|
2
|
+
function turnKey(connector, chatId) {
|
|
3
|
+
return `${connector}\0${chatId}`;
|
|
4
|
+
}
|
|
5
|
+
export async function beginTurn(connector, chatId, opts) {
|
|
6
|
+
const key = turnKey(connector, chatId);
|
|
7
|
+
const previous = turns.get(key);
|
|
8
|
+
const controller = new AbortController();
|
|
9
|
+
let resolveDone;
|
|
10
|
+
const done = new Promise((resolve) => {
|
|
11
|
+
resolveDone = resolve;
|
|
12
|
+
});
|
|
13
|
+
const turn = { controller, done };
|
|
14
|
+
turns.set(key, turn);
|
|
15
|
+
if (previous) {
|
|
16
|
+
if (opts.supersede)
|
|
17
|
+
previous.controller.abort();
|
|
18
|
+
await previous.done;
|
|
19
|
+
}
|
|
20
|
+
let ended = false;
|
|
21
|
+
return {
|
|
22
|
+
signal: controller.signal,
|
|
23
|
+
end() {
|
|
24
|
+
if (ended)
|
|
25
|
+
return;
|
|
26
|
+
ended = true;
|
|
27
|
+
if (turns.get(key) === turn)
|
|
28
|
+
turns.delete(key);
|
|
29
|
+
resolveDone();
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function abortTurn(connector, chatId) {
|
|
34
|
+
const turn = turns.get(turnKey(connector, chatId));
|
|
35
|
+
if (!turn)
|
|
36
|
+
return false;
|
|
37
|
+
turn.controller.abort();
|
|
38
|
+
return true;
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffer-org/server",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"types": "./dist/orchestrator/index.d.ts",
|
|
18
18
|
"default": "./dist/orchestrator/index.js"
|
|
19
19
|
},
|
|
20
|
+
"./media": {
|
|
21
|
+
"types": "./dist/media/index.d.ts",
|
|
22
|
+
"default": "./dist/media/index.js"
|
|
23
|
+
},
|
|
20
24
|
"./mcp": {
|
|
21
25
|
"types": "./dist/mcp-contract/tools.d.ts",
|
|
22
26
|
"default": "./dist/mcp-contract/tools.js"
|
|
@@ -36,7 +40,7 @@
|
|
|
36
40
|
"postpack": "node ../../scripts/swap-exports.mjs src"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@coffer-org/sdk": "^7.
|
|
43
|
+
"@coffer-org/sdk": "^7.3.0",
|
|
40
44
|
"@extractus/oembed-extractor": "^4.1.0",
|
|
41
45
|
"@fastify/cors": "^11.2.0",
|
|
42
46
|
"@fastify/multipart": "^10.0.0",
|
|
@@ -48,6 +52,7 @@
|
|
|
48
52
|
"open-graph-scraper": "^6.11.0",
|
|
49
53
|
"pino": "^9.14.0",
|
|
50
54
|
"pino-pretty": "^13.1.3",
|
|
55
|
+
"sharp": "^0.35.4",
|
|
51
56
|
"zod": "^4.4.3"
|
|
52
57
|
},
|
|
53
58
|
"optionalDependencies": {
|