teamclaws 2.0.18 → 2.0.20

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.md CHANGED
@@ -243,6 +243,9 @@ a short-lived target proof for that bound pairing, performs at most one direct
243
243
  workspace verification with a five-second timeout, reports the result, and
244
244
  stops. It never starts pairing or loads external-chat resources.
245
245
 
246
+ Legacy saved pairings for other workspaces do not require the selected workspace
247
+ to be paired again.
248
+
246
249
  After pairing, `chat start`, `chat send`, and `chat watch` use the protected
247
250
  workspace credential directly against that exact workspace. They verify the
248
251
  authoritative versioned handoff, resolve the workspace capability catalog, and
package/dist/constants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const PACKAGE_NAME = "teamclaws";
2
- export const PACKAGE_VERSION = "2.0.18";
2
+ export const PACKAGE_VERSION = "2.0.20";
3
3
  export const CLIENT_NAME = "teamclaws-cli";
4
4
  export const CONTRACT_VERSION = 1;
5
5
  export const OUTPUT_SCHEMA_VERSION = 1;
package/dist/storage.js CHANGED
@@ -6,7 +6,7 @@ import { basename, dirname, join } from "node:path";
6
6
  import { promisify } from "node:util";
7
7
  import { TeamClawsError } from "./errors.js";
8
8
  import { parseDurableAuthorization, } from "./target-authorization.js";
9
- import { isObject, requireHttpsUrl, requireInteger, normalizeUuid, parseLoginCredential, parseStatusWorkspaceCredential, parseWorkspaceCredential, } from "./validation.js";
9
+ import { canonicalWorkspaceOrigin, isObject, requireHttpsUrl, requireInteger, normalizeUuid, parseLoginCredential, parseStatusWorkspaceCredential, parseWorkspaceCredential, } from "./validation.js";
10
10
  const execFile = promisify(execFileCallback);
11
11
  const SYSTEM_SID = "S-1-5-18";
12
12
  const MAX_WORKSPACE_CREDENTIAL_FILES = 256;
