zigmini 1.0.0-beta.3 → 1.1.0-beta.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/README.ko.md +27 -2
- package/README.md +27 -2
- package/assets/agent/gateway-request-rules.md +1 -1
- package/assets/agent/gateway-rules.md +6 -1
- package/assets/android/zigmini.apk +0 -0
- package/assets/android/zigmini.apk.json +3 -3
- package/assets/build.json +1 -1
- package/assets/document-reader/document-reader +0 -0
- package/assets/document-reader/host-selector +0 -0
- package/assets/document-reader/manifest.json +27 -0
- package/docs/manual.ko.md +114 -10
- package/docs/manual.md +117 -11
- package/host/document-reader/DocumentRead.swift +370 -0
- package/host/document-reader/HostSelector.swift +192 -0
- package/host/document-reader/Protocol.swift +647 -0
- package/host/document-reader/main.swift +22 -0
- package/host/omo-bridge/agent-aside-tool.ts +119 -0
- package/host/omo-bridge/agent-aside.ts +522 -0
- package/host/omo-bridge/agent-collaboration-files.ts +282 -0
- package/host/omo-bridge/agent-collaboration.ts +385 -0
- package/host/omo-bridge/agent-control.ts +400 -28
- package/host/omo-bridge/agent-execution.sb +42 -0
- package/host/omo-bridge/agent-execution.ts +158 -0
- package/host/omo-bridge/agent-tool-adapters.ts +388 -0
- package/host/omo-bridge/agent-tool-permissions.ts +96 -0
- package/host/omo-bridge/aside-tabs.ts +41 -0
- package/host/omo-bridge/attachment-read.ts +100 -0
- package/host/omo-bridge/bridge.ts +10 -0
- package/host/omo-bridge/managed-call.ts +46 -0
- package/host/omo-bridge/task-control.ts +39 -5
- package/host/omo-check/patches/attachments-293/README.md +138 -0
- package/host/omo-check/patches/attachments-293/document-content.js +234 -0
- package/host/omo-check/patches/attachments-293/document-content.types.txt +91 -0
- package/host/omo-check/patches/attachments-293/omo-5.1.51-documents.patch +831 -0
- package/host/omo-check/patches/attachments-293/omo-5.1.51-gateway-port.manifest.json +471 -0
- package/host/omo-check/patches/omo-5.1.51-agent-tool-authority.patch +471 -0
- package/host/omo-check/patches/omo-5.1.51-gateway-port.manifest.json +28 -6
- package/host/omo-check/patches/omo-5.1.51-memory-receipts.patch +5 -0
- package/package.json +5 -3
- package/src/agent/api.ts +345 -20
- package/src/agent/artifacts.ts +196 -0
- package/src/agent/aside-target-routes.ts +369 -0
- package/src/agent/aside-targets.ts +215 -0
- package/src/agent/collaboration-admission.ts +47 -0
- package/src/agent/collaboration-read.ts +117 -0
- package/src/agent/collaboration-session.ts +196 -0
- package/src/agent/collaboration-types.ts +258 -0
- package/src/agent/collaboration.ts +399 -0
- package/src/agent/definition.ts +65 -3
- package/src/agent/fields.ts +9 -3
- package/src/agent/file-core.ts +325 -0
- package/src/agent/files.ts +87 -8
- package/src/agent/list.ts +3 -3
- package/src/agent/managed-call.ts +144 -0
- package/src/agent/tool-catalog.ts +184 -0
- package/src/agent/tool-delivery.ts +359 -0
- package/src/agent/tool-permission-types.ts +81 -0
- package/src/agent/tool-permissions.ts +1366 -0
- package/src/attachments/api.ts +161 -0
- package/src/attachments/document-reader.ts +325 -0
- package/src/attachments/host-selector.ts +410 -0
- package/src/attachments/managed-binding.ts +83 -0
- package/src/attachments/prepare.ts +214 -0
- package/src/attachments/selector-port.ts +28 -0
- package/src/attachments/service.ts +729 -0
- package/src/attachments/store.ts +698 -0
- package/src/attachments/types.ts +123 -0
- package/src/cli/doctor.ts +30 -10
- package/src/decisions.ts +109 -10
- package/src/engine/apply-patch.ts +21 -0
- package/src/engine/compat.json +2 -1
- package/src/engine/install.ts +45 -4
- package/src/engine/sandbox-cell.ts +2 -0
- package/src/gc.ts +33 -225
- package/src/housekeeping/api.ts +163 -0
- package/src/housekeeping/audit.ts +61 -0
- package/src/housekeeping/collectors/agent-collaboration.ts +33 -0
- package/src/housekeeping/collectors/agent-drafts.ts +43 -0
- package/src/housekeeping/collectors/agent-file-trash.ts +36 -0
- package/src/housekeeping/collectors/agent-trash.ts +28 -0
- package/src/housekeeping/collectors/attachment-cleanup.ts +35 -0
- package/src/housekeeping/collectors/db-backup.ts +25 -0
- package/src/housekeeping/collectors/docker-build-cache.ts +29 -0
- package/src/housekeeping/collectors/docker-image.ts +135 -0
- package/src/housekeeping/collectors/omo-version.ts +32 -0
- package/src/housekeeping/collectors/orphan-test-process.ts +205 -0
- package/src/housekeeping/collectors/reconcile-work.ts +55 -0
- package/src/housekeeping/collectors/rpc-daemon.ts +39 -0
- package/src/housekeeping/collectors/shared.ts +149 -0
- package/src/housekeeping/collectors/temp-dir.ts +28 -0
- package/src/housekeeping/collectors/update-file.ts +25 -0
- package/src/housekeeping/collectors/worktree.ts +193 -0
- package/src/housekeeping/engine.ts +125 -0
- package/src/housekeeping/reconcile/work.ts +130 -0
- package/src/housekeeping/registry.ts +63 -0
- package/src/housekeeping/trash.ts +59 -0
- package/src/housekeeping/types.ts +31 -0
- package/src/hub.ts +1095 -41
- package/src/main.ts +228 -30
- package/src/message-references.ts +14 -5
- package/src/profile-prompt.ts +13 -1
- package/src/protocol.ts +41 -6
- package/src/security-allow.ts +79 -2
- package/src/security-check.ts +1 -1
- package/src/store.ts +1946 -23
- package/src/test-crash.ts +20 -0
- package/src/work-watch.ts +55 -7
- package/src/work.ts +192 -3
- package/web/DESIGN.md +33 -0
- package/web/agents.d.ts +189 -12
- package/web/agents.js +898 -39
- package/web/app.js +2634 -210
- package/web/attachments.d.ts +91 -0
- package/web/attachments.js +422 -0
- package/web/collaboration.d.ts +87 -0
- package/web/collaboration.js +290 -0
- package/web/decisions.d.ts +39 -2
- package/web/decisions.js +354 -2
- package/web/gc.d.ts +26 -5
- package/web/gc.js +113 -13
- package/web/i18n/agents.d.ts +4 -0
- package/web/i18n/agents.js +200 -8
- package/web/i18n/attachments.js +78 -0
- package/web/i18n/decisions.d.ts +4 -0
- package/web/i18n/decisions.js +68 -0
- package/web/i18n/gc.d.ts +4 -0
- package/web/i18n/gc.js +184 -2
- package/web/i18n/main.js +80 -8
- package/web/i18n/tour.d.ts +4 -0
- package/web/i18n/tour.js +37 -0
- package/web/index.html +20 -3
- package/web/profile.d.ts +2 -2
- package/web/profile.js +11 -6
- package/web/style.css +342 -21
- package/web/tooltip.d.ts +2 -0
- package/web/tooltip.js +12 -0
- package/web/tour.d.ts +57 -0
- package/web/tour.js +450 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
--- a/@code-yeongyu/senpi/dist/core/agent-session.js
|
|
2
|
+
+++ b/@code-yeongyu/senpi/dist/core/agent-session.js
|
|
3
|
+
@@ -13,6 +13,14 @@
|
|
4
|
+
* Modes use this class and add their own I/O layer on top.
|
|
5
|
+
*/
|
|
6
|
+
import { randomUUID } from "node:crypto";
|
|
7
|
+
+import { checkExternalToolStart, createPolicyPermissionAuthority, hasExternalPermissionAuthority, registerExternalPermissionAuthority as registerExternalAuthorityFor, requestExternalToolStart, settleExternalToolStart, } from "./extensions/builtin/permission-system/dispatch.js";
|
|
8
|
+
+import { getDispatchIdentity } from "./extensions/builtin/permission-system/dispatch-metadata.js";
|
|
9
|
+
+// Registered-agent tool operations (zigmini 294). Durable custom entries make a held call,
|
|
10
|
+
+// its single execution and its single continuation idempotent across restarts.
|
|
11
|
+
+const AGENT_TOOL_OPERATION_ENTRY = "agent_tool_operation";
|
|
12
|
+
+const AGENT_TOOL_STARTED_ENTRY = "agent_tool_started";
|
|
13
|
+
+const AGENT_TOOL_RESULT_ENTRY = "agent_tool_result";
|
|
14
|
+
+const AGENT_TOOL_RESUME_ENTRY = "agent_tool_resume";
|
|
15
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
16
|
+
import { rm } from "node:fs/promises";
|
|
17
|
+
import { dirname, join } from "node:path";
|
|
18
|
+
@@ -1251,6 +1259,12 @@
|
|
19
|
+
// Callers such as executeTool only honor an explicit block, so returning nothing here would let it run.
|
|
20
|
+
if ((await this._waitForToolBarrier(toolCall, signal)) && signal?.aborted) {
|
|
21
|
+
return { block: true, reason: "Operation aborted" };
|
|
22
|
+
+ }
|
|
23
|
+
+ // The registered-agent authority runs before every hook, so no preset, internal-tool
|
|
24
|
+
+ // exemption or extension answer can start a call it has not allowed.
|
|
25
|
+
+ const external = this._checkAgentToolStart(toolCall, args, options);
|
|
26
|
+
+ if (external !== undefined) {
|
|
27
|
+
+ return external;
|
|
28
|
+
}
|
|
29
|
+
const runner = this._extensionRunner;
|
|
30
|
+
if (!runner.hasHandlers("tool_call")) {
|
|
31
|
+
@@ -1272,6 +1286,142 @@
|
|
32
|
+
throw new Error(`Extension failed, blocking execution: ${String(err)}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
+ /** Install the authority that decides every tool start of this session. Returns its retirement. */
|
|
36
|
+
+ registerExternalPermissionAuthority(authority) {
|
|
37
|
+
+ return registerExternalAuthorityFor(this.sessionManager, authority);
|
|
38
|
+
+ }
|
|
39
|
+
+ hasExternalPermissionAuthority() {
|
|
40
|
+
+ return hasExternalPermissionAuthority(this.sessionManager);
|
|
41
|
+
+ }
|
|
42
|
+
+ /** A host-pushed policy replaces the previous one; the acknowledged revision is returned. */
|
|
43
|
+
+ applyAgentToolPolicy(policy) {
|
|
44
|
+
+ const authority = createPolicyPermissionAuthority(policy);
|
|
45
|
+
+ this._retireAgentToolPolicy?.();
|
|
46
|
+
+ this._retireAgentToolPolicy = this.registerExternalPermissionAuthority(authority);
|
|
47
|
+
+ return authority.describe();
|
|
48
|
+
+ }
|
|
49
|
+
+ _agentToolSource(toolName, args) {
|
|
50
|
+
+ const info = this._toolDefinitions.get(toolName);
|
|
51
|
+
+ if (info === undefined)
|
|
52
|
+
+ return { sourceKind: "unknown" };
|
|
53
|
+
+ const identity = getDispatchIdentity(info.definition.parameters, args);
|
|
54
|
+
+ return {
|
|
55
|
+
+ sourceKind: info.sourceInfo?.source ?? "unknown",
|
|
56
|
+
+ ...(info.sourceInfo?.path === undefined ? {} : { ownerPath: info.sourceInfo.path }),
|
|
57
|
+
+ ...(identity === undefined ? {} : { identity: { owner: identity.owner, operation: identity.operation } }),
|
|
58
|
+
+ };
|
|
59
|
+
+ }
|
|
60
|
+
+ /** Decide one start against the external authority; undefined when none is registered or it allows. */
|
|
61
|
+
+ _checkAgentToolStart(toolCall, args, options = {}) {
|
|
62
|
+
+ if (!hasExternalPermissionAuthority(this.sessionManager))
|
|
63
|
+
+ return undefined;
|
|
64
|
+
+ const operationId = options.agentToolOperationId ?? `agent-op:${toolCall.id}`;
|
|
65
|
+
+ const call = {
|
|
66
|
+
+ path: options.agentToolPath ?? (options.parentToolCallId ? "nested" : "direct"),
|
|
67
|
+
+ toolName: toolCall.name,
|
|
68
|
+
+ toolCallId: toolCall.id,
|
|
69
|
+
+ operationId,
|
|
70
|
+
+ input: args,
|
|
71
|
+
+ ...(options.parentToolCallId ? { parentToolCallId: options.parentToolCallId } : {}),
|
|
72
|
+
+ ...this._agentToolSource(toolCall.name, args),
|
|
73
|
+
+ };
|
|
74
|
+
+ const decision = checkExternalToolStart(this.sessionManager, call);
|
|
75
|
+
+ if (decision === undefined || decision.action === "allow")
|
|
76
|
+
+ return undefined;
|
|
77
|
+
+ if (decision.action === "deny" || options.agentToolOperationId !== undefined) {
|
|
78
|
+
+ return { block: true, reason: `agent_tool_denied: ${decision.reason ?? decision.action}` };
|
|
79
|
+
+ }
|
|
80
|
+
+ // Held: record the exact call once and end this tool call with one pending result.
|
|
81
|
+
+ // The native toolCall is not kept open; the host continues the logical work later.
|
|
82
|
+
+ let pending = this._findAgentToolEntry(AGENT_TOOL_OPERATION_ENTRY, operationId);
|
|
83
|
+
+ if (pending === undefined) {
|
|
84
|
+
+ const { requestId } = requestExternalToolStart(this.sessionManager, call);
|
|
85
|
+
+ const data = { operationId, requestId, toolName: toolCall.name, toolCallId: toolCall.id, input: args, path: call.path };
|
|
86
|
+
+ this._emitEntryAppended(this.sessionManager.appendCustomEntry(AGENT_TOOL_OPERATION_ENTRY, data));
|
|
87
|
+
+ pending = { data };
|
|
88
|
+
+ }
|
|
89
|
+
+ return {
|
|
90
|
+
+ block: true,
|
|
91
|
+
+ reason: JSON.stringify({ state: "permission_pending", requestId: pending.data.requestId, operationId }),
|
|
92
|
+
+ };
|
|
93
|
+
+ }
|
|
94
|
+
+ _findAgentToolEntry(customType, key, field = "operationId") {
|
|
95
|
+
+ return this.sessionManager
|
|
96
|
+
+ .getEntries()
|
|
97
|
+
+ .find((entry) => entry.type === "custom" && entry.customType === customType && entry.data?.[field] === key);
|
|
98
|
+
+ }
|
|
99
|
+
+ /**
|
|
100
|
+
+ * Run a held operation exactly once through the common tool pipeline (preflight included).
|
|
101
|
+
+ * A stored result is returned again without running the tool; a start without a result is
|
|
102
|
+
+ * reported as outcome_unknown and never repeated.
|
|
103
|
+
+ */
|
|
104
|
+
+ async executeAgentToolOperation(operationId, options = {}) {
|
|
105
|
+
+ const stored = this._findAgentToolEntry(AGENT_TOOL_RESULT_ENTRY, operationId);
|
|
106
|
+
+ if (stored !== undefined)
|
|
107
|
+
+ return { operationId, executed: false, state: stored.data.isError ? "failed" : "succeeded", result: stored.data.result };
|
|
108
|
+
+ const operation = this._findAgentToolEntry(AGENT_TOOL_OPERATION_ENTRY, operationId);
|
|
109
|
+
+ if (operation === undefined)
|
|
110
|
+
+ throw new Error("agent_tool_operation_unknown");
|
|
111
|
+
+ this._agentToolRunning ??= new Set();
|
|
112
|
+
+ if (this._agentToolRunning.has(operationId) || this._findAgentToolEntry(AGENT_TOOL_STARTED_ENTRY, operationId) !== undefined) {
|
|
113
|
+
+ return { operationId, executed: false, state: this._agentToolRunning.has(operationId) ? "started" : "outcome_unknown" };
|
|
114
|
+
+ }
|
|
115
|
+
+ const { toolName, input } = operation.data;
|
|
116
|
+
+ const decision = checkExternalToolStart(this.sessionManager, {
|
|
117
|
+
+ path: "operation", toolName, toolCallId: operation.data.toolCallId, operationId, input, ...this._agentToolSource(toolName, input),
|
|
118
|
+
+ });
|
|
119
|
+
+ if (decision !== undefined && decision.action !== "allow") {
|
|
120
|
+
+ return { operationId, executed: false, state: "not_granted", reason: decision.reason ?? decision.action };
|
|
121
|
+
+ }
|
|
122
|
+
+ this._agentToolRunning.add(operationId);
|
|
123
|
+
+ try {
|
|
124
|
+
+ this._emitEntryAppended(this.sessionManager.appendCustomEntry(AGENT_TOOL_STARTED_ENTRY, { operationId }));
|
|
125
|
+
+ let result;
|
|
126
|
+
+ let isError = false;
|
|
127
|
+
+ try {
|
|
128
|
+
+ const output = await this.executeTool(toolName, input, { signal: options.signal, activateInactiveTool: true, agentToolOperationId: operationId });
|
|
129
|
+
+ result = { content: output.content ?? [], ...(output.details === undefined ? {} : { details: output.details }) };
|
|
130
|
+
+ isError = output.isError === true || output.details?.isError === true;
|
|
131
|
+
+ }
|
|
132
|
+
+ catch (error) {
|
|
133
|
+
+ result = { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }] };
|
|
134
|
+
+ isError = true;
|
|
135
|
+
+ }
|
|
136
|
+
+ this._emitEntryAppended(this.sessionManager.appendCustomEntry(AGENT_TOOL_RESULT_ENTRY, { operationId, isError, result }));
|
|
137
|
+
+ settleExternalToolStart(this.sessionManager, { operationId, state: isError ? "failed" : "succeeded" });
|
|
138
|
+
+ return { operationId, executed: true, state: isError ? "failed" : "succeeded", result };
|
|
139
|
+
+ }
|
|
140
|
+
+ finally {
|
|
141
|
+
+ this._agentToolRunning.delete(operationId);
|
|
142
|
+
+ }
|
|
143
|
+
+ }
|
|
144
|
+
+ /**
|
|
145
|
+
+ * Accept one managed continuation for a stored result. The same continuation id returns
|
|
146
|
+
+ * the first acceptance; the caller submits `message` only when `accepted` is true.
|
|
147
|
+
+ */
|
|
148
|
+
+ acceptAgentToolContinuation(operationId, continuationId) {
|
|
149
|
+
+ if (typeof continuationId !== "string" || continuationId.length === 0 || continuationId.length > 128)
|
|
150
|
+
+ throw new Error("agent_tool_continuation_invalid");
|
|
151
|
+
+ const previous = this._findAgentToolEntry(AGENT_TOOL_RESUME_ENTRY, continuationId, "continuationId");
|
|
152
|
+
+ if (previous !== undefined) {
|
|
153
|
+
+ if (previous.data.operationId !== operationId)
|
|
154
|
+
+ throw new Error("agent_tool_continuation_conflict");
|
|
155
|
+
+ return { operationId, continuationId, accepted: false, duplicate: true };
|
|
156
|
+
+ }
|
|
157
|
+
+ if (this._findAgentToolEntry(AGENT_TOOL_RESUME_ENTRY, operationId) !== undefined)
|
|
158
|
+
+ return { operationId, continuationId, accepted: false, duplicate: true };
|
|
159
|
+
+ const stored = this._findAgentToolEntry(AGENT_TOOL_RESULT_ENTRY, operationId);
|
|
160
|
+
+ if (stored === undefined)
|
|
161
|
+
+ throw new Error("agent_tool_result_missing");
|
|
162
|
+
+ const operation = this._findAgentToolEntry(AGENT_TOOL_OPERATION_ENTRY, operationId);
|
|
163
|
+
+ this._emitEntryAppended(this.sessionManager.appendCustomEntry(AGENT_TOOL_RESUME_ENTRY, { operationId, continuationId }));
|
|
164
|
+
+ const text = (stored.data.result.content ?? []).filter((block) => block.type === "text").map((block) => block.text).join("\n");
|
|
165
|
+
+ const message = `[agent_tool_permission] ${JSON.stringify({
|
|
166
|
+
+ origin: "agent_tool_permission", operationId, continuationId, requestId: operation?.data.requestId,
|
|
167
|
+
+ toolName: operation?.data.toolName, state: stored.data.isError ? "failed" : "succeeded", result: text,
|
|
168
|
+
+ })}`;
|
|
169
|
+
+ return { operationId, continuationId, accepted: true, duplicate: false, message };
|
|
170
|
+
+ }
|
|
171
|
+
async _emitAfterToolCallHooks(toolCall, args, result, isError, parentToolCallId) {
|
|
172
|
+
const runner = this._extensionRunner;
|
|
173
|
+
const hookResult = runner.hasHandlers("tool_result")
|
|
174
|
+
@@ -3708,6 +3858,7 @@
|
|
175
|
+
}
|
|
176
|
+
const beforeResult = await this.preflightToolCall(prepared.toolCall, prepared.args, {
|
|
177
|
+
waitForEventQueue: this._toolExecutionDepth === 0,
|
|
178
|
+
+ ...(options?.agentToolOperationId === undefined ? {} : { agentToolOperationId: options.agentToolOperationId, agentToolPath: "operation" }),
|
|
179
|
+
});
|
|
180
|
+
if (beforeResult?.block) {
|
|
181
|
+
throw new ExecuteToolError("blocked", toolName, beforeResult.reason || "Tool execution was blocked", activeTools);
|
|
182
|
+
--- a/@code-yeongyu/senpi/dist/core/extensions/types.d.ts
|
|
183
|
+
+++ b/@code-yeongyu/senpi/dist/core/extensions/types.d.ts
|
|
184
|
+
@@ -2933,5 +2933,41 @@
|
|
185
|
+
event: string;
|
|
186
|
+
error: string;
|
|
187
|
+
stack?: string;
|
|
188
|
+
+}
|
|
189
|
+
+/** One tool start as the registered-agent authority sees it (zigmini 294). */
|
|
190
|
+
+export interface ExternalToolStart {
|
|
191
|
+
+ path: "direct" | "nested" | "operation" | "mcp" | "rpc";
|
|
192
|
+
+ toolName: string;
|
|
193
|
+
+ toolCallId: string;
|
|
194
|
+
+ operationId?: string;
|
|
195
|
+
+ input: unknown;
|
|
196
|
+
+ parentToolCallId?: string;
|
|
197
|
+
+ sourceKind?: string;
|
|
198
|
+
+ ownerPath?: string;
|
|
199
|
+
+ identity?: {
|
|
200
|
+
+ owner: string;
|
|
201
|
+
+ operation: string;
|
|
202
|
+
+ };
|
|
203
|
+
+}
|
|
204
|
+
+export type ExternalToolDecision = {
|
|
205
|
+
+ action: "allow";
|
|
206
|
+
+} | {
|
|
207
|
+
+ action: "deny" | "hold";
|
|
208
|
+
+ reason?: string;
|
|
209
|
+
+};
|
|
210
|
+
+/**
|
|
211
|
+
+ * Registered with `registerExternalPermissionAuthority`. `checkStart` is synchronous so it can
|
|
212
|
+
+ * run in the last fence before dispatch; a thrown error or unknown answer refuses the call.
|
|
213
|
+
+ */
|
|
214
|
+
+export interface ExternalPermissionAuthority {
|
|
215
|
+
+ describe(): unknown;
|
|
216
|
+
+ request(call: ExternalToolStart): {
|
|
217
|
+
+ requestId: string;
|
|
218
|
+
+ };
|
|
219
|
+
+ checkStart(call: ExternalToolStart): ExternalToolDecision;
|
|
220
|
+
+ settle(outcome: {
|
|
221
|
+
+ operationId: string;
|
|
222
|
+
+ state: "succeeded" | "failed";
|
|
223
|
+
+ }): void;
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=types.d.ts.map
|
|
226
|
+
--- a/@code-yeongyu/senpi/dist/core/extensions/builtin/permission-system/dispatch.js
|
|
227
|
+
+++ b/@code-yeongyu/senpi/dist/core/extensions/builtin/permission-system/dispatch.js
|
|
228
|
+
@@ -1,5 +1,109 @@
|
|
229
|
+
import { DeniedError } from "./types.js";
|
|
230
|
+
const authorizers = new WeakMap();
|
|
231
|
+
+// Registered-agent authority (zigmini 294). One registry per process, shared by the
|
|
232
|
+
+// session, the MCP dispatch fence and in-process extensions such as codemode.
|
|
233
|
+
+const EXTERNAL_AUTHORITY_REGISTRY = Symbol.for("senpi.externalPermissionAuthority");
|
|
234
|
+
+const externalAuthorities = (globalThis[EXTERNAL_AUTHORITY_REGISTRY] ??= new WeakMap());
|
|
235
|
+
+const EXTERNAL_AUTHORITY_METHODS = ["describe", "request", "checkStart", "settle"];
|
|
236
|
+
+/**
|
|
237
|
+
+ * Compose an external authority with this session's dispatch authorization. While it is
|
|
238
|
+
+ * registered every tool start asks `checkStart` first; native presets cannot skip it.
|
|
239
|
+
+ * Retirement keeps a refusing registration, so a lost authority never reads as "none".
|
|
240
|
+
+ */
|
|
241
|
+
+export function registerExternalPermissionAuthority(session, authority) {
|
|
242
|
+
+ for (const method of EXTERNAL_AUTHORITY_METHODS) {
|
|
243
|
+
+ if (typeof authority?.[method] !== "function")
|
|
244
|
+
+ throw new TypeError(`external_authority_${method}_missing`);
|
|
245
|
+
+ }
|
|
246
|
+
+ const registration = { authority, retired: false };
|
|
247
|
+
+ externalAuthorities.set(session, registration);
|
|
248
|
+
+ return () => {
|
|
249
|
+
+ registration.retired = true;
|
|
250
|
+
+ };
|
|
251
|
+
+}
|
|
252
|
+
+export function hasExternalPermissionAuthority(session) {
|
|
253
|
+
+ return externalAuthorities.has(session);
|
|
254
|
+
+}
|
|
255
|
+
+/** Synchronous so it can run inside the last fence before dispatch. Any fault refuses. */
|
|
256
|
+
+export function checkExternalToolStart(session, call) {
|
|
257
|
+
+ const registration = externalAuthorities.get(session);
|
|
258
|
+
+ if (registration === undefined)
|
|
259
|
+
+ return undefined;
|
|
260
|
+
+ if (registration.retired)
|
|
261
|
+
+ return { action: "deny", reason: "agent_authority_retired" };
|
|
262
|
+
+ let decision;
|
|
263
|
+
+ try {
|
|
264
|
+
+ decision = registration.authority.checkStart(call);
|
|
265
|
+
+ }
|
|
266
|
+
+ catch {
|
|
267
|
+
+ return { action: "deny", reason: "agent_authority_failed" };
|
|
268
|
+
+ }
|
|
269
|
+
+ if (decision?.action === "allow" || decision?.action === "deny" || decision?.action === "hold")
|
|
270
|
+
+ return decision;
|
|
271
|
+
+ return { action: "deny", reason: "agent_authority_invalid_decision" };
|
|
272
|
+
+}
|
|
273
|
+
+/** Ask the authority to record a held call. The request id names the pending card. */
|
|
274
|
+
+export function requestExternalToolStart(session, call) {
|
|
275
|
+
+ const registration = externalAuthorities.get(session);
|
|
276
|
+
+ if (registration === undefined || registration.retired)
|
|
277
|
+
+ throw new Error("agent_authority_unavailable");
|
|
278
|
+
+ const requested = registration.authority.request(call);
|
|
279
|
+
+ if (typeof requested?.requestId !== "string" || requested.requestId.length === 0)
|
|
280
|
+
+ throw new Error("agent_authority_request_invalid");
|
|
281
|
+
+ return requested;
|
|
282
|
+
+}
|
|
283
|
+
+export function settleExternalToolStart(session, outcome) {
|
|
284
|
+
+ const registration = externalAuthorities.get(session);
|
|
285
|
+
+ if (registration === undefined || registration.retired)
|
|
286
|
+
+ return;
|
|
287
|
+
+ try {
|
|
288
|
+
+ registration.authority.settle(outcome);
|
|
289
|
+
+ }
|
|
290
|
+
+ catch (error) {
|
|
291
|
+
+ console.error(`agent authority settle failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
292
|
+
+ }
|
|
293
|
+
+}
|
|
294
|
+
+function policyGrantMatches(grant, call) {
|
|
295
|
+
+ return (grant.toolName === call.toolName &&
|
|
296
|
+
+ (grant.owner === undefined || grant.owner === call.identity?.owner) &&
|
|
297
|
+
+ (grant.operation === undefined || grant.operation === call.identity?.operation));
|
|
298
|
+
+}
|
|
299
|
+
+/**
|
|
300
|
+
+ * The authority a host pushes over RPC: an acknowledged policy revision with exact grants.
|
|
301
|
+
+ * A call without a grant is held for consent (or refused when `missing` is "deny").
|
|
302
|
+
+ */
|
|
303
|
+
+export function createPolicyPermissionAuthority(policy) {
|
|
304
|
+
+ if (!Number.isSafeInteger(policy?.revision) || policy.revision < 1)
|
|
305
|
+
+ throw new TypeError("agent_policy_revision_invalid");
|
|
306
|
+
+ if (!Array.isArray(policy.grants) ||
|
|
307
|
+
+ !policy.grants.every((grant) => typeof grant?.toolName === "string" &&
|
|
308
|
+
+ grant.toolName.length > 0 &&
|
|
309
|
+
+ (grant.owner === undefined || typeof grant.owner === "string") &&
|
|
310
|
+
+ (grant.operation === undefined || typeof grant.operation === "string"))) {
|
|
311
|
+
+ throw new TypeError("agent_policy_grants_invalid");
|
|
312
|
+
+ }
|
|
313
|
+
+ if (policy.missing !== undefined && policy.missing !== "hold" && policy.missing !== "deny")
|
|
314
|
+
+ throw new TypeError("agent_policy_missing_invalid");
|
|
315
|
+
+ const grants = policy.grants.map((grant) => ({ ...grant }));
|
|
316
|
+
+ const missing = policy.missing ?? "hold";
|
|
317
|
+
+ return {
|
|
318
|
+
+ describe: () => ({ revision: policy.revision, grants: grants.length, missing }),
|
|
319
|
+
+ request: (call) => ({ requestId: `agent-tool-request:${call.operationId ?? call.toolCallId}` }),
|
|
320
|
+
+ checkStart: (call) => grants.some((grant) => policyGrantMatches(grant, call))
|
|
321
|
+
+ ? { action: "allow" }
|
|
322
|
+
+ : { action: missing, reason: "no_grant" },
|
|
323
|
+
+ settle: () => undefined,
|
|
324
|
+
+ };
|
|
325
|
+
+}
|
|
326
|
+
+function externalDispatchCall(request) {
|
|
327
|
+
+ return {
|
|
328
|
+
+ path: "mcp",
|
|
329
|
+
+ toolName: request.toolName,
|
|
330
|
+
+ toolCallId: request.toolCallId,
|
|
331
|
+
+ input: request.input,
|
|
332
|
+
+ ...(request.identity === undefined ? {} : { identity: { owner: request.identity.owner, operation: request.identity.operation } }),
|
|
333
|
+
+ };
|
|
334
|
+
+}
|
|
335
|
+
// AgentSession passes this validated object unchanged from preflight to execution.
|
|
336
|
+
// Identical calls, including calls with duplicate provider IDs, get distinct objects.
|
|
337
|
+
const approvals = new WeakMap();
|
|
338
|
+
@@ -76,6 +180,9 @@
|
|
339
|
+
*/
|
|
340
|
+
export async function authorizeToolDispatch(session, request, ctx, signal) {
|
|
341
|
+
signal?.throwIfAborted();
|
|
342
|
+
+ const external = checkExternalToolStart(session, externalDispatchCall(request));
|
|
343
|
+
+ if (external !== undefined && external.action !== "allow")
|
|
344
|
+
+ throw new Error(`agent_tool_denied: ${external.reason ?? external.action}`);
|
|
345
|
+
const registration = authorizers.get(session);
|
|
346
|
+
if (!registration)
|
|
347
|
+
throw new Error("Permission authorizer is unavailable");
|
|
348
|
+
@@ -97,6 +204,9 @@
|
|
349
|
+
return false;
|
|
350
|
+
if (JSON.stringify(request.input) !== approvedInput)
|
|
351
|
+
return false;
|
|
352
|
+
+ const latest = checkExternalToolStart(session, externalDispatchCall(request));
|
|
353
|
+
+ if (latest !== undefined && latest.action !== "allow")
|
|
354
|
+
+ return false;
|
|
355
|
+
const current = registration.authorizer.policy(request, ctx);
|
|
356
|
+
if (current.action === "deny")
|
|
357
|
+
return false;
|
|
358
|
+
--- a/@code-yeongyu/senpi/dist/modes/rpc/connection-handler.js
|
|
359
|
+
+++ b/@code-yeongyu/senpi/dist/modes/rpc/connection-handler.js
|
|
360
|
+
@@ -913,6 +913,7 @@
|
|
361
|
+
USER_ACTIVITY_CAPABILITY,
|
|
362
|
+
RESUME_SESSION_CAPABILITY,
|
|
363
|
+
ENTRIES_TAIL_CAPABILITY,
|
|
364
|
+
+ "agent_tool_authority",
|
|
365
|
+
...(options.retryFallbackCommand ? [RETRY_FALLBACK_COMMAND_CAPABILITY] : []),
|
|
366
|
+
...(options.toolRuntime ? toolRuntimeCapabilities(options.toolRuntime) : []),
|
|
367
|
+
// Client flags cannot advertise a host guard this classic binding does not run, nor a tool runtime.
|
|
368
|
+
@@ -1342,7 +1343,50 @@
|
|
369
|
+
case "set_label":
|
|
370
|
+
session.sessionManager.appendLabelChange(command.entryId, command.label);
|
|
371
|
+
return success(id, "set_label");
|
|
372
|
+
+ // Registered-agent tool authority (zigmini 294). Host-only commands on the
|
|
373
|
+
+ // authenticated RPC channel; the model cannot name an operation or change its input.
|
|
374
|
+
+ case "zgw.agent_tool_policy": {
|
|
375
|
+
+ try {
|
|
376
|
+
+ return success(id, command.type, session.applyAgentToolPolicy(command.policy));
|
|
377
|
+
+ }
|
|
378
|
+
+ catch (err) {
|
|
379
|
+
+ return error(id, command.type, err instanceof Error ? err.message : String(err));
|
|
380
|
+
+ }
|
|
381
|
+
+ }
|
|
382
|
+
+ case "zgw.agent_tool_execute": {
|
|
383
|
+
+ if (typeof command.operationId !== "string" || command.operationId.length === 0)
|
|
384
|
+
+ return error(id, command.type, "agent_tool_operation_invalid");
|
|
385
|
+
+ try {
|
|
386
|
+
+ return success(id, command.type, await session.executeAgentToolOperation(command.operationId));
|
|
387
|
+
+ }
|
|
388
|
+
+ catch (err) {
|
|
389
|
+
+ return error(id, command.type, err instanceof Error ? err.message : String(err));
|
|
390
|
+
+ }
|
|
391
|
+
+ }
|
|
392
|
+
+ case "zgw.agent_tool_resume": {
|
|
393
|
+
+ let accepted;
|
|
394
|
+
+ try {
|
|
395
|
+
+ accepted = session.acceptAgentToolContinuation(command.operationId, command.continuationId);
|
|
396
|
+
+ }
|
|
397
|
+
+ catch (err) {
|
|
398
|
+
+ return error(id, command.type, err instanceof Error ? err.message : String(err));
|
|
399
|
+
+ }
|
|
400
|
+
+ if (!accepted.accepted)
|
|
401
|
+
+ return success(id, command.type, accepted);
|
|
402
|
+
+ turnRequested = true;
|
|
403
|
+
+ const admission = handleClientInput(session, { id, type: "prompt", message: accepted.message,
|
|
404
|
+
+ clientInputId: accepted.continuationId, streamingBehavior: "followUp" }, { output, promptCalls });
|
|
405
|
+
+ promptCalls.add(admission);
|
|
406
|
+
+ void admission.finally(() => promptCalls.delete(admission));
|
|
407
|
+
+ return undefined;
|
|
408
|
+
+ }
|
|
409
|
+
case "bash": {
|
|
410
|
+
+ // A registered agent's raw shell must pass the same authority as its tool calls.
|
|
411
|
+
+ if (session.hasExternalPermissionAuthority()) {
|
|
412
|
+
+ const denied = session._checkAgentToolStart({ id: command.executionId ?? `rpc-bash-${id ?? "anonymous"}`, name: "bash" }, { command: command.command }, { agentToolPath: "rpc", agentToolOperationId: `rpc-bash:${id ?? "anonymous"}` });
|
|
413
|
+
+ if (denied !== undefined)
|
|
414
|
+
+ return error(id, "bash", denied.reason);
|
|
415
|
+
+ }
|
|
416
|
+
if (routingSessionId !== undefined)
|
|
417
|
+
outputEvent({ type: "bash_start" });
|
|
418
|
+
try {
|
|
419
|
+
--- a/@code-yeongyu/senpi/dist/core/cursor-exec-bridge.js
|
|
420
|
+
+++ b/@code-yeongyu/senpi/dist/core/cursor-exec-bridge.js
|
|
421
|
+
@@ -92,7 +92,11 @@
|
|
422
|
+
if (!isRecord(params)) {
|
|
423
|
+
throw new Error(`Tool "${toolName}" prepared non-object arguments`);
|
|
424
|
+
}
|
|
425
|
+
- const preflight = await options.preflightToolCall?.({
|
|
426
|
+
+ // Without a preflight hook nothing could refuse the call (the agent authority included): fail closed.
|
|
427
|
+
+ if (options.preflightToolCall === undefined) {
|
|
428
|
+
+ throw new Error("Tool permission preflight is unavailable");
|
|
429
|
+
+ }
|
|
430
|
+
+ const preflight = await options.preflightToolCall({
|
|
431
|
+
type: "tool_call",
|
|
432
|
+
toolCallId,
|
|
433
|
+
toolName,
|
|
434
|
+
--- a/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts
|
|
435
|
+
+++ b/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts
|
|
436
|
+
@@ -38,6 +38,26 @@
|
|
437
|
+
ToolDefinition<TUnsafe<Request | Partial<EvalToolInput>>, EvalToolDetails>["execute"]
|
|
438
|
+
>;
|
|
439
|
+
|
|
440
|
+
+const EXTERNAL_AUTHORITY_REGISTRY = Symbol.for("senpi.externalPermissionAuthority");
|
|
441
|
+
+
|
|
442
|
+
+/** True when a registered-agent authority governs the calling session (zigmini 294). */
|
|
443
|
+
+export function agentAuthorityGoverns(ctx: unknown): boolean {
|
|
444
|
+
+ const registry = (globalThis as Record<symbol, unknown>)[EXTERNAL_AUTHORITY_REGISTRY];
|
|
445
|
+
+ const session = typeof ctx === "object" && ctx !== null && "sessionManager" in ctx ? ctx.sessionManager : undefined;
|
|
446
|
+
+ return registry instanceof WeakMap && typeof session === "object" && session !== null && registry.has(session);
|
|
447
|
+
+}
|
|
448
|
+
+
|
|
449
|
+
+/**
|
|
450
|
+
+ * A governed session runs code only as JavaScript in the QuickJS isolate. The server sets
|
|
451
|
+
+ * `isolate`; the model cannot turn it off or switch to another language or a host kernel.
|
|
452
|
+
+ */
|
|
453
|
+
+export function enforceAgentIsolation<Request extends EvalToolRequest>(request: Request, ctx: unknown): Request {
|
|
454
|
+
+ if (!agentAuthorityGoverns(ctx) || isEvalControlRequest(request)) return request;
|
|
455
|
+
+ if (!("language" in request) || request.language !== "js")
|
|
456
|
+
+ throw new EvalIsolateInvalidError("agent_eval_language_unavailable: registered agents run JavaScript in the QuickJS isolate only");
|
|
457
|
+
+ return { ...request, isolate: true } as Request;
|
|
458
|
+
+}
|
|
459
|
+
+
|
|
460
|
+
export function createEvalTool(options: CreateEvalToolOptions) {
|
|
461
|
+
const foregroundWindowSeconds = options.foregroundWindowSeconds ?? DEFAULT_FOREGROUND_WINDOW_SECONDS;
|
|
462
|
+
const maxDetachedCells =
|
|
463
|
+
@@ -83,7 +103,7 @@
|
|
464
|
+
async function execute(
|
|
465
|
+
...[toolCallId, params, signal, onUpdate, ctx]: EvalExecuteArgs<EvalToolRequest>
|
|
466
|
+
): Promise<AgentToolResult<EvalResultDetails>> {
|
|
467
|
+
- const request = parseEvalRequest(params, languages, { sandbox });
|
|
468
|
+
+ const request = enforceAgentIsolation(parseEvalRequest(params, languages, { sandbox }), ctx);
|
|
469
|
+
if (isEvalControlRequest(request)) return await executeEvalControl(cellManager, request);
|
|
470
|
+
if (options.proxyExecutor) {
|
|
471
|
+
// A proxy runs cells elsewhere and knows nothing of sandbox cells: an isolated cell must never run unisolated.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"revision":
|
|
3
|
+
"revision": 6,
|
|
4
4
|
"upstream": {
|
|
5
5
|
"omo": "5.1.51",
|
|
6
6
|
"senpi": "2026.10.27-1"
|
|
7
7
|
},
|
|
8
|
-
"candidate": "<zigmini home>/omo/5.1.51-zgw.
|
|
8
|
+
"candidate": "<zigmini home>/omo/5.1.51-zgw.6",
|
|
9
9
|
"pristine": "<zigmini home>/omo/5.1.51",
|
|
10
10
|
"entrypoint": "node_modules/@code-yeongyu/senpi/dist/cli.js",
|
|
11
11
|
"patchRoot": "node_modules",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"omo-5.1.51-compaction-recovery.patch",
|
|
18
18
|
"omo-5.1.51-provider-failover.patch",
|
|
19
19
|
"omo-5.1.51-compaction-long-context.patch",
|
|
20
|
-
"omo-5.1.51-chatgpt-terra.patch"
|
|
20
|
+
"omo-5.1.51-chatgpt-terra.patch",
|
|
21
|
+
"omo-5.1.51-memory-receipts.patch",
|
|
22
|
+
"omo-5.1.51-agent-tool-authority.patch"
|
|
21
23
|
],
|
|
22
24
|
"files": [
|
|
23
25
|
{
|
|
@@ -28,7 +30,7 @@
|
|
|
28
30
|
{
|
|
29
31
|
"path": "node_modules/@code-yeongyu/senpi/dist/core/agent-session.js",
|
|
30
32
|
"originalSha256": "6bc07b317862db56e6277767320673ac87cdc637751f365c00ad861df39f22e0",
|
|
31
|
-
"patchedSha256": "
|
|
33
|
+
"patchedSha256": "b4b48626e4feb21bb8e28cd6410363d9c16eeb45cb6d0fcbb14a18493c2efb6c"
|
|
32
34
|
},
|
|
33
35
|
{
|
|
34
36
|
"path": "node_modules/@code-yeongyu/senpi/dist/core/auth-storage.js",
|
|
@@ -258,7 +260,7 @@
|
|
|
258
260
|
{
|
|
259
261
|
"path": "node_modules/@code-yeongyu/senpi/dist/core/extensions/types.d.ts",
|
|
260
262
|
"originalSha256": "ae1efdb5f5f68c3aa0d147d8f2828552ebcb6ec95b54817cb90393b927abcc20",
|
|
261
|
-
"patchedSha256": "
|
|
263
|
+
"patchedSha256": "1939cd9035b886859fe748ec7e08052f9bca7b98f6471e10d8b75bc88bf1ee9b"
|
|
262
264
|
},
|
|
263
265
|
{
|
|
264
266
|
"path": "node_modules/@code-yeongyu/senpi/dist/core/model-runtime.js",
|
|
@@ -273,7 +275,7 @@
|
|
|
273
275
|
{
|
|
274
276
|
"path": "node_modules/@code-yeongyu/senpi/dist/modes/rpc/connection-handler.js",
|
|
275
277
|
"originalSha256": "df28c8c8aca7c01633510e2a892a1cca6cfef785f15e44c026a997788543e570",
|
|
276
|
-
"patchedSha256": "
|
|
278
|
+
"patchedSha256": "bcd721298ed68439885fdfaef87026694feb836f0c72ec4296796816b55e390f"
|
|
277
279
|
},
|
|
278
280
|
{
|
|
279
281
|
"path": "node_modules/@code-yeongyu/senpi/dist/modes/rpc/connection-question-bridge.js",
|
|
@@ -374,6 +376,26 @@
|
|
|
374
376
|
"path": "node_modules/@code-yeongyu/senpi/dist/bundle/chunks/session-worker.js",
|
|
375
377
|
"originalSha256": "8cd4a903ea9243667f63b131b9c3cb87ca3d9e1b46f8e8d54cfa2a11add853b2",
|
|
376
378
|
"patchedSha256": "cf6a2a7e06aef03bf8fdc3583578e66c0e0f35951bf6a373107f9e375e00bbd5"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"path": "node_modules/@code-yeongyu/senpi/dist/core/extensions/builtin/permission-system/dispatch.js",
|
|
382
|
+
"originalSha256": "0a94637e71e60260cf8de7a9b5c39300a5d91f9cd8adffdd379a5337c45cd903",
|
|
383
|
+
"patchedSha256": "0966ee6a7e3ddaab8242fce7cba75e7a83af64e97a3e08bcd5ab1b8ea4248365"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"path": "node_modules/@code-yeongyu/senpi/dist/core/cursor-exec-bridge.js",
|
|
387
|
+
"originalSha256": "e6c4fedef2bdd5f69b3373947204266f8b1fc9bcd31f18ab10c3f512f559cf29",
|
|
388
|
+
"patchedSha256": "1cffccc2e71ea684aa1b611b9a8c11eadde48890ffe0b76ff4e733a8c4b7ddc0"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"path": "node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts",
|
|
392
|
+
"originalSha256": "107e41edbfd1d0403a62d8265a18c62042c0f6b48e0a5a2f65d171b9fcdc914b",
|
|
393
|
+
"patchedSha256": "5ee8e1aca3f0ca73067c0da7387051c95211e784288a25c153b9c9112640f49f"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"path": "node_modules/omo-ai/plugin/extensions/omo.js",
|
|
397
|
+
"originalSha256": "443394ed1461a1502d91124667dc6fc94d82c458867b07e5549f8080e061080e",
|
|
398
|
+
"patchedSha256": "e4823cb98e4c7e17ce1cee865ace6fad97613f349e644344b10669ac7bbe9add"
|
|
377
399
|
}
|
|
378
400
|
]
|
|
379
401
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
--- a/omo-ai/plugin/extensions/omo.js
|
|
2
|
+
+++ b/omo-ai/plugin/extensions/omo.js
|
|
3
|
+
@@ replace @@
|
|
4
|
+
-async function L1(e,t){let n=(await e.lsTree(t)).filter(z1);if(0===n.length)return 0;let r=(await Promise.all(n.map(n=>e.show(t,n)))).reduce((e,t)=>e+Buffer.byteLength(t,"utf8"),0);return Math.floor(r/4)}
|
|
5
|
+
+async function L1(e,t){let n=(await e.lsTree(t)).filter(z1);if(0===n.length)return 0;let r=(await Promise.all(n.map(async n=>{let r=await e.show(t,n);return"system/agreements.md"===n?r.split(/\r?\n/).filter(e=>void 0===$F(e.trim())).join("\n"):r}))).reduce((e,t)=>e+Buffer.byteLength(t,"utf8"),0);return Math.floor(r/4)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zigmini",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"zigmini": "bin/zigmini"
|
|
@@ -57,9 +57,11 @@
|
|
|
57
57
|
"typecheck": "tsc --noEmit",
|
|
58
58
|
"test": "bun test test/unit",
|
|
59
59
|
"test:e2e": "bun test test/e2e",
|
|
60
|
-
"test:contract": "bun test
|
|
61
|
-
"test:all": "tsc --noEmit && bun test
|
|
60
|
+
"test:contract": "bun scripts/test-split.ts contract",
|
|
61
|
+
"test:all": "tsc --noEmit && bun scripts/test-split.ts unit && bun scripts/test-split.ts contract",
|
|
62
62
|
"test:mutation": "bun scripts/mutation-run.ts",
|
|
63
|
+
"test:documents:native": "bun scripts/build-document-reader.ts --native-test",
|
|
64
|
+
"build:document-reader": "bun scripts/build-document-reader.ts",
|
|
63
65
|
"heavy": "bun host/heavy-slot.ts run",
|
|
64
66
|
"formal:check": "bun scripts/formal-check.ts"
|
|
65
67
|
},
|