@joiner-platform/cli 0.1.11 → 0.1.13

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
@@ -2,10 +2,16 @@
2
2
 
3
3
  The Joiner command line: create, test, and publish Joiner tiles.
4
4
 
5
- ## Install
5
+ ## Create a tile
6
6
 
7
7
  Joiner runs on [Bun](https://bun.sh) 1.4.2 or later.
8
8
 
9
+ ```bash
10
+ bunx @joiner-platform/cli@latest create my-tile
11
+ ```
12
+
13
+ ## Install
14
+
9
15
  ```bash
10
16
  npm install -g @joiner-platform/cli
11
17
  joiner login
@@ -21,7 +21,8 @@ if command -v poe-tiles >/dev/null 2>&1; then
21
21
  fi
22
22
 
23
23
  if command -v bun >/dev/null 2>&1; then
24
- exec bunx --bun poe-tiles doctor --cwd "$PROJECT_ROOT"
24
+ # poe-tiles is a bin of @joiner-platform/cli, not an npm package of its own.
25
+ exec bunx --bun --package @joiner-platform/cli poe-tiles doctor --cwd "$PROJECT_ROOT"
25
26
  fi
26
27
 
27
28
  echo "Could not run Joiner doctor because Bun is not available."
@@ -14,7 +14,7 @@
14
14
  "scripts": {
15
15
  "generate-test-apps": "bun scripts/generate.ts && bun install --ignore-scripts --no-save",
16
16
  "generate:cleanup": "bun scripts/cleanup.ts",
17
- "test": "bun test tests/check-source.test.ts tests/playwright-version.test.ts tests/happy-dom-version.test.ts tests/native-gesture-defaults.test.ts tests/visual-check.test.ts tests/install-diagnostics.test.ts tests/render-check-scaffold.test.ts tests/sdk-dependency-key.test.ts",
17
+ "test": "bun test tests/check-source.test.ts tests/playwright-version.test.ts tests/happy-dom-version.test.ts tests/native-gesture-defaults.test.ts tests/visual-check.test.ts tests/install-diagnostics.test.ts tests/render-check-scaffold.test.ts tests/sdk-dependency-key.test.ts tests/doctor-launcher.test.ts",
18
18
  "test:generated": "bun test tests/generated-templates.test.ts",
19
19
  "test:generated:packaged-sdk": "bun scripts/verify-local-sdk-tarball.ts",
20
20
  "test:slow": "bun run generate-test-apps && bun test ./tests/*.test.slow.ts --reporter=junit --reporter-outfile=junit-slow.xml",
@@ -0,0 +1,48 @@
1
+ import { afterEach, expect, test } from "bun:test";
2
+ import {
3
+ chmodSync,
4
+ copyFileSync,
5
+ mkdirSync,
6
+ mkdtempSync,
7
+ realpathSync,
8
+ rmSync,
9
+ writeFileSync,
10
+ } from "node:fs";
11
+ import { tmpdir } from "node:os";
12
+ import { join } from "node:path";
13
+
14
+ const roots: string[] = [];
15
+ afterEach(() => {
16
+ for (const root of roots.splice(0))
17
+ rmSync(root, { recursive: true, force: true });
18
+ });
19
+
20
+ test("doctor runs the npm CLI's poe-tiles bin when only Bun is installed", () => {
21
+ // A tile scaffolded with `bunx @joiner-platform/cli create` has no
22
+ // poe-tiles on PATH and no monorepo checkout around it.
23
+ const root = realpathSync(mkdtempSync(join(tmpdir(), "doctor-launcher-")));
24
+ roots.push(root);
25
+ const scripts = join(root, "tile/scripts");
26
+ mkdirSync(scripts, { recursive: true });
27
+ copyFileSync(
28
+ join(import.meta.dir, "../base/scripts/doctor.sh"),
29
+ join(scripts, "doctor.sh"),
30
+ );
31
+ const bin = join(root, "bin");
32
+ mkdirSync(bin);
33
+ for (const name of ["bun", "bunx"]) {
34
+ writeFileSync(join(bin, name), `#!/bin/sh\necho "${name} $*"\n`);
35
+ chmodSync(join(bin, name), 0o755);
36
+ }
37
+
38
+ const result = Bun.spawnSync(["bash", join(scripts, "doctor.sh")], {
39
+ env: { PATH: `${bin}:/usr/bin:/bin` },
40
+ stdout: "pipe",
41
+ stderr: "pipe",
42
+ });
43
+
44
+ expect(result.stderr.toString()).toBe("");
45
+ expect(result.stdout.toString().trim()).toBe(
46
+ `bunx --bun --package @joiner-platform/cli poe-tiles doctor --cwd ${join(root, "tile")}`,
47
+ );
48
+ });
package/cli.ts CHANGED
@@ -22,6 +22,7 @@ import { createAdminCommands } from "./src/commands/admin.js";
22
22
  import { createAuthCommands } from "./src/commands/auth.js";