@@ -86,7 +86,20 @@ export class CredentialStore {
86
86
  for (const name of names.sort()) {
87
87
  if (!UUID_CREDENTIAL_NAME.test(name))
88
88
  continue;
89
- const credential = await this.readWorkspaceForStatus(name.slice(0, -5));
89
+ const serverId = name.slice(0, -5);
90
+ const value = await this.readJsonIfPresent(this.workspacePath(serverId));
91
+ if (isObject(value) && value.version === 1) {
92
+ try {
93
+ if (canonicalWorkspaceOrigin(value.origin) !== origin)
94
+ continue;
95
+ }
96
+ catch {
97
+ // Preserve the legacy error below when its origin cannot be identified.
98
+ }
99
+ }
100
+ const credential = value === undefined
101
+ ? undefined
102
+ : parseStatusWorkspaceCredential(value, serverId);
90
103
  if (credential?.origin === origin)
91
104
  matches.push(credential);
92
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamclaws",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "description": "Official TeamClaws command-line client and agent skills",
5
5
  "license": "PolyForm-Shield-1.0.0",
6
6
  "homepage": "https://teamclaws.com",
@@ -66,14 +66,45 @@ for the operation performed; do not treat every nonzero status as a stop conditi
66
66
  Verify file transfers against the destination bytes. There is no dedicated CLI file-transfer command and no
67
67
  implicit SSH connection. Do not invent one or handle the saved credential yourself.
68
68
 
69
+ ### Default destination for shared documents
70
+
71
+ Default shared documents, reports, findings, and transfers to the provisioned
72
+ `handoffs` directory unless the user names another destination. Keep projects in
73
+ their selected directories; do not change the general working directory or move them.
74
+
75
+ Discover the exact shared path through the existing paired shell:
76
+
77
+ ```text
78
+ teamclaws shell <server-id> --command 'printf "%s\n" "$TEAMCLAWS_HANDOFFS_DIR"' --json
79
+ ```
80
+
81
+ Use the returned absolute path, not `$HOME`, the starting directory, or a guessed
82
+ temporary location. If the advertised path is absent or unavailable on an older
83
+ workspace, report that it needs the sharing update. Do not create an unshared
84
+ fallback or claim shared delivery; continue authorized reads and other searches.
85
+
86
+ Keep secrets, credentials, browser profiles, and unrelated private files out.
87
+ Create fresh destination bytes using the directory's provisioned group/default
88
+ ACLs; do not move private files in or preserve their `0600` mode. Default ACLs
89
+ handle a restrictive umask, but explicit private modes can still deny collaborators.
90
+ For a shared document you own, retain the inherited group and enable group
91
+ read/write on that file. Do not change other identities' or parent permissions.
92
+
93
+ Record the exact path, matching source/destination SHA-256 hashes, and whether
94
+ the intended recipient can read the actual file through normal authorized access.
95
+ The writer's own read does not establish recipient access. If recipient access is
96
+ unverified, report that accurately and continue other authorized work.
97
+
69
98
  ### Find a file the user left on the server
70
99
 
71
100
  When the user names a file without a path, explain where they probably put it
72
101
  when working through the CLI, then inspect those locations before asking them
73
102
  for a full path:
74
103
 
104
+ - The advertised `TEAMCLAWS_HANDOFFS_DIR` and its children first for shared
105
+ documents and handoffs. Discover it using the command above.
75
106
  - The directory reported by `pwd`, and the project's directory if known.
76
- - `/tmp/`, especially an existing `/tmp/teamclaws-shared/` handoff directory,
107
+ - `/tmp/`, especially an existing `/tmp/handoffs/` handoff directory,
77
108
  and `/var/tmp/`. These are temporary locations, not durable storage.
78
109
  - The shared workspace, commonly `/home/teamclaws_user/`, including documented
79
110
  project, artifact, or handoff directories in `LOCAL_AGENT.md` or project instructions.
@@ -102,29 +133,35 @@ a found non-secret file, return its bytes through the paired shell (base64 is
102
133
  suitable), save them locally, and compare the remote and saved SHA-256 hashes.
103
134
  Preserve the remote original and do not print encoded file contents unnecessarily.
104
135
 
105
- For ordinary files, use the shell to create a new staging directory, decode
106
- base64-encoded file bytes there, and compare SHA-256 hashes against the local
107
- files. Construct the argument with a subprocess argument list (no local shell
108
- interpolation). A remote Python example for a single **non-secret** file is:
136
+ For shared documents, write into the advertised handoffs directory. For a project,
137
+ use its selected destination. Decode base64-encoded bytes there and compare SHA-256
138
+ hashes against the local files. Construct the argument with a subprocess argument
139
+ list (no local shell interpolation). A remote Python example for a single shared
140
+ **non-secret** document is:
109
141
 
110
142
  ```text
111
143
  python3 - <<'TEAMCLAWS_FILE'
112
- import base64, hashlib, pathlib
113
- p = pathlib.Path.home() / 'apps' / 'example-staging' / 'README.md'
114
- p.parent.mkdir(parents=True, exist_ok=True)
144
+ import base64, hashlib, os, pathlib
145
+ handoffs = pathlib.Path(os.environ['TEAMCLAWS_HANDOFFS_DIR'])
146
+ p = handoffs / 'README.md'
115
147
  with p.open('xb') as output:
116
148
  output.write(base64.b64decode('SGVsbG8K', validate=True))
149
+ p.chmod(0o660)
117
150
  print(hashlib.sha256(p.read_bytes()).hexdigest())
118
151
  TEAMCLAWS_FILE
119
152
  ```
120
153
 
121
154
  Replace the path and encoded content from the selected project; the example
122
155
  writes the bytes `Hello\n`. Exclusive creation prevents overwriting existing
123
- files. Check remote Python availability before using this example. Transfer
156
+ files. The directory must already be provisioned; the example does not create it.
157
+ The file inherits its collaboration group and ACLs, and `0660` keeps group
158
+ read/write without granting other users access. Check remote Python availability
159
+ before using this example, then verify the intended recipient's read access. Transfer
124
160
  larger files in bounded chunks to a new staging file, checking the final hash.
125
161
  Use project-appropriate consistent exports for databases and persistent data;
126
- copying an active database file is not a verified backup. Preserve file modes
127
- where needed; inspect symlinks and never follow them outside the selected source.
162
+ copying an active database file is not a verified backup. Preserve project file
163
+ modes where needed; use the handoff sharing permissions for shared documents.
164
+ Inspect symlinks and never follow them outside the selected source.
128
165
  If an archive is used, reject absolute paths, parent traversal and escaping links
129
166
  before extraction. Verify the destination file inventory and hashes, then place
130
167
  it at the agreed destination without overwriting unrelated data.