tencil 0.3.2 → 0.5.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/dist/vite.d.mts CHANGED
@@ -1,8 +1,11 @@
1
+ import { t as TencilCloudOptions } from "./cloud-Ez2olqK0.mjs";
1
2
  //#region src/integrations/vite.d.ts
2
3
  /** Structural subset of Vite's Plugin type, so `vite` stays an optional peer. */
3
4
  interface VitePlugin {
4
5
  name: string;
5
- apply: 'serve';
6
+ apply(config: unknown, env: {
7
+ command: 'build' | 'serve';
8
+ }): boolean;
6
9
  transformIndexHtml(): Array<{
7
10
  tag: string;
8
11
  children: string;
@@ -13,10 +16,18 @@ interface VitePlugin {
13
16
  export interface TencilViteOptions {
14
17
  /** Port of the Tencil daemon. Defaults to TENCIL_PORT or 4747. */
15
18
  port?: number;
19
+ /**
20
+ * Tencil Cloud for preview builds. On when TENCIL_CLOUD holds a project key;
21
+ * repo, branch and commit come from the host. Production builds never load it.
22
+ */
23
+ cloud?: TencilCloudOptions;
16
24
  }
17
25
  /**
18
- * Dev-only: loads the overlay from the Tencil daemon on the machine serving the
19
- * page (`npx tencil start`). Without a running daemon nothing appears.
26
+ * In development: loads the overlay from the Tencil daemon on the machine serving
27
+ * the page (`npx tencil start`). Without a running daemon nothing appears.
28
+ *
29
+ * In a build: nothing, unless TENCIL_CLOUD is set for a preview deployment; then
30
+ * the page loads the overlay from Tencil Cloud.
20
31
  */
21
32
  export default function tencil(options?: TencilViteOptions): VitePlugin;
22
33
  //#endregion
package/dist/vite.mjs CHANGED
@@ -1,17 +1,32 @@
1
+ import { n as cloudLoader, r as resolveCloudBuild } from "./cloud-CiwIrP1h.mjs";
1
2
  import { n as overlayLoader } from "./loader-BevujQ44.mjs";
2
3
  //#region src/integrations/vite.ts
3
4
  /** Vite's dev client, which every dev page loads, whether or not it has an index.html. */
4
5
  const VITE_CLIENT = /vite\/dist\/client\/(?:client|bundledDevClient)\.mjs$/;
5
6
  /**
6
- * Dev-only: loads the overlay from the Tencil daemon on the machine serving the
7
- * page (`npx tencil start`). Without a running daemon nothing appears.
7
+ * In development: loads the overlay from the Tencil daemon on the machine serving
8
+ * the page (`npx tencil start`). Without a running daemon nothing appears.
9
+ *
10
+ * In a build: nothing, unless TENCIL_CLOUD is set for a preview deployment; then
11
+ * the page loads the overlay from Tencil Cloud.
8
12
  */
9
13
  function tencil(options = {}) {
10
- const loader = overlayLoader(options.port ?? Number(process.env.TENCIL_PORT ?? 4747));
14
+ const port = options.port ?? Number(process.env.TENCIL_PORT ?? 4747);
15
+ let loader = overlayLoader(port);
16
+ let command = "serve";
11
17
  return {
12
18
  name: "tencil",
13
- apply: "serve",
19
+ apply(_config, env) {
20
+ command = env.command;
21
+ if (command === "serve") return true;
22
+ const cloud = resolveCloudBuild(process.env, options.cloud);
23
+ report(cloud);
24
+ if (cloud.kind !== "on") return false;
25
+ loader = cloudLoader(cloud);
26
+ return true;
27
+ },
14
28
  transform(code, id) {
29
+ if (command !== "serve") return void 0;
15
30
  return VITE_CLIENT.test(id) ? `${code}\n${loader}\n` : void 0;
16
31
  },
17
32
  transformIndexHtml() {
@@ -23,5 +38,9 @@ function tencil(options = {}) {
23
38
  }
24
39
  };
25
40
  }
41
+ function report(cloud) {
42
+ if (cloud.kind === "refused") console.warn(`[tencil] Not loading Tencil Cloud in this build. ${cloud.reason}`);
43
+ else if (cloud.kind === "on") console.log(`[tencil] Tencil Cloud on for ${cloud.build.repo}@${cloud.build.branch} (${cloud.build.sha.slice(0, 7)}).`);
44
+ }
26
45
  //#endregion
27
46
  export { tencil as default };
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "tencil",
3
- "version": "0.3.2",
3
+ "version": "0.5.0",
4
4
  "description": "Point at any element of your running app and tell your coding agent what to fix.",
5
- "license": "MIT",
5
+ "license": "Apache-2.0",
6
6
  "author": "Pixel Perfect Agency",
7
7
  "homepage": "https://tencil.dev",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/pixel-perfect-agency/tencil.git",
10
+ "url": "git+https://github.com/tencildev/tencil.git",
11
11
  "directory": "packages/tencil"
12
12
  },
13
13
  "bugs": {
14
- "url": "https://github.com/pixel-perfect-agency/tencil/issues"
14
+ "url": "https://github.com/tencildev/tencil/issues"
15
15
  },
16
16
  "keywords": [
17
17
  "agent",
@@ -50,6 +50,7 @@
50
50
  },
51
51
  "files": [
52
52
  "dist",
53
+ "NOTICE",
53
54
  "THIRD_PARTY_NOTICES.md"
54
55
  ],
55
56
  "publishConfig": {
@@ -85,12 +86,13 @@
85
86
  "@types/ws": "^8.18.2",
86
87
  "react": "^19.3.0",
87
88
  "tsdown": "^0.23.0",
88
- "@tencil/overlay": "0.0.0",
89
- "@tencil/protocol": "0.0.0",
90
- "@tencil/provider-claude-code": "0.0.0",
91
- "@tencil/provider-t3code": "0.0.0",
92
- "@tencil/testing": "0.0.0",
93
- "@tencil/tsconfig": "0.0.0"
89
+ "@tencildev/bridge": "0.1.0",
90
+ "@tencildev/overlay": "0.0.0",
91
+ "@tencildev/protocol": "0.1.0",
92
+ "@tencildev/provider-claude-code": "0.0.0",
93
+ "@tencildev/provider-t3code": "0.0.0",
94
+ "@tencildev/testing": "0.1.0",
95
+ "@tencildev/tsconfig": "0.0.0"
94
96
  },
95
97
  "scripts": {
96
98
  "build": "tsdown && node scripts/copy-overlay.mjs",