@opengeni/agent-proto 0.2.0 → 0.3.0

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/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Cloudgeni-ai
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/dist/index.d.ts CHANGED
@@ -22,7 +22,15 @@ declare enum ErrorCode {
22
22
  /** ERROR_CODE_AGENT_OFFLINE - The control plane synthesized this because no agent responded (offline). */
23
23
  ERROR_CODE_AGENT_OFFLINE = 9,
24
24
  /** ERROR_CODE_FENCED - An epoch fence rejected a stale op; caller should re-resolve and retry. */
25
- ERROR_CODE_FENCED = 10
25
+ ERROR_CODE_FENCED = 10,
26
+ /**
27
+ * ERROR_CODE_PAYLOAD_TOO_LARGE - The op's reply would exceed the transport's negotiated max payload and could
28
+ * not be published (e.g. a full-res screenshot, or an unbounded file read/exec
29
+ * output). The agent's wire-seam backstop synthesizes THIS instead of letting
30
+ * the oversized publish fail silently and the caller time out opaquely.
31
+ * Not retryable — the same op would produce the same oversized reply.
32
+ */
33
+ ERROR_CODE_PAYLOAD_TOO_LARGE = 11
26
34
  }
27
35
  declare function errorCodeFromJSON(object: any): ErrorCode;
28
36
  declare function errorCodeToJSON(object: ErrorCode): string;
@@ -103,6 +111,45 @@ declare enum GoingOfflineReason {
103
111
  }
104
112
  declare function goingOfflineReasonFromJSON(object: any): GoingOfflineReason;
105
113
  declare function goingOfflineReasonToJSON(object: GoingOfflineReason): string;
