@getmateo/client 0.0.0-stage → 0.18.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/LICENSE +211 -0
- package/README.md +43 -2
- package/dist/compat/normalize-provider-models.d.ts +11 -0
- package/dist/compat/normalize-provider-models.js +51 -0
- package/dist/connection/index.d.ts +51 -0
- package/dist/connection/index.js +113 -0
- package/dist/connection/legacy-workspaces.d.ts +19 -0
- package/dist/connection/legacy-workspaces.js +161 -0
- package/dist/connection/legacy.d.ts +31 -0
- package/dist/connection/legacy.js +245 -0
- package/dist/connection/owned.d.ts +36 -0
- package/dist/connection/owned.js +214 -0
- package/dist/creation/index.d.ts +40 -0
- package/dist/creation/index.js +197 -0
- package/dist/daemon-client-relay-e2ee-transport.d.ts +10 -0
- package/dist/daemon-client-relay-e2ee-transport.js +190 -0
- package/dist/daemon-client-runtime-metrics.d.ts +39 -0
- package/dist/daemon-client-runtime-metrics.js +173 -0
- package/dist/daemon-client-transport-types.d.ts +43 -0
- package/dist/daemon-client-transport-types.js +2 -0
- package/dist/daemon-client-transport-utils.d.ts +14 -0
- package/dist/daemon-client-transport-utils.js +127 -0
- package/dist/daemon-client-transport.d.ts +5 -0
- package/dist/daemon-client-transport.js +4 -0
- package/dist/daemon-client-websocket-transport.d.ts +15 -0
- package/dist/daemon-client-websocket-transport.js +183 -0
- package/dist/daemon-client.d.ts +1529 -0
- package/dist/daemon-client.js +5508 -0
- package/dist/fleet/index.d.ts +29 -0
- package/dist/fleet/index.js +81 -0
- package/dist/hosts/index.d.ts +16 -0
- package/dist/hosts/index.js +201 -0
- package/dist/index.d.ts +433 -0
- package/dist/index.js +584 -0
- package/dist/legacy-usage-icons.d.ts +2 -0
- package/dist/legacy-usage-icons.js +16 -0
- package/dist/node/buffering.d.ts +10 -0
- package/dist/node/buffering.js +28 -0
- package/dist/node/index.d.ts +17 -0
- package/dist/node/index.js +191 -0
- package/dist/node/ssh-tunnel.d.ts +9 -0
- package/dist/node/ssh-tunnel.js +81 -0
- package/dist/provider-snapshots/index.d.ts +21 -0
- package/dist/provider-snapshots/index.js +56 -0
- package/dist/terminal-stream-router.d.ts +25 -0
- package/dist/terminal-stream-router.js +62 -0
- package/dist/terminals/index.d.ts +80 -0
- package/dist/terminals/index.js +120 -0
- package/dist/timeline-subscription/index.d.ts +25 -0
- package/dist/timeline-subscription/index.js +56 -0
- package/package.json +64 -4
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Restores live delivery; the consumer owns history reads and gap recovery. */
|
|
2
|
+
export function subscribeTimeline(agentId, observation, handler, reportError) {
|
|
3
|
+
let established = false;
|
|
4
|
+
let released = false;
|
|
5
|
+
const notify = (message) => {
|
|
6
|
+
if (released)
|
|
7
|
+
return;
|
|
8
|
+
try {
|
|
9
|
+
handler(message);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
reportError(error);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const release = () => {
|
|
16
|
+
released = true;
|
|
17
|
+
return observation.release();
|
|
18
|
+
};
|
|
19
|
+
const stop = () => {
|
|
20
|
+
// Use the public release entry point so the owning API also forgets this handle.
|
|
21
|
+
void subscription.release().catch(reportError);
|
|
22
|
+
};
|
|
23
|
+
const fail = (error) => {
|
|
24
|
+
notify({
|
|
25
|
+
type: "agent.timeline.error",
|
|
26
|
+
payload: { agentId, error: error instanceof Error ? error.message : String(error) },
|
|
27
|
+
});
|
|
28
|
+
stop();
|
|
29
|
+
};
|
|
30
|
+
observation.subscribe({
|
|
31
|
+
snapshot: ({ subscriptionId }) => {
|
|
32
|
+
if (!established) {
|
|
33
|
+
established = true;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
notify({
|
|
37
|
+
type: "agent.timeline.subscription_restored",
|
|
38
|
+
payload: { agentId, subscriptionId },
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
update: (message) => {
|
|
42
|
+
if (message.type === "agent_stream" || message.type === "agent.timeline.replacement")
|
|
43
|
+
notify(message);
|
|
44
|
+
},
|
|
45
|
+
error: fail,
|
|
46
|
+
});
|
|
47
|
+
const subscription = Object.assign(stop, {
|
|
48
|
+
ready: observation.ready.then(() => undefined),
|
|
49
|
+
release,
|
|
50
|
+
subscriptionId: null,
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(subscription, "subscriptionId", { get: () => observation.subscriptionId });
|
|
53
|
+
void subscription.ready.catch(fail);
|
|
54
|
+
return subscription;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getmateo/client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.18.0",
|
|
4
|
+
"description": "Mateo client SDK package",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/x2x3studio/mateo.git",
|
|
9
|
+
"directory": "packages/client"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"!dist/**/*.map",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./internal/daemon-client": {
|
|
23
|
+
"types": "./dist/daemon-client.d.ts",
|
|
24
|
+
"default": "./dist/daemon-client.js"
|
|
25
|
+
},
|
|
26
|
+
"./internal/daemon-client-transport-types": {
|
|
27
|
+
"types": "./dist/daemon-client-transport-types.d.ts",
|
|
28
|
+
"default": "./dist/daemon-client-transport-types.js"
|
|
29
|
+
},
|
|
30
|
+
"./internal/daemon-client-websocket-transport": {
|
|
31
|
+
"types": "./dist/daemon-client-websocket-transport.d.ts",
|
|
32
|
+
"default": "./dist/daemon-client-websocket-transport.js"
|
|
33
|
+
},
|
|
34
|
+
"./node": {
|
|
35
|
+
"types": "./dist/node/index.d.ts",
|
|
36
|
+
"default": "./dist/node/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./internal/hosts": {
|
|
39
|
+
"types": "./dist/hosts/index.d.ts",
|
|
40
|
+
"default": "./dist/hosts/index.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"clean": "node ../../scripts/clean-package-dist.mjs",
|
|
48
|
+
"build": "npm run build --workspace=@getmateo/protocol && npm run build --workspace=@getmateo/relay && tsc -p tsconfig.json --incremental false",
|
|
49
|
+
"build:clean": "npm run clean && npm run build",
|
|
50
|
+
"prepack": "npm run build:clean",
|
|
51
|
+
"typecheck": "tsgo --noEmit",
|
|
52
|
+
"typecheck:examples": "tsgo -p tsconfig.examples.json --noEmit",
|
|
53
|
+
"test": "vitest run"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@getmateo/protocol": "0.18.0",
|
|
57
|
+
"@getmateo/relay": "0.18.0",
|
|
58
|
+
"ws": "^8.23.0",
|
|
59
|
+
"zod": "4.6.7"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/node": "^20.9.0",
|
|
63
|
+
"typescript": "^5.2.2",
|
|
64
|
+
"vitest": "^4.1.12"
|
|
65
|
+
}
|
|
66
|
+
}
|