23
23
  import { createCreatorSourceCapabilityCommand } from "./src/commands/creator-source-capability.js";
24
24
  import { createDoctorCommand } from "./src/commands/doctor-command.js";
25
+ import { createInitCommand } from "./src/commands/init/index.js";
25
26
  import { createInstallJoinerCommand } from "./src/commands/install-joiner.js";
26
27
  import { createLoginCommand } from "./src/commands/login.js";
27
28
  import { createModelsCommands } from "./src/commands/models.js";
@@ -75,6 +76,13 @@ const clientProxy = new Proxy({} as SlopPoeClient, {
75
76
  program.addCommand(createAuthCommands(clientProxy));
76
77
  program.addCommand(createLoginCommand(clientProxy));
77
78
  program.addCommand(createTilesCommands(clientProxy));
79
+ // `tiles init` at the top level, so `bunx @joiner-platform/cli@latest create`
80
+ // scaffolds a tile without installing the CLI first.
81
+ program.addCommand(
82
+ createInitCommand()
83
+ .name("create")
84
+ .description("Create a new Joiner tile (same as `tiles init`)"),
85
+ );
78
86
  program.addCommand(createRemixCommand(clientProxy));
79
87
  program.addCommand(createModelsCommands(clientProxy));
80
88
  program.addCommand(createAccountsCommands(clientProxy));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joiner-platform/cli",
3
- "version": "0.1.11",
4
- "gitHead": "b247e3bc7cb42e80727d22bb4d4e645e3116cc6c",
3
+ "version": "0.1.13",
4
+ "gitHead": "bcd42102d16429ca18855e078a852f508d498b08",
5
5
  "description": "The Joiner CLI: create, test, and publish Joiner tiles, with agent skills for coding agents.",
6
6
  "keywords": [
7
7
  "joiner",
@@ -448,7 +448,7 @@ export const tileHooks = {
448
448
  - `onInit(ctx, { parentRoomUsers })` — new root-group or child-room instance initialized. Read `await ctx.table("$$system").get("room")` for the current room topology, and use `ctx.userId` for the initiating user when the bootstrap came from a user/external store; use `ctx.isSystem`, not `ctx.source.type === "system"`, to detect trusted system scope. `parentRoomUsers` is a **read-only snapshot** of the active parent room roster (`PoeUserInfo[]`) for child rooms and empty for root groups — useful to detect a fresh rootGroup genesis or to react to the parent roster, never a way to admit members. Apps may write their own tables on both passes. Do **not** write `$users` directly, and do not try to pull parent-room users into the instance: membership is platform-owned. The host seats the launcher at genesis (and both users when the tile is launched from a 2-person room, i.e. a DM); anyone else joins through the host picker/invite flows.
449
449
  - The acting user (`ctx.userId`) is always a live `$users` member by the time their own pushed mutation runs or their own pull returns: the platform admits them first. Never wait, retry, or poll for your own row. Other members' rows can arrive later, through the room.
450
450
  - Use `onInit` for deterministic one-time bootstrap, not membership. It is a good place to seed app-owned rows such as an initial activity or transcript message (`"{name} started the group"`).
451
- - `onAddUsersV2(ctx, { users })` — users joined the instance, one call per batch (a genesis roster arrives whole), in admission order. Use it to auto-seat users or append membership activity. Read `$users[userId].addedBy` and `$userInfo` for attribution. Each entry's optional `addedBatchUserIds` is the ordered invitation group for its operation; it is not stored on membership rows, and one call can write one grouped announcement. Each entry's optional `joinKind` says how the member came in (`"added"` by another member, `"inviteLink"`, or on their own: `"open"`, `"group"`, `"session"`), and `invitedBy` names the creator of an invite link. Only this hook gets them; they are not stored on the `$users` row, so save what you need in your own table. Retain any history needed in your own message metadata.
451
+ - `onAddUsersV2(ctx, { users })` — users joined the instance, one call per batch (a genesis roster arrives whole), in admission order. Use it to auto-seat users or append membership activity. Read `$users[userId].addedBy` and `$userInfo` for attribution. Each entry's optional `addedBatchUserIds` is the ordered invitation group for its operation; it is not stored on membership rows, and one call can write one grouped announcement. Each entry's optional `joinKind` says how the member came in (`"added"` by another member, `"inviteLink"`, or on their own: `"group"`, `"session"`), and `invitedBy` names the creator of an invite link. Only this hook gets them; they are not stored on the `$users` row, so save what you need in your own table. Retain any history needed in your own message metadata.
452
452
  - `onAddUsers` is deprecated. Use `onAddUsersV2`; a tile that defines both fails to load.
453
453
  - `onRemoveUser(ctx, { userId })` — user removed. The platform clears that member's turn marker for you, before this hook runs. Other members' turns and app-owned seats, pause/restart rules, and scores stay app-controlled. Losing connectivity does not remove membership or clear a turn.
454
454
  - `onAnonymizeUser(ctx, { userId })` — user hard-deleted/anonymized
@@ -99,7 +99,7 @@ export const myBackendConfig = defineBackendConfig({
99
99
  | Hook | Input | When it fires |
100
100
  |------|-------|---------------|
101
101
  | `onInit` | `{ parentRoomUsers }` | A new child-room instance is initialized with parent-room context (`parentRoomUsers` is a read-only roster snapshot) |
102
- | `onAddUsersV2` | `{ users: Array<{ userId: string; batchUserIds?: string[]; addedBatchUserIds?: string[]; joinKind?: "added" \| "inviteLink" \| "open" \| "group" \| "session"; invitedBy?: string; poeFeedbackResponder?: boolean }> }` | Users join the store instance; one call per batch |
102
+ | `onAddUsersV2` | `{ users: Array<{ userId: string; batchUserIds?: string[]; addedBatchUserIds?: string[]; joinKind?: "added" \| "inviteLink" \| "group" \| "session"; invitedBy?: string; poeFeedbackResponder?: boolean }> }` | Users join the store instance; one call per batch |
103
103
  | `onRemoveUser` | `{ userId: string }` | User leaves the store instance |
104
104
  | `onAnonymizeUser` | `{ userId: string }` | User is hard-deleted/anonymized |
105
105
  | `onSetTitle` | `{ userId: string; title: string \| null }` | Store title changes; `title` is `null` when the custom title is cleared/reset to the default — handle the reset case rather than interpolating `null` |
@@ -121,7 +121,6 @@ Common hook uses:
121
121
  |---|---|---|
122
122
  | `"added"` | was added by another member (the host picker, `Poe.room.pickMembers()`) | `$users[userId].addedBy` |
123
123
  | `"inviteLink"` | opened another member's invite link | `invitedBy`, the link's creator; absent when the creator was not in the room at the join, or has deleted their account |
124
- | `"open"` | joined from "Join your friends" because a member lets their network or contacts join | nobody |
125
124
  | `"group"` | is in the room's parent group and let themselves in | nobody |
126
125
  | `"session"` | came from the session this one was launched from | nobody |
127
126
 
@@ -61,7 +61,7 @@ an older pin, so prefer the live result when upgrading:
61
61
 
62
62
  <!-- begin: sdk-tarball-snippet (auto-generated by packages/poe-tiles-sdk/scripts/publish-tar.ts — do not edit by hand) -->
63
63
  ```json
64
- "joiner-sdk": "https://misc-dev-uploads.quora-913.workers.dev/4508a93541f755cd809b7e4a3035e88588546fd52a114efaffd03c686a863c1d"
64
+ "joiner-sdk": "https://misc-dev-uploads.quora-913.workers.dev/b3041b034e5b146cf04c4d5bc4b8a8b63e51e265ec51f7adba36547d2614bd72"
65
65
  ```
66
66
  <!-- end: sdk-tarball-snippet -->
67
67
 
@@ -1,4 +1,4 @@
1
1
  // Auto-generated by poe-tiles-sdk/scripts/publish-tar.ts — do not edit
2
- // publishedAt: 2026-11-25T18:29:18.157Z
2
+ // publishedAt: 2026-11-25T22:23:47.474Z
3
3
  export const SDK_TARBALL_URL =
4
- "https://misc-dev-uploads.quora-913.workers.dev/4508a93541f755cd809b7e4a3035e88588546fd52a114efaffd03c686a863c1d";
4
+ "https://misc-dev-uploads.quora-913.workers.dev/b3041b034e5b146cf04c4d5bc4b8a8b63e51e265ec51f7adba36547d2614bd72";
@@ -8,7 +8,8 @@ export function shouldSkipClientSetup(actionCommand: Command): boolean {
8
8
  (cmdName === "remix" &&
9
9
  actionCommand.getOptionValue("localArchive") !== undefined) ||
10
10
  cmdName === "doctor" ||
11
- (cmdName === "create" && parentName === "tiles") ||
11
+ (cmdName === "create" &&
12
+ (parentName === "tiles" || !actionCommand.parent?.parent)) ||
12
13
  (cmdName === "inspect" && parentName === "tiles") ||
13
14
  cmdName === "init" ||
14
15
  parentName === "skills" ||