114
+ /** The logical byte stream an op-frame Data chunk belongs to. */
115
+ declare enum OpChannel {
116
+ OP_CHANNEL_UNSPECIFIED = 0,
117
+ OP_CHANNEL_STDOUT = 1,
118
+ OP_CHANNEL_STDERR = 2,
119
+ /** OP_CHANNEL_CONTENT - Non-exec content (fs_read bodies and similar). */
120
+ OP_CHANNEL_CONTENT = 3
121
+ }
122
+ declare function opChannelFromJSON(object: any): OpChannel;
123
+ declare function opChannelToJSON(object: OpChannel): string;
124
+ /**
125
+ * An op's lifecycle state on the runner: accepted → running → complete(retained)
126
+ * → gc; or lost. `lost` is always TYPED (see OpLostReason) — never a silent gap.
127
+ */
128
+ declare enum OpState {
129
+ OP_STATE_UNSPECIFIED = 0,
130
+ OP_STATE_ACCEPTED = 1,
131
+ OP_STATE_RUNNING = 2,
132
+ OP_STATE_COMPLETE = 3,
133
+ OP_STATE_LOST = 4
134
+ }
135
+ declare function opStateFromJSON(object: any): OpState;
136
+ declare function opStateToJSON(object: OpState): string;
137
+ /** Why a lost op is lost (present iff OpStatus.state == OP_STATE_LOST). */
138
+ declare enum OpLostReason {
139
+ OP_LOST_REASON_UNSPECIFIED = 0,
140
+ /**
141
+ * OP_LOST_REASON_EVICTED - A completed op's retained result was evicted (bounded LRU registry) before a
142
+ * final ack arrived — a loud, counted event, surfaced honestly on a late query.
143
+ */
144
+ OP_LOST_REASON_EVICTED = 1,
145
+ /**
146
+ * OP_LOST_REASON_AGENT_RESTARTED - The runner process restarted and the op's in-memory scope did not survive
147
+ * (until the journal + scope re-adoption of a later milestone).
148
+ */
149
+ OP_LOST_REASON_AGENT_RESTARTED = 2
150
+ }
151
+ declare function opLostReasonFromJSON(object: any): OpLostReason;
152
+ declare function opLostReasonToJSON(object: OpLostReason): string;
106
153
  declare enum StreamRole {
107
154
  STREAM_ROLE_UNSPECIFIED = 0,
108
155
  /** STREAM_ROLE_AGENT - The agent producing pty/desktop bytes. */
@@ -221,6 +268,24 @@ interface Capabilities {
221
268
  consentedScreenControl: boolean;
222
269
  /** Display detail (absent => headless / no display). */
223
270
  display: Display | undefined;
271
+ /**
272
+ * When a display physically EXISTS but the OS withholds the screen-CAPTURE grant
273
+ * (macOS Screen Recording / TCC), `desktop` is reported false and this carries a
274
+ * human, actionable reason (e.g. "grant Screen Recording in System Settings").
275
+ * Empty when capture is permitted or the platform has no separate capture grant
276
+ * (Linux/x11). Advertised at Hello so the control plane degrades the desktop cell
277
+ * with a legible hint instead of offering a desktop it cannot capture — the
278
+ * machine that "claims a display it can't capture" bug the 0.1.3 incident exposed.
279
+ */
280
+ desktopUnavailableReason: string;
281
+ /**
282
+ * The runner speaks the op-stream protocol (OpStart/OpFrame/OpAck; see the
283
+ * op-stream section below). Advertised at Hello; the server uses the streaming
284
+ * path only when this is true AND its own feature flag is on, else the legacy
285
+ * monolithic ops run exactly as today. Additive — absent (false) on an older
286
+ * runner means "legacy path", no version coupling.
287
+ */
288
+ opStream: boolean;
224
289
  }
225
290
  declare const Capabilities: MessageFns<Capabilities>;
226
291
  /** Detail about the agent's graphical display, when one is present. */
@@ -593,8 +658,24 @@ interface DesktopScreenshotRequest {
593
658
  declare const DesktopScreenshotRequest: MessageFns<DesktopScreenshotRequest>;
594
659
  interface DesktopScreenshotResponse {
595
660
  png: Uint8Array;
661
+ /**
662
+ * The geometry of the ENCODED image (what a viewer/model actually sees). When
663
+ * the raw capture is too large to fit the control-plane transport's max payload,
664
+ * the agent DOWNSCALES the PNG so the reply publishes (a full-res Retina/busy
665
+ * screen can exceed NATS's 1 MiB default); width/height then describe the
666
+ * downscaled image, and `native_width`/`native_height` below carry the original.
667
+ */
596
668
  width: number;
597
669
  height: number;
670
+ /**
671
+ * The ORIGINAL (pre-downscale) capture geometry. Equal to width/height when no
672
+ * downscale was needed. The computer-use coordinate mapping scales a model click
673
+ * (expressed in the ENCODED pixel space it saw) back up to this native pixel
674
+ * space before injecting, so clicks land correctly even on a downscaled frame.
675
+ * 0 (unset by an older agent) MUST be read as "same as width/height" (no scale).
676
+ */
677
+ nativeWidth: number;
678
+ nativeHeight: number;
598
679
  }
599
680
  declare const DesktopScreenshotResponse: MessageFns<DesktopScreenshotResponse>;
600
681
  /**
@@ -617,8 +698,57 @@ interface Heartbeat {
617
698
  * sandboxes for new work).
618
699
  */
619
700
  draining: boolean;
701
+ /**
702
+ * The runner's measured host capacity — the upward report the server paces
703
+ * against (LIMITS-DOCTRINE: the runner holds no concurrency policy; the
704
+ * swarm/scheduler reads this and decides how much to throw at the machine).
705
+ */
706
+ capacity: HostCapacitySample | undefined;
707
+ /**
708
+ * Point-in-time op-admission counts (queues only ever fill once a derived
709
+ * pathology breaker saturates — nonzero queued figures are telemetry-worthy).
710
+ */
711
+ admission: AdmissionTelemetry | undefined;
620
712
  }
621
713
  declare const Heartbeat: MessageFns<Heartbeat>;
714
+ /**
715
+ * A point-in-time host-capacity sample: the impure sampler's reading of
716
+ * MemAvailable, spool-filesystem free space, fd/pid headroom, and CPUs. Every
717
+ * runner-side budget/breaker is a fraction of these (rule R), so this is also
718
+ * how the server understands what the machine can take.
719
+ */
720
+ interface HostCapacitySample {
721
+ memAvailableBytes: string;
722
+ diskFreeBytes: string;
723
+ fdHeadroom: string;
724
+ pidHeadroom: string;
725
+ nproc: string;
726
+ }
727
+ declare const HostCapacitySample: MessageFns<HostCapacitySample>;
728
+ /** Point-in-time op-admission counts, per class. */
729
+ interface AdmissionTelemetry {
730
+ lightRunning: string;
731
+ lightQueued: string;
732
+ heavyRunning: string;
733
+ heavyQueued: string;
734
+ /**
735
+ * Jobs with a live mailbox (running + completed-retained awaiting final
736
+ * ack) — the op-engine's routing-table size.
737
+ */
738
+ liveOps: string;
739
+ /**
740
+ * Op frames dropped by the fire-and-forget publish path (bulk lane down or
741
+ * its channel full). Protocol-healed by replay; recorded so an undersized
742
+ * lane is visible before it matters (monotonic).
743
+ */
744
+ opFramesDroppedTotal: string;
745
+ /**
746
+ * Completed ops evicted before their final ack (dropped results) — the
747
+ * registry's loud counter (monotonic).
748
+ */
749
+ evictedUnackedTotal: string;
750
+ }
751
+ declare const AdmissionTelemetry: MessageFns<AdmissionTelemetry>;
622
752
  interface HeartbeatAck {
623
753
  /** The control plane may instruct the agent to adjust its heartbeat cadence. */
624
754
  nextIntervalMs: number;
@@ -764,6 +894,243 @@ interface UpdateMayProceedResponse {
764
894
  activeSessions: number;
765
895
  }
766
896
  declare const UpdateMayProceedResponse: MessageFns<UpdateMayProceedResponse>;
897
+ /**
898
+ * The terminal outcome of an op — carried in the Exit frame body AND echoed in
899
+ * OpStatus once complete. Digests/totals are keyed by channel name
900
+ * ("stdout"/"stderr"/"content") for a byte-exact assembly proof.
901
+ */
902
+ interface OpExit {
903
+ exitCode: number;
904
+ /** Hit the runner-enforced deadline (process-tree killed). */
905
+ timedOut: boolean;
906
+ /** Cancelled via OpCancel. */
907
+ cancelled: boolean;
908
+ durationMs: string;
909
+ /** channel name → blake3 hex digest of the full channel stream. */
910
+ digests: {
911
+ [key: string]: string;
912
+ };
913
+ /** channel name → total bytes emitted on the channel. */
914
+ totals: {
915
+ [key: string]: string;
916
+ };
917
+ /**
918
+ * Set iff the RUNNER failed the op with a typed reason ("OP_OVERFLOW" /
919
+ * "OP_SPOOL_IO" / "OP_PIPE_IO"); empty for every child-decided outcome
920
+ * (exit/timeout/cancel). Never an exit-code sentinel — ambiguous renderings
921
+ * are outlawed (FAILURE-VISIBILITY.md).
922
+ */
923
+ failureCode: string;
924
+ /**
925
+ * Structured detail for failure_code (exact counters: retained bytes, the
926
+ * IO error text, captured byte totals) — the out-of-band plane's food.
927
+ */
928
+ failureDetail: {
929
+ [key: string]: string;
930
+ };
931
+ }
932
+ declare const OpExit: MessageFns<OpExit>;
933
+ interface OpExit_DigestsEntry {
934
+ key: string;
935
+ value: string;
936
+ }
937
+ declare const OpExit_DigestsEntry: MessageFns<OpExit_DigestsEntry>;
938
+ interface OpExit_TotalsEntry {
939
+ key: string;
940
+ value: string;
941
+ }
942
+ declare const OpExit_TotalsEntry: MessageFns<OpExit_TotalsEntry>;
943
+ interface OpExit_FailureDetailEntry {
944
+ key: string;
945
+ value: string;
946
+ }
947
+ declare const OpExit_FailureDetailEntry: MessageFns<OpExit_FailureDetailEntry>;
948
+ /**
949
+ * The op-begin for a STREAMING fs_write (M7): the target is set up here; the bytes
950
+ * arrive as chunked, idempotent WriteChunk request/replies (no reverse streaming).
951
+ */
952
+ interface FsWriteBegin {
953
+ path: string;
954
+ /** Create parent directories as needed. */
955
+ createParents: boolean;
956
+ /** POSIX mode for a newly created file (0 => platform default). */
957
+ mode: number;
958
+ /**
959
+ * Editor safety (M6): the expected blake3 hex digest of the file's CURRENT
960
+ * content for a read-modify-write; empty for a plain write. On a re-dispatch a
961
+ * mismatch REFUSES rather than double-applying a diff.
962
+ */
963
+ expectedBaseDigest: string;
964
+ }
965
+ declare const FsWriteBegin: MessageFns<FsWriteBegin>;
966
+ /**
967
+ * Start an op (server→runner). IDEMPOTENT by op_id (= ControlRequest.request_id):
968
+ * a known op_id returns its current status and NEVER re-runs — this closes the
969
+ * at-least-once re-run hazard (a re-dispatched turn re-issues OpStart{same id} and
970
+ * attaches).
971
+ */
972
+ interface OpStart {
973
+ op: {
974
+ $case: "exec";
975
+ exec: ExecRequest;
976
+ } | {
977
+ $case: "fsRead";
978
+ fsRead: FsReadRequest;
979
+ } | {
980
+ $case: "fsWrite";
981
+ fsWrite: FsWriteBegin;
982
+ } | undefined;
983
+ /** Initial send credit in bytes (0 => the runner default, ~4 MiB). */
984
+ windowBytes: string;
985
+ /**
986
+ * Absolute runner-enforced deadline, unix-epoch ms (0 = none). Runner-side
987
+ * enforcement is authoritative (process-tree kill + Exit{timed_out}); the
988
+ * server wall-clock is advisory.
989
+ */
990
+ deadlineMs: string;
991
+ /** The originating session id, for per-origin fair admission. */
992
+ originId: string;
993
+ }
994
+ declare const OpStart: MessageFns<OpStart>;
995
+ interface OpStarted {
996
+ accepted: boolean;
997
+ status: OpStatus | undefined;
998
+ }
999
+ declare const OpStarted: MessageFns<OpStarted>;
1000
+ /**
1001
+ * Cancel an op (server→runner). Idempotent; triggers the #344 process-tree kill and
1002
+ * a terminal frame. Reply is OpStatus.
1003
+ */
1004
+ interface OpCancel {
1005
+ opId: string;
1006
+ }
1007
+ declare const OpCancel: MessageFns<OpCancel>;
1008
+ /** Query an op's status (server→runner). Reply is OpStatus. */
1009
+ interface OpQuery {
1010
+ opId: string;
1011
+ }
1012
+ declare const OpQuery: MessageFns<OpQuery>;
1013
+ /**
1014
+ * Re-attach to an op after a reconnect or a missed frame (server→runner): the
1015
+ * runner re-publishes frames ≥ from_seq from its ring/spool, then resumes live
1016
+ * flow. Reply is OpStatus.
1017
+ */
1018
+ interface OpAttach {
1019
+ opId: string;
1020
+ /** Resume from this exclusive sequence (the consumer's cumulative-ack floor). */
1021
+ fromSeq: string;
1022
+ /**
1023
+ * Attach generation (B2): monotonic (the consumer's Temporal attempt number).
1024
+ * The runner serves replay/credit only for the HIGHEST generation seen; a
1025
+ * lower-generation (zombie) consumer's acks are ignored.
1026
+ */
1027
+ attachGeneration: string;
1028
+ /**
1029
+ * The fresh send-credit window for the resumed attachment, in bytes
1030
+ * (0 => reuse the window granted at OpStart). OpAck's absolute credit_bytes
1031
+ * resizes it thereafter.
1032
+ */
1033
+ windowBytes: string;
1034
+ }
1035
+ declare const OpAttach: MessageFns<OpAttach>;
1036
+ /**
1037
+ * The current status of an op (server←runner reply to OpCancel/OpQuery/OpAttach,
1038
+ * and embedded in OpStarted).
1039
+ */
1040
+ interface OpStatus {
1041
+ opId: string;
1042
+ state: OpState;
1043
+ /**
1044
+ * The next sequence number the runner will assign (the high watermark, for gap
1045
+ * detection).
1046
+ */
1047
+ nextSeq: string;
1048
+ /** Present iff state == OP_STATE_COMPLETE. */
1049
+ exit: OpExit | undefined;
1050
+ /** Present iff state == OP_STATE_LOST. */
1051
+ lostReason: OpLostReason;
1052
+ }
1053
+ declare const OpStatus: MessageFns<OpStatus>;
1054
+ /**
1055
+ * One chunk of a streaming upload (server→runner): plain idempotent request/reply
1056
+ * per chunk (≤512 KiB). A duplicate (op_id, seq) is acked WITHOUT re-applying.
1057
+ */
1058
+ interface WriteChunk {
1059
+ opId: string;
1060
+ /** The op-scoped monotonic chunk sequence. */
1061
+ seq: string;
1062
+ bytes: Uint8Array;
1063
+ /** The final chunk: commit = digest-verify then atomic rename (M7). */
1064
+ last: boolean;
1065
+ /**
1066
+ * Byte offset this chunk writes at (M7: writes land in an op-scoped temp file,
1067
+ * committed on the last chunk — an aborted transfer leaves no visible file).
1068
+ */
1069
+ offset: string;
1070
+ }
1071
+ declare const WriteChunk: MessageFns<WriteChunk>;
1072
+ interface WriteChunkAck {
1073
+ seq: string;
1074
+ }
1075
+ declare const WriteChunkAck: MessageFns<WriteChunkAck>;
1076
+ /**
1077
+ * A runner→server op frame, published fire-and-forget on the op subject
1078
+ * (`agent.<ws>.<id>.op.<op_id>`). `seq` is a SINGLE monotonic sequence per op
1079
+ * across ALL body kinds (Progress frames consume sequence numbers too, so gap
1080
+ * detection is uniform).
1081
+ */
1082
+ interface OpFrame {
1083
+ opId: string;
1084
+ seq: string;
1085
+ body: {
1086
+ $case: "data";
1087
+ data: OpData;
1088
+ } | {
1089
+ $case: "progress";
1090
+ progress: OpProgress;
1091
+ } | {
1092
+ $case: "exit";
1093
+ exit: OpExit;
1094
+ } | undefined;
1095
+ }
1096
+ declare const OpFrame: MessageFns<OpFrame>;
1097
+ /** A chunk of op output on a channel (≤128 KiB per frame). */
1098
+ interface OpData {
1099
+ channel: OpChannel;
1100
+ bytes: Uint8Array;
1101
+ }
1102
+ declare const OpData: MessageFns<OpData>;
1103
+ /**
1104
+ * A liveness tick: the op is alive but produced no Data. Emitted every 5s while an
1105
+ * op is live and quiet; consumes a sequence number like any frame.
1106
+ */
1107
+ interface OpProgress {
1108
+ }
1109
+ declare const OpProgress: MessageFns<OpProgress>;
1110
+ /**
1111
+ * A server→runner cumulative ack + credit replenishment, published fire-and-forget
1112
+ * on the ack subject (`agent.<ws>.<id>.ack`). Best-effort, healed by repetition.
1113
+ */
1114
+ interface OpAck {
1115
+ opId: string;
1116
+ /** Cumulative: every frame with seq ≤ acked_seq is acknowledged. */
1117
+ ackedSeq: string;
1118
+ /** The replenished ABSOLUTE send-credit window in bytes. */
1119
+ creditBytes: string;
1120
+ /** The server has fully consumed the terminal frame → the runner may GC the op. */
1121
+ final: boolean;
1122
+ /**
1123
+ * The consumer's attach generation (matches OpAttach.attach_generation; the
1124
+ * consumer's Temporal attempt number). The runner honors this ack — its floor
1125
+ * advance AND its credit grant — ONLY for the HIGHEST generation it has seen for
1126
+ * the op; a lower-generation (zombie) ack is ignored. This must ride the wire
1127
+ * (not be inferred from monotonic acked_seq alone) because credit_bytes is an
1128
+ * ABSOLUTE window REPLACEMENT: a stale consumer's ack could otherwise shrink the
1129
+ * live consumer's window (stall) or grant unintended credit (B2).
1130
+ */
1131
+ attachGeneration: string;
1132
+ }
1133
+ declare const OpAck: MessageFns<OpAck>;
767
1134
  /**
768
1135
  * Wraps an op-specific request. `request_id` correlates a response to a request
769
1136
  * even over fan-out; `epoch` carries the lease/active epoch the control plane
@@ -835,6 +1202,26 @@ interface ControlRequest {
835
1202
  } | {
836
1203
  $case: "desktopScreenshot";
837
1204
  desktopScreenshot: DesktopScreenshotRequest;
1205
+ }
1206
+ /**
1207
+ * Op-stream (v1.1), additive. All ride the same rpc subject; each has an
1208
+ * idempotent, typed reply in ControlResponse.result below.
1209
+ */
1210
+ | {
1211
+ $case: "opStart";
1212
+ opStart: OpStart;
1213
+ } | {
1214
+ $case: "opCancel";
1215
+ opCancel: OpCancel;
1216
+ } | {
1217
+ $case: "opQuery";
1218
+ opQuery: OpQuery;
1219
+ } | {
1220
+ $case: "opAttach";
1221
+ opAttach: OpAttach;
1222
+ } | {
1223
+ $case: "writeChunk";
1224
+ writeChunk: WriteChunk;
838
1225
  } | undefined;
839
1226
  }
840
1227
  declare const ControlRequest: MessageFns<ControlRequest>;
@@ -906,6 +1293,20 @@ interface ControlResponse {
906
1293
  } | {
907
1294
  $case: "desktopScreenshot";
908
1295
  desktopScreenshot: DesktopScreenshotResponse;
1296
+ }
1297
+ /**
1298
+ * Op-stream (v1.1) replies, additive. OpStart → OpStarted; OpCancel / OpQuery /
1299
+ * OpAttach all reply OpStatus (op_status); WriteChunk → WriteChunkAck.
1300
+ */
1301
+ | {
1302
+ $case: "opStart";
1303
+ opStart: OpStarted;
1304
+ } | {
1305
+ $case: "opStatus";
1306
+ opStatus: OpStatus;
1307
+ } | {
1308
+ $case: "writeChunk";
1309
+ writeChunk: WriteChunkAck;
909
1310
  } | undefined;
910
1311
  }
