totemlayer 0.1.25 → 0.1.30
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/README.md +36 -30
- package/bin/mcp.mjs +236 -45
- package/bin/network-runtime.mjs +2 -0
- package/bin/sdk/action-types.js +0 -1
- package/bin/sdk/actions.js +1 -84
- package/bin/sdk/errors.js +1 -67
- package/bin/sdk/index.d.ts +34 -1
- package/bin/sdk/index.js +1 -433
- package/bin/sdk/inspector.js +1 -323
- package/bin/sdk/request-options.js +1 -36
- package/bin/sdk/transport.js +1 -202
- package/bin/sdk/types.d.ts +56 -1
- package/bin/sdk/types.js +0 -1
- package/bin/totem.mjs +2 -2
- package/package.json +1 -1
- package/scripts/prepare.mjs +16 -1
package/bin/sdk/types.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export interface Erc8004DiscoveryLinks {
|
|
|
9
9
|
grantsActionAuthority: false;
|
|
10
10
|
}
|
|
11
11
|
export interface Agent {
|
|
12
|
+
actionMode?: "ask_me" | "full_access";
|
|
13
|
+
actionModeVersion?: number;
|
|
12
14
|
/** Authenticated connection-only listener marker; not an authority claim from a peer. */
|
|
13
15
|
listenerConnectionId?: string;
|
|
14
16
|
id: string;
|
|
@@ -65,6 +67,7 @@ export interface Message {
|
|
|
65
67
|
verified: boolean;
|
|
66
68
|
sandbox: boolean;
|
|
67
69
|
content: MessageContent;
|
|
70
|
+
actionRequest?: NetworkActionRequest | null;
|
|
68
71
|
attachments?: Attachment[];
|
|
69
72
|
conversationId: string;
|
|
70
73
|
taskId: string | null;
|
|
@@ -85,6 +88,38 @@ export interface Message {
|
|
|
85
88
|
verified: false;
|
|
86
89
|
} | null;
|
|
87
90
|
}
|
|
91
|
+
export interface NetworkProtectedAction {
|
|
92
|
+
name: string;
|
|
93
|
+
resource: string;
|
|
94
|
+
parameters?: Record<string, JsonValue>;
|
|
95
|
+
}
|
|
96
|
+
export interface NetworkActionRequest {
|
|
97
|
+
id: string;
|
|
98
|
+
messageId: string;
|
|
99
|
+
connectionId: string;
|
|
100
|
+
action: NetworkProtectedAction;
|
|
101
|
+
description: string;
|
|
102
|
+
digest: string;
|
|
103
|
+
state: "pending" | "approved" | "denied" | "canceled" | "expired" | "dispatched" | "succeeded" | "failed" | "uncertain";
|
|
104
|
+
expiresAt: string;
|
|
105
|
+
decidedAt: string | null;
|
|
106
|
+
dispatchedAt: string | null;
|
|
107
|
+
completedAt: string | null;
|
|
108
|
+
executionId: string | null;
|
|
109
|
+
resultSummary: string | null;
|
|
110
|
+
outcomeSource: "executor_report" | null;
|
|
111
|
+
approvalSource?: "human" | "full_access" | null;
|
|
112
|
+
/** True only in the single successful dispatch response; GET never authorizes execution. */
|
|
113
|
+
executionAuthorized: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface NetworkActionInput {
|
|
116
|
+
to: string;
|
|
117
|
+
action: NetworkProtectedAction;
|
|
118
|
+
description: string;
|
|
119
|
+
conversationId?: string;
|
|
120
|
+
taskId?: string;
|
|
121
|
+
ttlSeconds?: number;
|
|
122
|
+
}
|
|
88
123
|
export interface Conversation {
|
|
89
124
|
id: string;
|
|
90
125
|
participants: Array<{
|
|
@@ -95,13 +130,15 @@ export interface Conversation {
|
|
|
95
130
|
createdAt: string;
|
|
96
131
|
metadata: Metadata | null;
|
|
97
132
|
}
|
|
98
|
-
export type TaskState = "submitted" | "working" | "input_required" | "completed" | "failed" | "canceled" | "rejected";
|
|
133
|
+
export type TaskState = "submitted" | "working" | "input_required" | "auth_required" | "completed" | "failed" | "canceled" | "rejected";
|
|
99
134
|
export interface Task {
|
|
100
135
|
id: string;
|
|
101
136
|
conversationId: string;
|
|
102
137
|
requesterId: string;
|
|
103
138
|
assigneeId: string;
|
|
104
139
|
state: TaskState;
|
|
140
|
+
statusMessage?: { type: "text"; text: string } | { type: "json"; data: JsonValue } | null;
|
|
141
|
+
authorizationRequestId?: string | null;
|
|
105
142
|
createdAt: string;
|
|
106
143
|
updatedAt: string;
|
|
107
144
|
version: number;
|
|
@@ -547,6 +584,7 @@ export type SendMessage = {
|
|
|
547
584
|
message?: never;
|
|
548
585
|
} | {
|
|
549
586
|
content: MessageContent;
|
|
587
|
+
actionRequest?: NetworkActionRequest | null;
|
|
550
588
|
text?: never;
|
|
551
589
|
message?: never;
|
|
552
590
|
} | {
|
|
@@ -638,3 +676,20 @@ export interface RuntimeHeartbeat {
|
|
|
638
676
|
connected: boolean;
|
|
639
677
|
lastSeenAt: string;
|
|
640
678
|
}
|
|
679
|
+
|
|
680
|
+
/** Durable owner-authorized activity. A feed entry never grants execution. */
|
|
681
|
+
export interface NetworkActivity {
|
|
682
|
+
id: string;
|
|
683
|
+
sequence: string;
|
|
684
|
+
type: string;
|
|
685
|
+
targetId: string | null;
|
|
686
|
+
metadata: Metadata;
|
|
687
|
+
createdAt: string;
|
|
688
|
+
actionRequest: NetworkActionRequest | null;
|
|
689
|
+
executionAuthorized: false;
|
|
690
|
+
}
|
|
691
|
+
export interface NetworkActivityPage extends Page<NetworkActivity> {
|
|
692
|
+
cursor: string;
|
|
693
|
+
actionMode: "ask_me" | "full_access";
|
|
694
|
+
actionModeVersion: number;
|
|
695
|
+
}
|
package/bin/sdk/types.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/bin/totem.mjs
CHANGED
|
@@ -237,9 +237,9 @@ function compactDigest(value) {
|
|
|
237
237
|
function help() {
|
|
238
238
|
writeBrand();
|
|
239
239
|
writeHelpBody(`Start here
|
|
240
|
-
Install once npm install --global totemlayer
|
|
240
|
+
Install once npm install --global https://totemlayer.com/downloads/totemlayer-0.1.30.tgz
|
|
241
241
|
Confirm installation totem --version
|
|
242
|
-
Run one-off npx --yes --package
|
|
242
|
+
Run one-off npx --yes --package https://totemlayer.com/downloads/totemlayer-0.1.30.tgz totem --help
|
|
243
243
|
|
|
244
244
|
Connect once and receive messages and approved Mission work
|
|
245
245
|
Select Codex, Claude, a local model, or an owner-configured CLI/HTTP agent.
|
package/package.json
CHANGED
package/scripts/prepare.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { access } from "node:fs/promises";
|
|
1
|
+
import { access, readdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { transform } from "esbuild";
|
|
2
3
|
// This candidate rebases coordination on the immutable published 0.1.21 bundle.
|
|
3
4
|
// Its bundled SDK is the release source; do not rebuild it from an older sibling checkout.
|
|
4
5
|
for (const name of [
|
|
@@ -7,3 +8,17 @@ for (const name of [
|
|
|
7
8
|
"network-retry.mjs", "runtime-diagnostics.mjs", "codex-chat-bridge.mjs",
|
|
8
9
|
"worker-core/adapters.mjs", "worker-core/errors.mjs",
|
|
9
10
|
]) await access(new URL(`../bin/${name}`, import.meta.url));
|
|
11
|
+
|
|
12
|
+
// Compact the release SDK without rebuilding it from an older sibling source.
|
|
13
|
+
// Retain every module, export, name and declaration; no feature code is removed.
|
|
14
|
+
const sdk = new URL("../bin/sdk/", import.meta.url);
|
|
15
|
+
for (const name of await readdir(sdk)) {
|
|
16
|
+
if (!name.endsWith(".js")) continue;
|
|
17
|
+
const path = new URL(name, sdk);
|
|
18
|
+
const result = await transform(await readFile(path, "utf8"), {
|
|
19
|
+
loader: "js", target: "es2022", format: "esm",
|
|
20
|
+
minifyWhitespace: true, minifyIdentifiers: false, minifySyntax: false,
|
|
21
|
+
treeShaking: false, keepNames: false, legalComments: "eof",
|
|
22
|
+
});
|
|
23
|
+
await writeFile(path, result.code);
|
|
24
|
+
}
|