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.
Files changed (138) hide show
  1. package/README.ko.md +27 -2
  2. package/README.md +27 -2
  3. package/assets/agent/gateway-request-rules.md +1 -1
  4. package/assets/agent/gateway-rules.md +6 -1
  5. package/assets/android/zigmini.apk +0 -0
  6. package/assets/android/zigmini.apk.json +3 -3
  7. package/assets/build.json +1 -1
  8. package/assets/document-reader/document-reader +0 -0
  9. package/assets/document-reader/host-selector +0 -0
  10. package/assets/document-reader/manifest.json +27 -0
  11. package/docs/manual.ko.md +114 -10
  12. package/docs/manual.md +117 -11
  13. package/host/document-reader/DocumentRead.swift +370 -0
  14. package/host/document-reader/HostSelector.swift +192 -0
  15. package/host/document-reader/Protocol.swift +647 -0
  16. package/host/document-reader/main.swift +22 -0
  17. package/host/omo-bridge/agent-aside-tool.ts +119 -0
  18. package/host/omo-bridge/agent-aside.ts +522 -0
  19. package/host/omo-bridge/agent-collaboration-files.ts +282 -0
  20. package/host/omo-bridge/agent-collaboration.ts +385 -0
  21. package/host/omo-bridge/agent-control.ts +400 -28
  22. package/host/omo-bridge/agent-execution.sb +42 -0
  23. package/host/omo-bridge/agent-execution.ts +158 -0
  24. package/host/omo-bridge/agent-tool-adapters.ts +388 -0
  25. package/host/omo-bridge/agent-tool-permissions.ts +96 -0
  26. package/host/omo-bridge/aside-tabs.ts +41 -0
  27. package/host/omo-bridge/attachment-read.ts +100 -0
  28. package/host/omo-bridge/bridge.ts +10 -0
  29. package/host/omo-bridge/managed-call.ts +46 -0
  30. package/host/omo-bridge/task-control.ts +39 -5
  31. package/host/omo-check/patches/attachments-293/README.md +138 -0
  32. package/host/omo-check/patches/attachments-293/document-content.js +234 -0
  33. package/host/omo-check/patches/attachments-293/document-content.types.txt +91 -0
  34. package/host/omo-check/patches/attachments-293/omo-5.1.51-documents.patch +831 -0
  35. package/host/omo-check/patches/attachments-293/omo-5.1.51-gateway-port.manifest.json +471 -0
  36. package/host/omo-check/patches/omo-5.1.51-agent-tool-authority.patch +471 -0
  37. package/host/omo-check/patches/omo-5.1.51-gateway-port.manifest.json +28 -6
  38. package/host/omo-check/patches/omo-5.1.51-memory-receipts.patch +5 -0
  39. package/package.json +5 -3
  40. package/src/agent/api.ts +345 -20
  41. package/src/agent/artifacts.ts +196 -0
  42. package/src/agent/aside-target-routes.ts +369 -0
  43. package/src/agent/aside-targets.ts +215 -0
  44. package/src/agent/collaboration-admission.ts +47 -0
  45. package/src/agent/collaboration-read.ts +117 -0
  46. package/src/agent/collaboration-session.ts +196 -0
  47. package/src/agent/collaboration-types.ts +258 -0
  48. package/src/agent/collaboration.ts +399 -0
  49. package/src/agent/definition.ts +65 -3
  50. package/src/agent/fields.ts +9 -3
  51. package/src/agent/file-core.ts +325 -0
  52. package/src/agent/files.ts +87 -8
  53. package/src/agent/list.ts +3 -3
  54. package/src/agent/managed-call.ts +144 -0
  55. package/src/agent/tool-catalog.ts +184 -0
  56. package/src/agent/tool-delivery.ts +359 -0
  57. package/src/agent/tool-permission-types.ts +81 -0
  58. package/src/agent/tool-permissions.ts +1366 -0
  59. package/src/attachments/api.ts +161 -0
  60. package/src/attachments/document-reader.ts +325 -0
  61. package/src/attachments/host-selector.ts +410 -0
  62. package/src/attachments/managed-binding.ts +83 -0
  63. package/src/attachments/prepare.ts +214 -0
  64. package/src/attachments/selector-port.ts +28 -0
  65. package/src/attachments/service.ts +729 -0
  66. package/src/attachments/store.ts +698 -0
  67. package/src/attachments/types.ts +123 -0
  68. package/src/cli/doctor.ts +30 -10
  69. package/src/decisions.ts +109 -10
  70. package/src/engine/apply-patch.ts +21 -0
  71. package/src/engine/compat.json +2 -1
  72. package/src/engine/install.ts +45 -4
  73. package/src/engine/sandbox-cell.ts +2 -0
  74. package/src/gc.ts +33 -225
  75. package/src/housekeeping/api.ts +163 -0
  76. package/src/housekeeping/audit.ts +61 -0
  77. package/src/housekeeping/collectors/agent-collaboration.ts +33 -0
  78. package/src/housekeeping/collectors/agent-drafts.ts +43 -0
  79. package/src/housekeeping/collectors/agent-file-trash.ts +36 -0
  80. package/src/housekeeping/collectors/agent-trash.ts +28 -0
  81. package/src/housekeeping/collectors/attachment-cleanup.ts +35 -0
  82. package/src/housekeeping/collectors/db-backup.ts +25 -0
  83. package/src/housekeeping/collectors/docker-build-cache.ts +29 -0
  84. package/src/housekeeping/collectors/docker-image.ts +135 -0
  85. package/src/housekeeping/collectors/omo-version.ts +32 -0
  86. package/src/housekeeping/collectors/orphan-test-process.ts +205 -0
  87. package/src/housekeeping/collectors/reconcile-work.ts +55 -0
  88. package/src/housekeeping/collectors/rpc-daemon.ts +39 -0
  89. package/src/housekeeping/collectors/shared.ts +149 -0
  90. package/src/housekeeping/collectors/temp-dir.ts +28 -0
  91. package/src/housekeeping/collectors/update-file.ts +25 -0
  92. package/src/housekeeping/collectors/worktree.ts +193 -0
  93. package/src/housekeeping/engine.ts +125 -0
  94. package/src/housekeeping/reconcile/work.ts +130 -0
  95. package/src/housekeeping/registry.ts +63 -0
  96. package/src/housekeeping/trash.ts +59 -0
  97. package/src/housekeeping/types.ts +31 -0
  98. package/src/hub.ts +1095 -41
  99. package/src/main.ts +228 -30
  100. package/src/message-references.ts +14 -5
  101. package/src/profile-prompt.ts +13 -1
  102. package/src/protocol.ts +41 -6
  103. package/src/security-allow.ts +79 -2
  104. package/src/security-check.ts +1 -1
  105. package/src/store.ts +1946 -23
  106. package/src/test-crash.ts +20 -0
  107. package/src/work-watch.ts +55 -7
  108. package/src/work.ts +192 -3
  109. package/web/DESIGN.md +33 -0
  110. package/web/agents.d.ts +189 -12
  111. package/web/agents.js +898 -39
  112. package/web/app.js +2634 -210
  113. package/web/attachments.d.ts +91 -0
  114. package/web/attachments.js +422 -0
  115. package/web/collaboration.d.ts +87 -0
  116. package/web/collaboration.js +290 -0
  117. package/web/decisions.d.ts +39 -2
  118. package/web/decisions.js +354 -2
  119. package/web/gc.d.ts +26 -5
  120. package/web/gc.js +113 -13
  121. package/web/i18n/agents.d.ts +4 -0
  122. package/web/i18n/agents.js +200 -8
  123. package/web/i18n/attachments.js +78 -0
  124. package/web/i18n/decisions.d.ts +4 -0
  125. package/web/i18n/decisions.js +68 -0
  126. package/web/i18n/gc.d.ts +4 -0
  127. package/web/i18n/gc.js +184 -2
  128. package/web/i18n/main.js +80 -8
  129. package/web/i18n/tour.d.ts +4 -0
  130. package/web/i18n/tour.js +37 -0
  131. package/web/index.html +20 -3
  132. package/web/profile.d.ts +2 -2
  133. package/web/profile.js +11 -6
  134. package/web/style.css +342 -21
  135. package/web/tooltip.d.ts +2 -0
  136. package/web/tooltip.js +12 -0
  137. package/web/tour.d.ts +57 -0
  138. package/web/tour.js +450 -0
@@ -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
- export interface SecurityHoldRecord {
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 {
@@ -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";