911
1312
  declare const ControlResponse: MessageFns<ControlResponse>;
@@ -1077,4 +1478,4 @@ interface MessageFns<T> {
1077
1478
  fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
1078
1479
  }
1079
1480
 
1080
- export { AgentError, AgentError_DetailEntry, AgentEvent, AgentEventAck, Arch, Capabilities, ControlRequest, ControlResponse, type DeepPartial, DesktopEnsureRequest, DesktopEnsureResponse, DesktopInput, DesktopInputRequest, DesktopInputResponse, DesktopScreenshotRequest, DesktopScreenshotResponse, DeviceAuthPollRequest, DeviceAuthPollResponse, DeviceAuthStartRequest, DeviceAuthStartResponse, DeviceAuthState, Display, EnrollmentCredentials, ErrorCode, type Exact, ExecRequest, ExecRequest_EnvEntry, ExecResponse, FsEntry, FsEntryKind, FsListRequest, FsListResponse, FsMkdirRequest, FsMkdirResponse, FsMoveRequest, FsMoveResponse, FsReadRequest, FsReadResponse, FsRemoveRequest, FsRemoveResponse, FsStatRequest, FsStatResponse, FsWriteRequest, FsWriteResponse, GitFileStatus, GitOp, GitRequest, GitResponse, GitStatus, GoingOffline, GoingOfflineReason, GpuSample, Heartbeat, HeartbeatAck, Hello, HelloAck, KeyAction, KeyEvent, type MessageFns, MetricsRequest, MetricsSample, Os, PingRequest, PingResponse, PointerAction, PointerButton, PointerEvent, PtyCloseRequest, PtyCloseResponse, PtyOpenRequest, PtyOpenRequest_EnvEntry, PtyOpenResponse, PtyResizeRequest, PtyResizeResponse, PtyWriteRequest, PtyWriteResponse, ResumeRequest, ResumeResponse, ScrollEvent, StreamChannel, StreamClose, StreamCloseReason, StreamFrame, StreamKind, StreamOpen, StreamOpenAck, StreamRole, UpdateArtifact, UpdateCheckRequest, UpdateCheckResponse, UpdateManifest, UpdateMayProceedRequest, UpdateMayProceedResponse, archFromJSON, archToJSON, deviceAuthStateFromJSON, deviceAuthStateToJSON, errorCodeFromJSON, errorCodeToJSON, fsEntryKindFromJSON, fsEntryKindToJSON, gitOpFromJSON, gitOpToJSON, goingOfflineReasonFromJSON, goingOfflineReasonToJSON, keyActionFromJSON, keyActionToJSON, osFromJSON, osToJSON, pointerActionFromJSON, pointerActionToJSON, pointerButtonFromJSON, pointerButtonToJSON, protobufPackage, streamCloseReasonFromJSON, streamCloseReasonToJSON, streamKindFromJSON, streamKindToJSON, streamRoleFromJSON, streamRoleToJSON };
1481
+ export { AdmissionTelemetry, AgentError, AgentError_DetailEntry, AgentEvent, AgentEventAck, Arch, Capabilities, ControlRequest, ControlResponse, type DeepPartial, DesktopEnsureRequest, DesktopEnsureResponse, DesktopInput, DesktopInputRequest, DesktopInputResponse, DesktopScreenshotRequest, DesktopScreenshotResponse, DeviceAuthPollRequest, DeviceAuthPollResponse, DeviceAuthStartRequest, DeviceAuthStartResponse, DeviceAuthState, Display, EnrollmentCredentials, ErrorCode, type Exact, ExecRequest, ExecRequest_EnvEntry, ExecResponse, FsEntry, FsEntryKind, FsListRequest, FsListResponse, FsMkdirRequest, FsMkdirResponse, FsMoveRequest, FsMoveResponse, FsReadRequest, FsReadResponse, FsRemoveRequest, FsRemoveResponse, FsStatRequest, FsStatResponse, FsWriteBegin, FsWriteRequest, FsWriteResponse, GitFileStatus, GitOp, GitRequest, GitResponse, GitStatus, GoingOffline, GoingOfflineReason, GpuSample, Heartbeat, HeartbeatAck, Hello, HelloAck, HostCapacitySample, KeyAction, KeyEvent, type MessageFns, MetricsRequest, MetricsSample, OpAck, OpAttach, OpCancel, OpChannel, OpData, OpExit, OpExit_DigestsEntry, OpExit_FailureDetailEntry, OpExit_TotalsEntry, OpFrame, OpLostReason, OpProgress, OpQuery, OpStart, OpStarted, OpState, OpStatus, Os, PingRequest, PingResponse, PointerAction, PointerButton, PointerEvent, PtyCloseRequest, PtyCloseResponse, PtyOpenRequest, PtyOpenRequest_EnvEntry, PtyOpenResponse, PtyResizeRequest, PtyResizeResponse, PtyWriteRequest, PtyWriteResponse, ResumeRequest, ResumeResponse, ScrollEvent, StreamChannel, StreamClose, StreamCloseReason, StreamFrame, StreamKind, StreamOpen, StreamOpenAck, StreamRole, UpdateArtifact, UpdateCheckRequest, UpdateCheckResponse, UpdateManifest, UpdateMayProceedRequest, UpdateMayProceedResponse, WriteChunk, WriteChunkAck, archFromJSON, archToJSON, deviceAuthStateFromJSON, deviceAuthStateToJSON, errorCodeFromJSON, errorCodeToJSON, fsEntryKindFromJSON, fsEntryKindToJSON, gitOpFromJSON, gitOpToJSON, goingOfflineReasonFromJSON, goingOfflineReasonToJSON, keyActionFromJSON, keyActionToJSON, opChannelFromJSON, opChannelToJSON, opLostReasonFromJSON, opLostReasonToJSON, opStateFromJSON, opStateToJSON, osFromJSON, osToJSON, pointerActionFromJSON, pointerActionToJSON, pointerButtonFromJSON, pointerButtonToJSON, protobufPackage, streamCloseReasonFromJSON, streamCloseReasonToJSON, streamKindFromJSON, streamKindToJSON, streamRoleFromJSON, streamRoleToJSON };