zigmini 1.0.0-beta.2 → 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 +36 -3
- package/README.md +36 -3
- 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 +120 -11
- package/docs/manual.md +123 -12
- 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-chatgpt-terra.patch +21 -0
- package/host/omo-check/patches/omo-5.1.51-gateway-port.manifest.json +44 -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 +230 -31
- package/src/message-references.ts +14 -5
- package/src/profile-prompt.ts +13 -1
- package/src/profile.ts +13 -5
- 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/usage.ts +18 -7
- package/src/work-watch.ts +55 -7
- package/src/work.ts +192 -3
- package/web/DESIGN.md +35 -1
- 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 +16 -10
- 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
package/src/protocol.ts
CHANGED
|
@@ -11,8 +11,8 @@ export const ROTATION_HELD_MESSAGE: Text = {
|
|
|
11
11
|
ko: "진행 중이거나 확인되지 않은 작업이 있어 같은 세션을 유지합니다.",
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export type Channel = "web" | "app" | "home" | "hud" | "discord";
|
|
15
|
-
export type Trust = "owner" | "owner-voice" | "unknown";
|
|
14
|
+
export type Channel = "web" | "app" | "home" | "hud" | "discord" | "gateway";
|
|
15
|
+
export type Trust = "owner" | "owner-voice" | "unknown" | "delegated";
|
|
16
16
|
|
|
17
17
|
export interface Source {
|
|
18
18
|
channel: Channel;
|
|
@@ -20,11 +20,15 @@ export interface Source {
|
|
|
20
20
|
device?: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
import type { AttachmentMetadata } from "./attachments/types.ts";
|
|
24
|
+
|
|
23
25
|
export interface MessageReference {
|
|
24
26
|
readonly seq: number;
|
|
25
27
|
readonly role: "user" | "assistant";
|
|
26
28
|
readonly text: string;
|
|
27
29
|
readonly images?: readonly string[];
|
|
30
|
+
/** Immutable metadata copied from the referenced message; a new Send still gets its own grant. */
|
|
31
|
+
readonly attachments?: readonly AttachmentMetadata[];
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
/** Measured across one native response turn, including its model calls around tools. */
|
|
@@ -92,9 +96,31 @@ export type DecisionAnswerRequest = { readonly expectedRevision: number; readonl
|
|
|
92
96
|
| { readonly mode: "request_permission" | "recheck"; readonly response?: never; readonly answers?: never; readonly value?: never; readonly confirmed?: never }
|
|
93
97
|
);
|
|
94
98
|
|
|
99
|
+
/**
|
|
100
|
+
* The owner's view of a held collaboration artifact read (payload purpose collaboration_artifact_review): what is needed
|
|
101
|
+
* to allow or deny it through POST /api/agent-collaboration/holds/:holdId, never the content or a flagged value.
|
|
102
|
+
*/
|
|
103
|
+
export interface ArtifactReviewInfo {
|
|
104
|
+
readonly holdId: string;
|
|
105
|
+
readonly revision: number;
|
|
106
|
+
readonly state: import("./security-allow.ts").ArtifactSecurityHold["state"];
|
|
107
|
+
readonly resumeState: import("./security-allow.ts").ArtifactSecurityHold["continuation"]["state"];
|
|
108
|
+
/** The agent whose read is held; null when the main conversation reads. */
|
|
109
|
+
readonly agentId: string | null;
|
|
110
|
+
readonly requestId: string;
|
|
111
|
+
readonly artifactId: string;
|
|
112
|
+
readonly fileName: string;
|
|
113
|
+
readonly view: "raw" | "text" | "pages";
|
|
114
|
+
/** Pages: first and last page number; text and raw: scalar/byte offsets. */
|
|
115
|
+
readonly range: { readonly start: number; readonly end: number };
|
|
116
|
+
/** null for a hold written before summaries were recorded. */
|
|
117
|
+
readonly summary: import("./security-allow.ts").ArtifactReviewSummary | null;
|
|
118
|
+
}
|
|
119
|
+
|
|
95
120
|
/** HTTP/event DTOs are separate from storage records; payload retains the existing action-card structure. */
|
|
96
121
|
export interface DecisionInfo {
|
|
97
122
|
readonly security?: import("./security-allow.ts").HeldState;
|
|
123
|
+
readonly artifactReview?: ArtifactReviewInfo;
|
|
98
124
|
readonly id: string;
|
|
99
125
|
readonly revision: number;
|
|
100
126
|
readonly ownerConv: string;
|
|
@@ -116,7 +142,7 @@ export interface DecisionInfo {
|
|
|
116
142
|
readonly submissionMode: "answer" | "resume" | null;
|
|
117
143
|
readonly answer: unknown;
|
|
118
144
|
readonly commandId: string | null;
|
|
119
|
-
readonly answerRoute: "live_response" | "follow_up_command" | null;
|
|
145
|
+
readonly answerRoute: "live_response" | "follow_up_command" | "collaboration_stage" | null;
|
|
120
146
|
readonly supersededBy: string | null;
|
|
121
147
|
readonly reason: string | null;
|
|
122
148
|
readonly createdAt: string;
|
|
@@ -157,14 +183,23 @@ export interface ReplyNotification {
|
|
|
157
183
|
}
|
|
158
184
|
|
|
159
185
|
export type ClientMessage =
|
|
160
|
-
| { type: "hello"; data: { client: string; version: string } }
|
|
186
|
+
| { type: "hello"; data: { client: string; version: string; capabilities?: { hostFileAttachments?: unknown } } }
|
|
161
187
|
| { type: "client.presence"; data: { visible: boolean } }
|
|
162
188
|
| { type: "history.get"; conv: string; before?: number; after?: number; limit?: number }
|
|
163
189
|
| { type: "conversation.create"; data: { title: string } }
|
|
164
|
-
| { type: "input.text"; conv: string; data: { text: string; images?: string[]; references?: number[]; submissionId?: string } }
|
|
190
|
+
| { type: "input.text"; conv: string; data: { text: string; images?: string[]; references?: number[]; submissionId?: string; attachments?: string[] } }
|
|
165
191
|
| { type: "input.action"; conv: string; data: ActionAnswerData }
|
|
166
192
|
| { type: "input.interrupt"; conv: string; data: Record<string, never> }
|
|
167
|
-
|
|
193
|
+
// open: open the agent conversation's next session right after the rotation; any other present value is refused.
|
|
194
|
+
| { type: "conversation.rotate"; conv: string; open?: true }
|
|
168
195
|
| { type: "reminder.ack"; data: { id: string } }
|
|
169
196
|
| { type: "question.notification.ack"; data: { id: string } }
|
|
170
197
|
| { type: "reply.notification.ack"; data: { id: string } };
|
|
198
|
+
|
|
199
|
+
/** 294 C3: compatibility marker a new client sends with tool permission requests. It is not a credential. */
|
|
200
|
+
export const AGENT_TOOL_FEATURE = "agent-tool-permissions-v1";
|
|
201
|
+
|
|
202
|
+
/** 294 C3: the only answer body a tool purpose decision accepts (besides { cancelled: true }). */
|
|
203
|
+
export interface AgentToolGrantResponse {
|
|
204
|
+
readonly toolGrant: { readonly choice: "allow" | "deny"; readonly proposalDigest: string };
|
|
205
|
+
}
|
package/src/security-allow.ts
CHANGED
|
@@ -37,14 +37,88 @@ export interface SecurityIntent {
|
|
|
37
37
|
}
|
|
38
38
|
export type SecurityReceipt =
|
|
39
39
|
| { readonly kind: "message"; readonly conv: string; readonly messageSeq: number }
|
|
40
|
-
| { readonly kind: "answer"; readonly decisionId: string; readonly submissionId: string }
|
|
41
|
-
|
|
40
|
+
| { readonly kind: "answer"; readonly decisionId: string; readonly submissionId: string }
|
|
41
|
+
| ArtifactReviewReceipt | ArtifactReleaseReceipt;
|
|
42
|
+
export interface MessageSecurityHoldRecord {
|
|
42
43
|
readonly state: HeldState;
|
|
43
44
|
readonly key: string | null;
|
|
44
45
|
readonly intent: SecurityIntent | null;
|
|
45
46
|
readonly dispatchReserved: boolean;
|
|
46
47
|
readonly receipt: SecurityReceipt | null;
|
|
47
48
|
}
|
|
49
|
+
export type SecurityHoldRecord = MessageSecurityHoldRecord | ArtifactSecurityHold;
|
|
50
|
+
export interface ArtifactReadBinding {
|
|
51
|
+
readonly inputId: string;
|
|
52
|
+
readonly activationId: string | null;
|
|
53
|
+
readonly managedBindingDigest: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ArtifactReviewReceipt {
|
|
56
|
+
readonly kind: "collaboration_artifact_review";
|
|
57
|
+
readonly holdId: string;
|
|
58
|
+
readonly decisionId: string;
|
|
59
|
+
readonly revision: number;
|
|
60
|
+
readonly submissionId: string;
|
|
61
|
+
readonly scopeDigest: string;
|
|
62
|
+
readonly reviewState: "allowed" | "denied" | "cancelled";
|
|
63
|
+
readonly resource: { readonly requestId: string; readonly artifactId: string; readonly resultId: string };
|
|
64
|
+
readonly effect: "review_recorded";
|
|
65
|
+
readonly contentReleased: false;
|
|
66
|
+
}
|
|
67
|
+
export interface ArtifactReleaseReceipt {
|
|
68
|
+
readonly kind: "collaboration_artifact";
|
|
69
|
+
readonly readOperationId: string;
|
|
70
|
+
readonly holdId: string;
|
|
71
|
+
readonly requestId: string;
|
|
72
|
+
readonly artifactId: string;
|
|
73
|
+
readonly grantRevision: number;
|
|
74
|
+
readonly representationSha256: string;
|
|
75
|
+
readonly scopeDigest: string;
|
|
76
|
+
readonly continuationId: string | null;
|
|
77
|
+
readonly boundScopeDigest: string | null;
|
|
78
|
+
readonly releaseState: "claimed" | "released" | "unknown";
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* What the owner is told about a held read: the finding kinds with their counts (never a flagged value) and the pages
|
|
82
|
+
* the native reader rendered without any text layer, which no check could cover (held fail-closed).
|
|
83
|
+
*/
|
|
84
|
+
export interface ArtifactReviewSummary {
|
|
85
|
+
readonly findings: readonly { readonly kind: string; readonly count: number }[];
|
|
86
|
+
readonly unscannedPages: readonly number[];
|
|
87
|
+
}
|
|
88
|
+
export interface ArtifactSecurityHold {
|
|
89
|
+
readonly id: string;
|
|
90
|
+
readonly decisionId: string;
|
|
91
|
+
readonly revision: number;
|
|
92
|
+
readonly source: "collaboration_artifact";
|
|
93
|
+
readonly purpose: "collaboration_artifact_review";
|
|
94
|
+
readonly state: "pending" | "allowed" | "denied" | "cancelled" | "invalidated";
|
|
95
|
+
/** Absent on a hold written before summaries were recorded. */
|
|
96
|
+
readonly summary?: ArtifactReviewSummary;
|
|
97
|
+
readonly resourceRef: { readonly kind: "collaboration_artifact"; readonly requestId: string; readonly artifactId: string; readonly resultId: string; readonly originalSha256: string };
|
|
98
|
+
readonly representation: {
|
|
99
|
+
readonly sha256: string; readonly revision: number; readonly view: "raw" | "text" | "pages";
|
|
100
|
+
readonly range: { readonly start: number; readonly end: number }; readonly coverageDigest: string; readonly scanRevision: string;
|
|
101
|
+
};
|
|
102
|
+
readonly readScope: ArtifactReadBinding & {
|
|
103
|
+
readonly artifactGrantId: string; readonly grantRevision: number; readonly granteeConv: string;
|
|
104
|
+
readonly lifecycleEpoch: number; readonly recipientAuthorityEpoch?: number;
|
|
105
|
+
};
|
|
106
|
+
readonly scopeDigest: string;
|
|
107
|
+
readonly readOperationId: string;
|
|
108
|
+
readonly ownerPrincipalRef: string;
|
|
109
|
+
readonly answerSubmissionId: string | null;
|
|
110
|
+
readonly reviewReceipt: { readonly decisionRevision: number; readonly choice: "allow" | "deny" | "cancel" } | null;
|
|
111
|
+
readonly readArguments: { readonly requestId: string; readonly artifactId: string; readonly view?: "text" | "pages"; readonly cursor?: string; readonly limit?: number };
|
|
112
|
+
readonly continuation: {
|
|
113
|
+
readonly id: string; readonly originInputSeq: number; readonly originOwnerInputRevision: number;
|
|
114
|
+
readonly settledReceipt: (ArtifactReadBinding & { readonly settlementId: string }) | null;
|
|
115
|
+
readonly state: "unrequested" | "queued" | "dispatched" | "released" | "cancelled" | "invalidated" | "unknown";
|
|
116
|
+
readonly resumeSubmissionId: string | null; readonly reviewedScopeDigest: string | null;
|
|
117
|
+
readonly targetBinding: ArtifactReadBinding | null; readonly boundScopeDigest: string | null;
|
|
118
|
+
readonly dispatchReceiptId: string | null; readonly releaseReceiptId: string | null;
|
|
119
|
+
};
|
|
120
|
+
readonly invalidationReason: string | null;
|
|
121
|
+
}
|
|
48
122
|
export class SecurityRuntimeError extends Error {
|
|
49
123
|
constructor(
|
|
50
124
|
readonly code: "held_conflict" | "allowlist_conflict" | SecurityErrorCode,
|
|
@@ -55,6 +129,9 @@ export class SecurityRuntimeError extends Error {
|
|
|
55
129
|
export const securityDecision = (decision: { readonly payload: unknown }): boolean =>
|
|
56
130
|
typeof decision.payload === "object" && decision.payload !== null &&
|
|
57
131
|
"kind" in decision.payload && decision.payload.kind === "security-check";
|
|
132
|
+
/** The security decision of a held collaboration artifact read; every other security decision is a message or answer hold. */
|
|
133
|
+
export const artifactReviewDecision = (decision: { readonly payload: unknown }): boolean =>
|
|
134
|
+
securityDecision(decision) && (decision.payload as { readonly purpose?: unknown }).purpose === "collaboration_artifact_review";
|
|
58
135
|
|
|
59
136
|
/** A delimiter is meaningful only if its matching quote can be proved. No decoding or normalization. */
|
|
60
137
|
function quotedEnd(text: string, start: number, quote: string): number | null {
|
package/src/security-check.ts
CHANGED
|
@@ -3,7 +3,7 @@ import ruleConfig from "../scripts/secret-scan.rules.json";
|
|
|
3
3
|
import allowConfig from "../scripts/secret-scan.allow.json";
|
|
4
4
|
import { readVoiceSetting, writeVoiceSetting } from "./voice-setting.ts";
|
|
5
5
|
import { isDeepStrictEqual } from "node:util";
|
|
6
|
-
import { canonicalSecurityValue, SecurityRuntimeError, type HeldState, type SecurityApprover, type SecurityHoldRecord, type SecurityIntent, type SecurityReceipt } from "./security-allow.ts";
|
|
6
|
+
import { canonicalSecurityValue, SecurityRuntimeError, type HeldState, type SecurityApprover, type MessageSecurityHoldRecord as SecurityHoldRecord, type SecurityIntent, type SecurityReceipt } from "./security-allow.ts";
|
|
7
7
|
import { SecurityBaselineError, type Store } from "./store.ts";
|
|
8
8
|
import type { SecurityBaseline } from "./security-baseline.ts";
|
|
9
9
|
import { say, type Text } from "./server-text.ts";
|