agentful 0.4.44 → 0.4.45

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 (2) hide show
  1. package/dist/index.cjs +14 -1
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -3044,7 +3044,7 @@ var VERSION, brand, useColor, wrap, paint, tuiDesign, sym, ui;
3044
3044
  var init_branding = __esm({
3045
3045
  "src/branding.ts"() {
3046
3046
  "use strict";
3047
- VERSION = "0.4.44" ? "0.4.44" : null.version;
3047
+ VERSION = "0.4.45" ? "0.4.45" : null.version;
3048
3048
  brand = {
3049
3049
  name: "agentful",
3050
3050
  // the command users type
@@ -6367,6 +6367,10 @@ function requireProject(cwd = process.cwd()) {
6367
6367
  return config;
6368
6368
  }
6369
6369
  var PROJECT_ID = /^[a-z0-9]{10,20}$/i;
6370
+ function printable(text, max) {
6371
+ const clean = text.replace(/[\u0000-\u001f\u007f-\u009f]/g, " ").replace(/\s+/g, " ").trim();
6372
+ return clean.length > max ? `${clean.slice(0, max - 1)}\u2026` : clean;
6373
+ }
6370
6374
  async function linkProject(auth, projectId, title, cwd = process.cwd()) {
6371
6375
  if (!PROJECT_ID.test(projectId)) {
6372
6376
  throw new ApiError(
@@ -6396,6 +6400,15 @@ async function linkProject(auth, projectId, title, cwd = process.cwd()) {
6396
6400
  `The platform returned no owner for project ${projectId}; nothing was linked.`
6397
6401
  );
6398
6402
  }
6403
+ if (record.role === "guest") {
6404
+ const org = typeof record.org_name === "string" ? printable(record.org_name, 80) : "";
6405
+ const link = `${APP_URL}/shared/${encodeURIComponent(storageUserId)}/${projectId}`;
6406
+ throw new ApiError(
6407
+ 403,
6408
+ "guest_preview_only",
6409
+ `Project ${projectId} is shared with you as a guest${org ? ` by ${org}` : ""}. Guests see only the preview, in the app; nothing was linked. Open it at ${link}`
6410
+ );
6411
+ }
6399
6412
  await request(`${API_URL}/api/workspaces/${encodeURIComponent(storageUserId)}/${projectId}/tree`, { token: auth.pb_token });
6400
6413
  const config = {
6401
6414
  projectId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentful",
3
- "version": "0.4.44",
3
+ "version": "0.4.45",
4
4
  "description": "Agentful in your terminal — local development with push-to-cloud previews",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://agentful.dev",