@agentconnect.md/cli 1.18.0-rc.12 → 1.18.0-rc.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9058,7 +9058,7 @@ const ChannelAgentsOk = object({
9058
9058
  //#endregion
9059
9059
  //#region ../protocol/dist/frames/workspace.js
9060
9060
  /**
9061
- * Agent workspace file browsing (C→D REQ → REP) — the console's on-demand pulls.
9061
+ * Agent workspace files (C→D REQ → REP) — the console's on-demand access.
9062
9062
  *
9063
9063
  * The CP stores NO workspace data — directory listings and file bytes are pulled
9064
9064
  * live from the owning daemon and proxied to the console, never persisted
@@ -9073,7 +9073,13 @@ const ChannelAgentsOk = object({
9073
9073
  * ends the slice on a UTF-8 character boundary. `nextOffset` is the authoritative
9074
9074
  * byte offset to request next — callers must NOT recompute it from the decoded
9075
9075
  * `content` (a split multi-byte char would make the byte count drift).
9076
+ * - `workspace/write`: create a text file when `ifMatchMtime` is absent, or
9077
+ * replace one when it matches the last read. Content is base64 so arbitrary
9078
+ * UTF-8 text has a predictable wire size.
9076
9079
  */
9080
+ /** Raw UTF-8 ceiling for one console workspace-file edit. Base64 expansion still
9081
+ * leaves enough envelope headroom under the shared 256 KiB frame cap. */
9082
+ const MAX_WORKSPACE_EDIT_BYTES = 18e4;
9077
9083
  /** One directory entry in a workspace listing (name-only; not a full path). */
9078
9084
  const WorkspaceEntry = object({
9079
9085
  name: string(),
@@ -9121,6 +9127,23 @@ const WorkspaceReadContent = object({
9121
9127
  nextOffset: number().int().nonnegative().optional(),
9122
9128
  truncated: boolean().optional()
9123
9129
  });
9130
+ const CanonicalBase64 = string().max(Math.ceil(MAX_WORKSPACE_EDIT_BYTES / 3) * 4).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
9131
+ /** C→D REQ: atomically create or replace one scratch-workspace text file.
9132
+ * Omitting `ifMatchMtime` is an exclusive create; supplying it is an optimistic
9133
+ * replace, so neither operation silently overwrites a concurrent change. */
9134
+ const WorkspaceWriteReq = object({
9135
+ agentId: string().min(1),
9136
+ path: string().min(1).max(4096),
9137
+ contentBase64: CanonicalBase64,
9138
+ ifMatchMtime: string().datetime().optional()
9139
+ });
9140
+ /** D→C REP (corr = the req id): the atomically written file state. */
9141
+ const WorkspaceWriteOk = object({
9142
+ agentId: string(),
9143
+ path: string(),
9144
+ size: number().int().nonnegative(),
9145
+ mtime: string()
9146
+ });
9124
9147
  /**
9125
9148
  * Agent workspace git ops (C→D REQ → REP) — the console's on-demand controls for
9126
9149
  * a git-repo workspace. Like list/read these run daemon-local; the CP proxies the
@@ -9720,6 +9743,8 @@ const FRAME_SCHEMAS = {
9720
9743
  "workspace/list/page": WorkspaceListPage,
9721
9744
  "workspace/read": WorkspaceReadReq,
9722
9745
  "workspace/read/content": WorkspaceReadContent,
9746
+ "workspace/write": WorkspaceWriteReq,
9747
+ "workspace/write/ok": WorkspaceWriteOk,
9723
9748
  "workspace/gitstatus": WorkspaceGitStatusReq,
9724
9749
  "workspace/gitstatus/result": WorkspaceGitStatus,
9725
9750
  "workspace/gitpull": WorkspaceGitPullReq,
@@ -9899,6 +9924,8 @@ discriminatedUnion("type", [
9899
9924
  frame("workspace/list/page", FRAME_SCHEMAS["workspace/list/page"]),
9900
9925
  frame("workspace/read", FRAME_SCHEMAS["workspace/read"]),
9901
9926
  frame("workspace/read/content", FRAME_SCHEMAS["workspace/read/content"]),
9927
+ frame("workspace/write", FRAME_SCHEMAS["workspace/write"]),
9928
+ frame("workspace/write/ok", FRAME_SCHEMAS["workspace/write/ok"]),
9902
9929
  frame("workspace/gitstatus", FRAME_SCHEMAS["workspace/gitstatus"]),
9903
9930
  frame("workspace/gitstatus/result", FRAME_SCHEMAS["workspace/gitstatus/result"]),
9904
9931
  frame("workspace/gitpull", FRAME_SCHEMAS["workspace/gitpull"]),