typebulb 0.32.0 → 0.33.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/README.md CHANGED
@@ -442,7 +442,7 @@ One bulb per command, between typebulb.com and its conventional local file — t
442
442
 
443
443
  - **Pull**: `typebulb pull <bulb-url>` (or an existing local file, to refresh in place). Unlisted and public bulbs need no login. A local file with real changes is refused; `--force` overwrites it.
444
444
  - **Push**: `typebulb push <file>` uploads as you — set `TYPEBULB_TOKEN` in `.env` (minted on your typebulb.com settings page). A slug that doesn't exist yet is created, unlisted. If the site copy changed since your last pull/push, the push is refused; `--force` overwrites it. A `**server.ts**` block is stripped from the site copy (CLI-only); your local file is never modified.
445
- - **Assets**: a bulb's `assets/` folder publishes via your own host — set `"assets": "https://your-host/path/"` in `config.json`, and push verifies each file exists there (misses refuse; `--force` publishes anyway). Viewers are redirected to your host; a local file shadows its hosted copy, and display needs no CORS (only canvas/`fetch()` pixel-reading does).
445
+ - **Assets**: push carries the bulb's `assets/` folder — files upload to typebulb's asset host and the published bulb serves them with zero config (small files; caps apply, refusals say so). To self-host instead, set `"assets": "https://your-host/path/"` in `config.json`: push then verifies each file exists there (misses refuse; `--force` publishes anyway). Viewers are redirected to the asset host; a local file shadows its hosted copy, and display needs no CORS (only canvas/`fetch()` pixel-reading does).
446
446
  - **In the agent mirror**, the launcher lists your typebulb.com bulbs (pull-on-play) and local `u/<user>/` rows carry pull/push icons — same rules, same `--force` confirm.
447
447
  - `TYPEBULB_ORIGIN` in `.env` overrides the default `https://typebulb.com` host.
448
448
 
@@ -2280,7 +2280,7 @@ var Patcher = class {
2280
2280
 
2281
2281
  // cli/agents/pi/server/piPatcherExtension.ts
2282
2282
  var DESCRIPTION = true ? "Apply unified diffs to files \u2014 tolerant of form, strict about intent. Repairs sloppy AI-generated diffs (mangled headers, whitespace drift, missing prefixes; line numbers can be wrong or absent \u2014 hunks anchor by fuzzy-matched context lines) and applies all hunks atomically when the intent is unambiguous; fails with a precise, typed error when it isn't. Use for multi-hunk edits in one step, or when exact string-replacement editing fails on whitespace or invisible characters." : "Apply unified diffs to files.";
2283
- var BUILD_TAG = true ? "matchu-patchu-pi 0.3.1, built 2026-07-19 23:37:19" : "matchu-patchu-pi dev";
2283
+ var BUILD_TAG = true ? "matchu-patchu-pi 0.3.1, built 2026-07-20 09:22:11" : "matchu-patchu-pi dev";
2284
2284
  var errorBlocks = (errors) => {
2285
2285
  const parts = [`Patch failed with ${errors.length} error(s):`];
2286
2286
  for (const e of errors) parts.push("", e.toString());
@@ -19,6 +19,14 @@ export declare function parseConfig(config: string): BulbConfig;
19
19
  /** The `assets` base URL from a `config.json` string, normalized to a trailing slash —
20
20
  * undefined when absent or not an http(s) URL (callers report the malformed case). */
21
21
  export declare function assetsBase(config: string | null | undefined): string | undefined;
22
+ /** Where typebulb.com-hosted bulb assets serve from (TB-Assets-Push.md Invariant 1). */
23
+ export declare const HOSTED_ASSETS_ORIGIN = "https://assets.typebulb.com";
24
+ /** The hosted-assets base derived from a bulb's identity — the default when `config.json`
25
+ * has no `assets` key (TB-Assets-Push.md Invariant 2: derived, never stored). */
26
+ export declare const hostedAssetsBase: (userSlug: string, slug: string) => string;
27
+ /** The base a bulb's `assets/` resolves against remotely: the config key (self-host), else the
28
+ * hosted default when the bulb has an identity — else none (an identity-less bulb can't push). */
29
+ export declare const resolvedAssetsBase: (config: string | null | undefined, userSlug?: string, slug?: string) => string | undefined;
22
30
  /** Strip inline markdown (links, emphasis, code, headings) for plain-text contexts like meta descriptions. */
23
31
  export declare function stripMarkdown(text: string): string;
24
32
  /** Plain-text description from a `config.json` string: markdown stripped, single line, ≤200 chars.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../format/src/config.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAE/F,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IA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BAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAOtD;AAED;uFACuF;AACvF,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQhF;AAED,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,gCAAgC,CAAA;AAEjE;kFACkF;AAClF,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,EAAE,MAAM,MAAM,WAC2B,CAAA;AAE1F;mGACmG;AACnG,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,WAAW,MAAM,EAAE,OAAO,MAAM,uBACb,CAAA;AAIzF,8GAA8G;AAC9G,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOlD;AAED;0EAC0E;AAC1E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMrE"}
@@ -26,6 +26,14 @@ export function assetsBase(config) {
26
26
  }
27
27
  return raw.endsWith('/') ? raw : raw + '/';
28
28
  }
29
+ /** Where typebulb.com-hosted bulb assets serve from (TB-Assets-Push.md Invariant 1). */
30
+ export const HOSTED_ASSETS_ORIGIN = 'https://assets.typebulb.com';
31
+ /** The hosted-assets base derived from a bulb's identity — the default when `config.json`
32
+ * has no `assets` key (TB-Assets-Push.md Invariant 2: derived, never stored). */
33
+ export const hostedAssetsBase = (userSlug, slug) => `${HOSTED_ASSETS_ORIGIN}/u/${encodeURIComponent(userSlug)}/${encodeURIComponent(slug)}/`;
34
+ /** The base a bulb's `assets/` resolves against remotely: the config key (self-host), else the
35
+ * hosted default when the bulb has an identity — else none (an identity-less bulb can't push). */
36
+ export const resolvedAssetsBase = (config, userSlug, slug) => assetsBase(config) ?? (userSlug && slug ? hostedAssetsBase(userSlug, slug) : undefined);
29
37
  const DEFAULT_DESCRIPTION = 'A Typebulb bulb.';
30
38
  /** Strip inline markdown (links, emphasis, code, headings) for plain-text contexts like meta descriptions. */
31
39
  export function stripMarkdown(text) {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../format/src/config.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAiB/F,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,CAAA;IAC7B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED;uFACuF;AACvF,MAAM,UAAU,UAAU,CAAC,MAAiC;IAC1D,MAAM,GAAG,GAAG,WAAW,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAA;IACpD,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAC1B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAA;IAC7E,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,SAAS,CAAA;IAAC,CAAC;IAC5B,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;AAC5C,CAAC;AAED,MAAM,mBAAmB,GAAG,kBAAkB,CAAA;AAE9C,8GAA8G;AAC9G,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI;SACR,OAAO,CAAC,wBAAwB,EAAE,IAAI,CAAC;SACvC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC;SACjC,OAAO,CAAC,cAAc,EAAE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