@peers-app/peers-sdk 0.19.14 → 0.20.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/dist/contracts/__tests__/builder.test.js +24 -0
- package/dist/contracts/__tests__/contract-events.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-events.test.js +199 -0
- package/dist/contracts/__tests__/contract-observables.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-observables.test.js +290 -0
- package/dist/contracts/__tests__/contract-provider-router.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-provider-router.test.js +193 -0
- package/dist/contracts/__tests__/contract-proxy.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-proxy.test.js +424 -0
- package/dist/contracts/__tests__/contract-resolvers.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-resolvers.test.js +148 -0
- package/dist/contracts/__tests__/contract-subscription-lifecycle.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-subscription-lifecycle.test.js +353 -0
- package/dist/contracts/__tests__/contract-table-events.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-table-events.test.js +209 -0
- package/dist/contracts/__tests__/contract-transport.test.d.ts +1 -0
- package/dist/contracts/__tests__/contract-transport.test.js +163 -0
- package/dist/contracts/__tests__/persistent-registry.test.d.ts +1 -0
- package/dist/contracts/__tests__/persistent-registry.test.js +109 -0
- package/dist/contracts/__tests__/playground.test.d.ts +1 -0
- package/dist/contracts/__tests__/playground.test.js +213 -0
- package/dist/contracts/__tests__/validate.test.js +122 -0
- package/dist/contracts/builder.d.ts +9 -1
- package/dist/contracts/builder.js +13 -0
- package/dist/contracts/contract-provider-router.d.ts +72 -0
- package/dist/contracts/contract-provider-router.js +164 -0
- package/dist/contracts/contract-proxy.d.ts +333 -0
- package/dist/contracts/contract-proxy.js +663 -0
- package/dist/contracts/contract-resolvers.d.ts +66 -0
- package/dist/contracts/contract-resolvers.js +138 -0
- package/dist/contracts/contract-transport.d.ts +94 -0
- package/dist/contracts/contract-transport.js +159 -0
- package/dist/contracts/contracts.table.d.ts +1 -1
- package/dist/contracts/contracts.table.js +2 -2
- package/dist/contracts/index.d.ts +7 -1
- package/dist/contracts/index.js +34 -1
- package/dist/contracts/persistent-registry.js +3 -1
- package/dist/contracts/system/device-operations-contract.d.ts +72 -0
- package/dist/contracts/system/device-operations-contract.js +110 -0
- package/dist/contracts/system/logs-contract.d.ts +24 -0
- package/dist/contracts/system/logs-contract.js +60 -0
- package/dist/contracts/types.d.ts +27 -4
- package/dist/contracts/validate.d.ts +2 -2
- package/dist/contracts/validate.js +44 -2
- package/dist/data/assistants.d.ts +4 -4
- package/dist/data/channels.d.ts +1 -1
- package/dist/data/devices.d.ts +1 -1
- package/dist/data/embeddings.d.ts +1 -1
- package/dist/data/group-secret.d.ts +21 -0
- package/dist/data/group-secret.js +53 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/data/index.js +1 -0
- package/dist/data/messages.d.ts +1 -1
- package/dist/data/orm/decorators.d.ts +6 -0
- package/dist/data/orm/decorators.js +21 -0
- package/dist/data/package-versions.d.ts +2 -2
- package/dist/data/peer-types.d.ts +1 -1
- package/dist/data/persistent-vars.d.ts +17 -0
- package/dist/data/persistent-vars.js +115 -35
- package/dist/data/persistent-vars.migration.test.d.ts +1 -0
- package/dist/data/persistent-vars.migration.test.js +133 -0
- package/dist/data/table-definitions-table.d.ts +1 -1
- package/dist/data/tool-tests.d.ts +1 -1
- package/dist/data/tools.d.ts +1 -1
- package/dist/data/user-trust-levels.d.ts +3 -1
- package/dist/data/user-trust-levels.js +2 -1
- package/dist/data/user-trust-levels.test.d.ts +1 -0
- package/dist/data/user-trust-levels.test.js +37 -0
- package/dist/data/voice-messages.d.ts +1 -1
- package/dist/data/workflow-logs.d.ts +1 -1
- package/dist/data/workflow-runs.d.ts +2 -2
- package/dist/data/workflows.d.ts +3 -3
- package/dist/device/binary-peer-connection-v2.d.ts +2 -0
- package/dist/device/binary-peer-connection-v2.js +12 -2
- package/dist/device/binary-peer-connection-v2.test.js +23 -0
- package/dist/device/get-trust-level-fn.d.ts +6 -0
- package/dist/device/get-trust-level-fn.js +12 -7
- package/dist/device/get-trust-level-fn.test.js +16 -2
- package/dist/logging/console-logs.table.d.ts +3 -0
- package/dist/logging/console-logs.table.js +2 -1
- package/dist/rpc-types.d.ts +37 -0
- package/dist/rpc-types.js +13 -0
- package/dist/system-ids.d.ts +25 -0
- package/dist/system-ids.js +26 -1
- package/dist/types/workflow.d.ts +4 -4
- package/package.json +1 -1
|
@@ -4,6 +4,12 @@ exports.getTrustLevelFn = getTrustLevelFn;
|
|
|
4
4
|
const context_1 = require("../context");
|
|
5
5
|
const data_1 = require("../data");
|
|
6
6
|
const socket_type_1 = require("./socket.type");
|
|
7
|
+
/**
|
|
8
|
+
* Build the connection-handshake trust evaluator for a local user identity.
|
|
9
|
+
*
|
|
10
|
+
* Known user keys are authoritative even for a newly observed device: a claimed identity
|
|
11
|
+
* whose signing or box key differs from the stored user record is rejected as untrusted.
|
|
12
|
+
*/
|
|
7
13
|
function getTrustLevelFn(me, serverUrl) {
|
|
8
14
|
return async function getTrustLevel(deviceInfo, _registerNew) {
|
|
9
15
|
const userContext = await (0, context_1.getUserContext)();
|
|
@@ -67,12 +73,11 @@ function getTrustLevelFn(me, serverUrl) {
|
|
|
67
73
|
}
|
|
68
74
|
const effectiveUser = user ?? groupUser;
|
|
69
75
|
if (effectiveUser &&
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
deviceInfo.
|
|
73
|
-
deviceInfo.
|
|
74
|
-
|
|
75
|
-
// deviceInfo does not align with local info about user and device, return Untrusted
|
|
76
|
+
(deviceInfo.userId !== effectiveUser.userId ||
|
|
77
|
+
deviceInfo.publicKey !== effectiveUser.publicKey ||
|
|
78
|
+
deviceInfo.publicBoxKey !== effectiveUser.publicBoxKey ||
|
|
79
|
+
(device ? deviceInfo.userId !== device.userId : false))) {
|
|
80
|
+
// deviceInfo does not align with local info about the user or device, return Untrusted
|
|
76
81
|
// TODO check if user has changed their public keys
|
|
77
82
|
return socket_type_1.TrustLevel.Untrusted;
|
|
78
83
|
}
|
|
@@ -151,7 +156,7 @@ function getTrustLevelFn(me, serverUrl) {
|
|
|
151
156
|
// assignedAt: new Date(),
|
|
152
157
|
// }, { restoreIfDeleted: true });
|
|
153
158
|
// }
|
|
154
|
-
if (newUser) {
|
|
159
|
+
if (newUser && user) {
|
|
155
160
|
// TODO: I'm not sure we immediately want to save this user to the my personal db...
|
|
156
161
|
await (0, data_1.Users)(userDataContext).save(user, {
|
|
157
162
|
restoreIfDeleted: true,
|
|
@@ -255,7 +255,7 @@ describe("getTrustLevelFn", () => {
|
|
|
255
255
|
const result = await getTrustLevel(other);
|
|
256
256
|
expect(result).not.toBe(socket_type_1.TrustLevel.Untrusted);
|
|
257
257
|
});
|
|
258
|
-
it("
|
|
258
|
+
it("returns Untrusted for a known user's signing-key mismatch on a new device", async () => {
|
|
259
259
|
const me = makeTestIdentity();
|
|
260
260
|
const other = makeTestIdentity();
|
|
261
261
|
const existingUser = {
|
|
@@ -268,7 +268,21 @@ describe("getTrustLevelFn", () => {
|
|
|
268
268
|
setupMocks(null, existingUser);
|
|
269
269
|
const getTrustLevel = (0, get_trust_level_fn_1.getTrustLevelFn)(me);
|
|
270
270
|
const result = await getTrustLevel(other);
|
|
271
|
-
expect(result).
|
|
271
|
+
expect(result).toBe(socket_type_1.TrustLevel.Untrusted);
|
|
272
|
+
});
|
|
273
|
+
it("returns Untrusted for a known user's box-key mismatch on a new device", async () => {
|
|
274
|
+
const me = makeTestIdentity();
|
|
275
|
+
const other = makeTestIdentity();
|
|
276
|
+
const existingUser = {
|
|
277
|
+
userId: other.userId,
|
|
278
|
+
publicKey: other.publicKey,
|
|
279
|
+
publicBoxKey: `different_pbk_${(0, utils_1.newid)()}`,
|
|
280
|
+
name: "Alice",
|
|
281
|
+
};
|
|
282
|
+
setupMocks(null, existingUser);
|
|
283
|
+
const getTrustLevel = (0, get_trust_level_fn_1.getTrustLevelFn)(me);
|
|
284
|
+
const result = await getTrustLevel(other);
|
|
285
|
+
expect(result).toBe(socket_type_1.TrustLevel.Untrusted);
|
|
272
286
|
});
|
|
273
287
|
});
|
|
274
288
|
// ─── Trusted fast path ──────────────────────────────────────────────────────
|
|
@@ -35,6 +35,7 @@ export declare const consoleLogSchema: z.ZodObject<{
|
|
|
35
35
|
export type IConsoleLog = z.infer<typeof consoleLogSchema>;
|
|
36
36
|
/** Cutoff within this many ms of `Date.now()` is treated as "clear all" (manual clear). */
|
|
37
37
|
export declare const CLEAR_ALL_CUTOFF_SLACK_MS = 5000;
|
|
38
|
+
declare const metaData: ITableMetaData;
|
|
38
39
|
/**
|
|
39
40
|
* Returns whether a cutoff timestamp should trigger a full-table clear (drop + recreate)
|
|
40
41
|
* rather than a conditional delete. Used when the UI calls `deleteOldLogs(Date.now())`.
|
|
@@ -65,3 +66,5 @@ export declare class ConsoleLogsTable extends Table<IConsoleLog> {
|
|
|
65
66
|
* Returns the user's personal {@link ConsoleLogsTable} (logs are not synced across devices).
|
|
66
67
|
*/
|
|
67
68
|
export declare function ConsoleLogs(): Promise<ConsoleLogsTable>;
|
|
69
|
+
/** Table metadata for the {@link ConsoleLogsTable} (name, primary key, fields). */
|
|
70
|
+
export { metaData as consoleLogsMetaData };
|
|
@@ -34,7 +34,7 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
34
34
|
done = true;
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.ConsoleLogsTable = exports.CLEAR_ALL_CUTOFF_SLACK_MS = exports.consoleLogSchema = void 0;
|
|
37
|
+
exports.consoleLogsMetaData = exports.ConsoleLogsTable = exports.CLEAR_ALL_CUTOFF_SLACK_MS = exports.consoleLogSchema = void 0;
|
|
38
38
|
exports.isClearAllCutoff = isClearAllCutoff;
|
|
39
39
|
exports.ConsoleLogs = ConsoleLogs;
|
|
40
40
|
const zod_1 = require("zod");
|
|
@@ -73,6 +73,7 @@ const metaData = {
|
|
|
73
73
|
{ fields: ["processInstanceId"] },
|
|
74
74
|
],
|
|
75
75
|
};
|
|
76
|
+
exports.consoleLogsMetaData = metaData;
|
|
76
77
|
/**
|
|
77
78
|
* Returns whether a cutoff timestamp should trigger a full-table clear (drop + recreate)
|
|
78
79
|
* rather than a conditional delete. Used when the UI calls `deleteOldLogs(Date.now())`.
|
package/dist/rpc-types.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import type { IDeviceDatabaseQueryResult, IDeviceOperationStatus, IDeviceToolRunInput } from "./contracts/system/device-operations-contract";
|
|
2
|
+
import type { ITool } from "./data/tools";
|
|
3
|
+
import type { IConsoleLog } from "./logging/console-logs.table";
|
|
4
|
+
/** Named event payload sent across the frontend RPC bridge. */
|
|
1
5
|
export interface IEventData<T = any> {
|
|
2
6
|
name: string;
|
|
3
7
|
data: T;
|
|
4
8
|
}
|
|
9
|
+
/** Serializable description of one interactive UI element. */
|
|
5
10
|
export interface UIElement {
|
|
6
11
|
tag: string;
|
|
7
12
|
text?: string;
|
|
@@ -18,6 +23,7 @@ export interface UIElement {
|
|
|
18
23
|
height: number;
|
|
19
24
|
};
|
|
20
25
|
}
|
|
26
|
+
/** Serializable renderer state returned to CLI UI-inspection commands. */
|
|
21
27
|
export interface UIState {
|
|
22
28
|
url: string;
|
|
23
29
|
title: string;
|
|
@@ -25,6 +31,24 @@ export interface UIState {
|
|
|
25
31
|
text: string;
|
|
26
32
|
elements: UIElement[];
|
|
27
33
|
}
|
|
34
|
+
/** One verified direct device connection exposed by the local Electron bridge. */
|
|
35
|
+
export interface IConnectedDeviceSummary {
|
|
36
|
+
deviceId: string;
|
|
37
|
+
userId: string;
|
|
38
|
+
connectionId: string;
|
|
39
|
+
connectionAddress?: string;
|
|
40
|
+
trustLevel: number;
|
|
41
|
+
verified: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** Filters and bounds for one remote System Logs query. */
|
|
44
|
+
export interface IRemoteLogsQueryInput {
|
|
45
|
+
dataContextId?: string;
|
|
46
|
+
filter?: Record<string, unknown>;
|
|
47
|
+
pageSize?: number;
|
|
48
|
+
sortBy?: string[];
|
|
49
|
+
textSearch?: string;
|
|
50
|
+
}
|
|
51
|
+
/** RPC methods implemented by the trusted local server/main process. */
|
|
28
52
|
export declare const rpcServerCalls: {
|
|
29
53
|
ping: (msg: string) => Promise<string>;
|
|
30
54
|
openLinkInBrowser: (url: string) => Promise<void>;
|
|
@@ -102,6 +126,13 @@ export declare const rpcServerCalls: {
|
|
|
102
126
|
rowCount: number;
|
|
103
127
|
}>;
|
|
104
128
|
runTool: (toolId: string, args: Record<string, any>, dataContextId?: string, assistantId?: string) => Promise<any>;
|
|
129
|
+
listConnectedDevices: () => Promise<IConnectedDeviceSummary[]>;
|
|
130
|
+
getRemoteDeviceStatus: (deviceId: string, dataContextId?: string) => Promise<IDeviceOperationStatus>;
|
|
131
|
+
remoteDbQuery: (deviceId: string, query: string, dataContextId?: string) => Promise<IDeviceDatabaseQueryResult>;
|
|
132
|
+
remoteListTools: (deviceId: string, limit?: number, dataContextId?: string) => Promise<ITool[]>;
|
|
133
|
+
remoteGetTool: (deviceId: string, toolIdOrName: string, dataContextId?: string) => Promise<ITool | null>;
|
|
134
|
+
remoteRunTool: (deviceId: string, input: IDeviceToolRunInput, dataContextId?: string) => Promise<unknown>;
|
|
135
|
+
remoteQueryLogs: (deviceId: string, input?: IRemoteLogsQueryInput) => Promise<IConsoleLog[]>;
|
|
105
136
|
uiReload: (options?: {
|
|
106
137
|
ignoreCache?: boolean;
|
|
107
138
|
}) => Promise<void>;
|
|
@@ -152,6 +183,7 @@ export declare const rpcServerCalls: {
|
|
|
152
183
|
subscribePrefixes: (prefixes: string[]) => Promise<void>;
|
|
153
184
|
unsubscribePrefixes: (prefixes: string[]) => Promise<void>;
|
|
154
185
|
};
|
|
186
|
+
/** RPC methods implemented by renderer/frontend clients. */
|
|
155
187
|
export declare const rpcClientCalls: {
|
|
156
188
|
ping: (msg: string) => Promise<string>;
|
|
157
189
|
emitEvent: (event: IEventData) => Promise<boolean>;
|
|
@@ -182,8 +214,13 @@ export declare const rpcClientCalls: {
|
|
|
182
214
|
error?: string;
|
|
183
215
|
}>;
|
|
184
216
|
};
|
|
217
|
+
/** Name of a server/main-process RPC method. */
|
|
185
218
|
export type RpcServerNames = keyof typeof rpcServerCalls;
|
|
219
|
+
/** Name of a renderer/frontend RPC method. */
|
|
186
220
|
export type RpcClientNames = keyof typeof rpcClientCalls;
|
|
221
|
+
/** Whether this module is executing in a renderer, browser, or CLI client context. */
|
|
187
222
|
export declare const isClient: boolean;
|
|
223
|
+
/** Mark the runtime as a single-process client such as the PWA. */
|
|
188
224
|
export declare function setSingleProcessClient(value: boolean): void;
|
|
225
|
+
/** Return whether client and server responsibilities share one process. */
|
|
189
226
|
export declare function isSingleProcessClient(): boolean;
|
package/dist/rpc-types.js
CHANGED
|
@@ -10,6 +10,7 @@ function rpcStub(rpcName) {
|
|
|
10
10
|
JSON.stringify({ rpcName, args }, null, 2));
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
/** RPC methods implemented by the trusted local server/main process. */
|
|
13
14
|
exports.rpcServerCalls = {
|
|
14
15
|
ping: async (msg) => `pong: ${msg}`,
|
|
15
16
|
// TODO collapse these two down to just openPath
|
|
@@ -60,6 +61,14 @@ exports.rpcServerCalls = {
|
|
|
60
61
|
dbQuery: rpcStub("dbQuery"),
|
|
61
62
|
// Direct tool execution (for CLI)
|
|
62
63
|
runTool: rpcStub("runTool"),
|
|
64
|
+
// Headless direct-device administration bridge (for CLI)
|
|
65
|
+
listConnectedDevices: rpcStub("listConnectedDevices"),
|
|
66
|
+
getRemoteDeviceStatus: rpcStub("getRemoteDeviceStatus"),
|
|
67
|
+
remoteDbQuery: rpcStub("remoteDbQuery"),
|
|
68
|
+
remoteListTools: rpcStub("remoteListTools"),
|
|
69
|
+
remoteGetTool: rpcStub("remoteGetTool"),
|
|
70
|
+
remoteRunTool: rpcStub("remoteRunTool"),
|
|
71
|
+
remoteQueryLogs: rpcStub("remoteQueryLogs"),
|
|
63
72
|
// UI control (for CLI)
|
|
64
73
|
uiReload: rpcStub("uiReload"),
|
|
65
74
|
uiInspect: rpcStub("uiInspect"),
|
|
@@ -90,6 +99,7 @@ exports.rpcServerCalls = {
|
|
|
90
99
|
subscribePrefixes: rpcStub("subscribePrefixes"),
|
|
91
100
|
unsubscribePrefixes: rpcStub("unsubscribePrefixes"),
|
|
92
101
|
};
|
|
102
|
+
/** RPC methods implemented by renderer/frontend clients. */
|
|
93
103
|
exports.rpcClientCalls = {
|
|
94
104
|
ping: async (msg) => `pong: ${msg}`,
|
|
95
105
|
// emitEvent: rpcStub('emitEvent') as ((event: IEventData) => Promise<boolean>),
|
|
@@ -106,14 +116,17 @@ exports.rpcClientCalls = {
|
|
|
106
116
|
// Check if we're in a client context (browser, webview, or CLI connected to server)
|
|
107
117
|
// - Browser: window + document exist
|
|
108
118
|
// - CLI: process.env.PEERS_IS_CLIENT === 'true'
|
|
119
|
+
/** Whether this module is executing in a renderer, browser, or CLI client context. */
|
|
109
120
|
exports.isClient = (typeof window !== "undefined" && typeof document !== "undefined") ||
|
|
110
121
|
(typeof process !== "undefined" && process.env?.PEERS_IS_CLIENT === "true");
|
|
111
122
|
// Single-process mode (PWA): client and server live in the same process,
|
|
112
123
|
// so Table events must NOT be suppressed on the client side.
|
|
113
124
|
let _singleProcessClient = false;
|
|
125
|
+
/** Mark the runtime as a single-process client such as the PWA. */
|
|
114
126
|
function setSingleProcessClient(value) {
|
|
115
127
|
_singleProcessClient = value;
|
|
116
128
|
}
|
|
129
|
+
/** Return whether client and server responsibilities share one process. */
|
|
117
130
|
function isSingleProcessClient() {
|
|
118
131
|
return _singleProcessClient;
|
|
119
132
|
}
|
package/dist/system-ids.d.ts
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
|
+
/** Stable user ID that owns built-in Peers system records. */
|
|
1
2
|
export declare const peersRootUserId = "000peers0user000000000001";
|
|
3
|
+
/** Default assistant used when no user-selected assistant is available. */
|
|
2
4
|
export declare const defaultAssistantId = "000peers0bot00000000shell";
|
|
5
|
+
/** Stable ID of the bundled OpenCode assistant. */
|
|
3
6
|
export declare const openCodeAssistantId = "00mlwl2km2opencode0000001";
|
|
7
|
+
/** Stable ID of the default assistant-runner tool. */
|
|
4
8
|
export declare const defaultAssistantRunnerToolId = "000peers0tool00000runner1";
|
|
9
|
+
/** Stable ID of the built-in send-message tool. */
|
|
5
10
|
export declare const defaultSendMessageToolId = "000peers0tool00000sendmsg";
|
|
11
|
+
/** Stable ID of the built-in workflow runner tool. */
|
|
6
12
|
export declare const runWorkflowToolId = "000peers0tool0runworkflow";
|
|
13
|
+
/** Stable package ID of the bundled peers-core package. */
|
|
7
14
|
export declare const peersCorePackageId = "00mh0wlipjixk2gqmurbwee0o";
|
|
15
|
+
/** Canonical source repository for peers-core. */
|
|
8
16
|
export declare const peersCorePackageRepoUrl = "https://github.com/peers-app/peers-core";
|
|
17
|
+
/** Trusted publishing key for official peers-core releases. */
|
|
9
18
|
export declare const peersCorePublishPublicKey = "S7cQqnvVz-FVDO6Lk5zC7epSvcP_-NyBVZz9gdcj73c";
|
|
19
|
+
/**
|
|
20
|
+
* Stable id of the peers **system** itself, used as the `providerPackageId` for
|
|
21
|
+
* built-in system contracts (contracts the platform provides rather than a package).
|
|
22
|
+
*/
|
|
23
|
+
export declare const peersSystemPackageId = "000peers0system0000000001";
|
|
24
|
+
/**
|
|
25
|
+
* Contract id for the built-in **System Logs** contract (read/write the local device's
|
|
26
|
+
* console logs). This is the first minimal system contract and the proof-of-concept for
|
|
27
|
+
* contract-consumer-based remote RPC. See `contracts/system/logs-contract.ts`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const logsContractId = "000peers0logs000000000001";
|
|
30
|
+
/**
|
|
31
|
+
* Contract id for the built-in **System Device Operations** contract. The provider exposes
|
|
32
|
+
* explicit owner-authorized status, bounded read-only database, and installed-tool operations.
|
|
33
|
+
*/
|
|
34
|
+
export declare const deviceOperationsContractId = "00mriijkhq94msfe9m2j6quwp";
|
package/dist/system-ids.js
CHANGED
|
@@ -1,13 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.peersCorePublishPublicKey = exports.peersCorePackageRepoUrl = exports.peersCorePackageId = exports.runWorkflowToolId = exports.defaultSendMessageToolId = exports.defaultAssistantRunnerToolId = exports.openCodeAssistantId = exports.defaultAssistantId = exports.peersRootUserId = void 0;
|
|
3
|
+
exports.deviceOperationsContractId = exports.logsContractId = exports.peersSystemPackageId = exports.peersCorePublishPublicKey = exports.peersCorePackageRepoUrl = exports.peersCorePackageId = exports.runWorkflowToolId = exports.defaultSendMessageToolId = exports.defaultAssistantRunnerToolId = exports.openCodeAssistantId = exports.defaultAssistantId = exports.peersRootUserId = void 0;
|
|
4
|
+
/** Stable user ID that owns built-in Peers system records. */
|
|
4
5
|
exports.peersRootUserId = "000peers0user000000000001";
|
|
6
|
+
/** Default assistant used when no user-selected assistant is available. */
|
|
5
7
|
exports.defaultAssistantId = "000peers0bot00000000shell";
|
|
6
8
|
// export const defaultAssistantId = '000peers0bot000000000bot1';
|
|
9
|
+
/** Stable ID of the bundled OpenCode assistant. */
|
|
7
10
|
exports.openCodeAssistantId = "00mlwl2km2opencode0000001";
|
|
11
|
+
/** Stable ID of the default assistant-runner tool. */
|
|
8
12
|
exports.defaultAssistantRunnerToolId = "000peers0tool00000runner1";
|
|
13
|
+
/** Stable ID of the built-in send-message tool. */
|
|
9
14
|
exports.defaultSendMessageToolId = "000peers0tool00000sendmsg";
|
|
15
|
+
/** Stable ID of the built-in workflow runner tool. */
|
|
10
16
|
exports.runWorkflowToolId = "000peers0tool0runworkflow";
|
|
17
|
+
/** Stable package ID of the bundled peers-core package. */
|
|
11
18
|
exports.peersCorePackageId = "00mh0wlipjixk2gqmurbwee0o";
|
|
19
|
+
/** Canonical source repository for peers-core. */
|
|
12
20
|
exports.peersCorePackageRepoUrl = "https://github.com/peers-app/peers-core";
|
|
21
|
+
/** Trusted publishing key for official peers-core releases. */
|
|
13
22
|
exports.peersCorePublishPublicKey = "S7cQqnvVz-FVDO6Lk5zC7epSvcP_-NyBVZz9gdcj73c";
|
|
23
|
+
/**
|
|
24
|
+
* Stable id of the peers **system** itself, used as the `providerPackageId` for
|
|
25
|
+
* built-in system contracts (contracts the platform provides rather than a package).
|
|
26
|
+
*/
|
|
27
|
+
exports.peersSystemPackageId = "000peers0system0000000001";
|
|
28
|
+
/**
|
|
29
|
+
* Contract id for the built-in **System Logs** contract (read/write the local device's
|
|
30
|
+
* console logs). This is the first minimal system contract and the proof-of-concept for
|
|
31
|
+
* contract-consumer-based remote RPC. See `contracts/system/logs-contract.ts`.
|
|
32
|
+
*/
|
|
33
|
+
exports.logsContractId = "000peers0logs000000000001";
|
|
34
|
+
/**
|
|
35
|
+
* Contract id for the built-in **System Device Operations** contract. The provider exposes
|
|
36
|
+
* explicit owner-authorized status, bounded read-only database, and installed-tool operations.
|
|
37
|
+
*/
|
|
38
|
+
exports.deviceOperationsContractId = "00mriijkhq94msfe9m2j6quwp";
|
package/dist/types/workflow.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export declare const workflowSchema: z.ZodObject<{
|
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
45
|
name: string;
|
|
46
46
|
description: string;
|
|
47
|
+
createdAt: Date;
|
|
48
|
+
updatedAt: Date;
|
|
47
49
|
workflowId: string;
|
|
48
50
|
defaultAssistantId: string;
|
|
49
51
|
instructions: {
|
|
@@ -53,8 +55,6 @@ export declare const workflowSchema: z.ZodObject<{
|
|
|
53
55
|
subWorkflowId?: string | undefined;
|
|
54
56
|
}[];
|
|
55
57
|
createdBy: string;
|
|
56
|
-
createdAt: Date;
|
|
57
|
-
updatedAt: Date;
|
|
58
58
|
packageId?: string | undefined;
|
|
59
59
|
}, {
|
|
60
60
|
name: string;
|
|
@@ -63,13 +63,13 @@ export declare const workflowSchema: z.ZodObject<{
|
|
|
63
63
|
defaultAssistantId: string;
|
|
64
64
|
createdBy: string;
|
|
65
65
|
packageId?: string | undefined;
|
|
66
|
+
createdAt?: Date | undefined;
|
|
67
|
+
updatedAt?: Date | undefined;
|
|
66
68
|
instructions?: {
|
|
67
69
|
markdown?: string | undefined;
|
|
68
70
|
onError?: string | undefined;
|
|
69
71
|
directCallToolId?: string | undefined;
|
|
70
72
|
subWorkflowId?: string | undefined;
|
|
71
73
|
}[] | undefined;
|
|
72
|
-
createdAt?: Date | undefined;
|
|
73
|
-
updatedAt?: Date | undefined;
|
|
74
74
|
}>;
|
|
75
75
|
export type IWorkflow = z.infer<typeof workflowSchema>;
|