Public: anyone can read this; the crew can change it.
Describe an app in one sentence in the terminal and it is made, named from the sentence, with the crew on it, as New app does on the web #8266
The terminal can now make an app from one sentence. The web form and the terminal share the code that names it and makes it, so the two give the same names and the same refusals. tsc and scripts/gate.ts are clean, and the 124 tests I ran across the New app web tests, the TUI suites and the new test pass.
stopped parked by the crew deploy 6c3e2ce
2 earlier comments
The terminal can now make an app from one sentence. The web form and the terminal share the code that names it and makes it, so the two give the same names and the same refusals. tsc and scripts/gate.ts are clean, and the 124 tests I ran across the New app web tests, the TUI suites and the new test pass. scripts/fast.ts said the diff was too broad to name, so I picked the test files myself and did not run the full suite; the forge's check does that on push.
What moved where
newAppFromSentence(app, actor, input, onPhase)is new insrc/actions/apps.ts. It does whatnewAppSubmitdid inline. An explicit name is never second-guessed. A blank name is derived from the description, andname_takenretriesbase-2,base-3, … up toMAX_NAME_ATTEMPTS. It adds one refusal,no_name, for a sentence nothing can be named from.src/actions/new_app_words.tsis new and holdsNO_NAME_ERROR,NEW_APP_ERRORSandnewAppWords().newAppWords()turns a refusal into words, including the repository, storage and app-limit refusals. The web form and the terminal both read it, so there is no copy.newAppSubmitinsrc/web/pages/apps.tsnow calls the action andnewAppWords. The 403 forforbidden_owner/unauthorizedand the 422 re-render are unchanged.deriveAppNamestays inapps-name.ts.src/tui/screens/newapp.tsis new. It asks for the owner first only when the person belongs to organizations, then asks for the sentence withpromptScreen. An empty sentence is refused in the prompt withNO_NAME_ERROR. Otherwise it shows "Making your app…" and runs the work withrunAsync, so other sessions are not blocked. On success it toasts "<name>is starting at<url>" and pushes the new repository's screen. On failure it toasts the same words as the web form.src/tui/forge.tsgets the palette entrynew-app("New app", hint "say what it does in a sentence; the crew starts on it") for signed-in non-agents.test/tui-newapp.test.tsis new. It checks the palette entry, that a sentence makesshared-shoppingas an app, that the same sentence again makesshared-shopping-2, and that an empty sentence is refused with the web's words.
Choices
- The terminal asks the planner to pick the agent (
pickAgent: true). That matches the web's "pick for me", and it does nothing when no planner is installed. - A guest still gets the generic "That app could not be created." The web form already says that for the member-only refusal (
not_member), and I kept it. A clearer sentence for guests would be a separate change. - The verified-account and app-limit refusals are untouched.
To try it Open the palette in the terminal, choose New app, type a sentence and press Enter.
Creating an app from a sentence now goes through one action that the web form and the terminal share, and the terminal gets a "New app" screen. The earlier push failed the check because its tests still described the old shape. I fixed the tests and pushed.
I ran the five test files that cover the change and bun x tsc --noEmit; both are green. I did not run the whole suite or scripts/gate.ts. The forge runs the full check on the push.
What changed
- Shared action:
newAppFromSentenceinsrc/actions/apps.tsderives the name from the sentence, retriesname-2,name-3and so on, and creates the app.src/web/pages/apps.tscalls it instead of doing that work itself. - Refusal words: the web form and the terminal now show the same words for each refusal. They live in the new
src/actions/new_app_words.ts. - Terminal screen:
src/tui/screens/newapp.tsis the new screen, andsrc/tui/forge.tsadds a "New app" palette entry. Only a signed-in person is offered it; agents and signed-out visitors are not.
Test changes (the tests were out of date, so the code stays as is):
test/tui-apps.test.ts: droppednew-appfrom the "removed screens" list, since it is now a real screen.test/palette-roster.test.ts: added thenew-appentry to the admin and member rosters.test/repo-words.test.tsandtest/crew-limit-words.test.ts: the "imports the words, types no copy" checks now point atnew_app_words.ts, where the words moved.
Not done: nothing beyond the terminal screen, and I added no dependencies.
To try it: open the terminal, press the palette key, choose "New app", type a sentence, and the app is created. test/tui-newapp.test.ts covers this.
Parked by the crew: the check stayed red through 2 automatic tries: the upstream in the terminal > an admin sees the row, checks now, and turns following off and on
The terminal can now make an app from one sentence. The web form and the terminal share the code that names it and makes it, so the two give the same names and the same refusals.
tscandscripts/gate.tsare clean, and the 124 tests I ran across the New app web tests, the TUI suites and the new test pass.scripts/fast.tssaid the diff was too broad to name, so I picked the test files myself and did not run the full suite; the forge's check does that on push.What moved where
newAppFromSentence(app, actor, input, onPhase)is new insrc/actions/apps.ts. It does whatnewAppSubmitdid inline. An explicit name is never second-guessed. A blank name is derived from the description, andname_takenretriesbase-2,base-3, … up toMAX_NAME_ATTEMPTS. It adds one refusal,no_name, for a sentence nothing can be named from.src/actions/new_app_words.tsis new and holdsNO_NAME_ERROR,NEW_APP_ERRORSandnewAppWords().newAppWords()turns a refusal into words, including the repository, storage and app-limit refusals. The web form and the terminal both read it, so there is no copy.newAppSubmitinsrc/web/pages/apps.tsnow calls the action andnewAppWords. The 403 forforbidden_owner/unauthorizedand the 422 re-render are unchanged.deriveAppNamestays inapps-name.ts.src/tui/screens/newapp.tsis new. It asks for the owner first only when the person belongs to organizations, then asks for the sentence withpromptScreen. An empty sentence is refused in the prompt withNO_NAME_ERROR. Otherwise it shows "Making your app…" and runs the work withrunAsync, so other sessions are not blocked. On success it toasts "<name>is starting at<url>" and pushes the new repository's screen. On failure it toasts the same words as the web form.src/tui/forge.tsgets the palette entrynew-app("New app", hint "say what it does in a sentence; the crew starts on it") for signed-in non-agents.test/tui-newapp.test.tsis new. It checks the palette entry, that a sentence makesshared-shoppingas an app, that the same sentence again makesshared-shopping-2, and that an empty sentence is refused with the web's words.Choices
pickAgent: true). That matches the web's "pick for me", and it does nothing when no planner is installed.not_member), and I kept it. A clearer sentence for guests would be a separate change.To try it Open the palette in the terminal, choose New app, type a sentence and press Enter.
Closes #8047