Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blog/deciding-well-solved/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e8362db27ef1c74db498925aef127fcff24975a38a055f3597c5860317432d6f
fd33eff778150dc9761c06686c8724f3a410d2d92c31773199bf296e7a978280
2 changes: 1 addition & 1 deletion blog/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
486f812b0edf7b0f3c981eb4dd4709b4218e795cd21d935b6258a3b5803cff50
0c6e7f492bbc825a28152adc82ecaa38db04c4783d8ceff19764d4da82f8a08b
2 changes: 1 addition & 1 deletion blog/one-question-answered/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ed3017add7c3343c626aec13efc4a9d43a13a11a8a850207f35b9732ea2b3070
0685827113872e73e353e63f4760d642c5453e7536aaa751598c87f69767a264
25 changes: 18 additions & 7 deletions chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
// root with a code; wherever the widget then runs, it checks the state, exchanges the code and
// returns to that path. The access token and the ID token are kept in the browser under
// `chat-signin`, every message after carries the access token as `Authorization: Bearer`, and
// `/logout` forgets both and ends the session at the service. A tag without `data-issuer` offers
// `/logout` forgets both and ends the session at the service. A token that has lapsed, or that
// the host no longer takes, is forgotten too, and the message goes as a visitor's, which Sonnet 5
// answers, under a line that says so. A tag without `data-issuer` offers
// none of the four words, `/login`, `/logout`, `/model` and `/effort`, and sends them as it
// sends any question.
//
Expand Down Expand Up @@ -150,6 +152,7 @@
keys: { send: "enter send", last: "↑ last question", pick: "{range} pick", help: "/help", chosen: "{model} · {effort}" },
menu: { model: "Choose a model", effort: "Choose an effort" },
signInHint: "Sign in with /login to choose a model.",
lapsedHint: "Your sign-in has expired, so {model} answers now. Sign in again with /login to choose a model.",
effortHint: "The effort can be chosen once your sign-in grants a model.",
help: [["/new", "start a new conversation (also /clear)"], ["/login", "sign in, to choose a model"], ["/logout", "sign out"], ["/model", "choose the model that answers"], ["/effort", "choose how long it thinks"], ["/help", "this list"], ["{range}", "pick from the menu above"], ["↑", "your last question back into the line"]],
tryLabel: "Try", askNext: "Ask next",
Expand Down Expand Up @@ -212,6 +215,7 @@
keys: { send: "Enter senden", last: "↑ letzte Frage", pick: "{range} wählen", help: "/help", chosen: "{model} · {effort}" },
menu: { model: "Modell wählen", effort: "Aufwand wählen" },
signInHint: "Melde dich mit /login an, um ein Modell zu wählen.",
lapsedHint: "Deine Anmeldung ist abgelaufen, darum antwortet jetzt {model}. Melde dich mit /login wieder an, um ein Modell zu wählen.",
effortHint: "Den Aufwand kannst du wählen, sobald deine Anmeldung ein Modell erlaubt.",
help: [["/new", "ein neues Gespräch beginnen (auch /clear)"], ["/login", "anmelden, um ein Modell zu wählen"], ["/logout", "abmelden"], ["/model", "das antwortende Modell wählen"], ["/effort", "wählen, wie lange es nachdenkt"], ["/help", "diese Liste"], ["{range}", "aus dem Menü darüber wählen"], ["↑", "deine letzte Frage zurück in die Zeile"]],
tryLabel: "Probier mal", askNext: "Frag weiter",
Expand Down Expand Up @@ -2436,6 +2440,9 @@
catch (e) { return null; }
}
function forget(){ try { localStorage.removeItem(SIGNIN_KEY); } catch (e) {} keysLine(); }
// A sign-in that no longer holds, lapsed here or refused by the host: it is forgotten, and a
// line says the conversation goes on with Sonnet 5, the model every visitor gets.
function fallBack(){ forget(); hint(strings(langNow()).lapsedHint.replace("{model}", CHAT_MODELS[0].label)); }
// The reader's name, from the ID token: `name`, else `preferred_username`.
function readerName(){
var s = signedIn(), c = s && claimsOf(s.id);
Expand Down Expand Up @@ -2635,10 +2642,10 @@
// A number that picks a row of the model or effort menu is the choice, and nothing is sent.
if (menuChoice && menuChoice.rows === menuRows && text !== typed) { input.value = ""; menuChoice.pick(menuChoice.values[menuRows.indexOf(text)]); return; }
if (text.length > LIMIT) { refuse("too_long"); return; }
// A sign-in whose access token has lapsed is not sent, nor sent without it: the reader is
// asked to sign in again, and the question stays in the line and the conversation as it was.
// A sign-in whose access token has lapsed is forgotten rather than sent: the reader is told
// so in a line, and the question goes as a visitor's, which Sonnet 5 answers.
var token = signedIn();
if (token && lapsed(token.access, Date.now())) { refuse("signed_out"); return; }
if (token && lapsed(token.access, Date.now())) { fallBack(); token = null; }
// The model and effort it goes with, a visitor's none; above `low` to the host's own address
// where the tag names one, and given the time a long answer takes.
var choice = token ? chosen(true) : null, high = !!choice && choice.effort !== CHAT_EFFORTS[0];
Expand Down Expand Up @@ -2742,9 +2749,13 @@
if (ans.parentNode) ans.parentNode.removeChild(ans);
unsend();
busy = false; input.disabled = false;
// The server no longer takes the token: it is forgotten, and the next message goes
// as a visitor's until the reader signs in again.
if (got.code === "signed_out") forget();
// The server no longer takes the token: it is forgotten, the reader is told so, and
// the question goes again at once as a visitor's, its first bubble gone with it.
if (got.code === "signed_out") {
if (mine.parentNode) mine.parentNode.removeChild(mine);
fallBack(); input.value = text; send();
return;
}
// A model the sign-in does not grant: the question goes back into the line, to be
// sent again once another is chosen.
if (got.code === "not_granted" && !input.value) input.value = text;
Expand Down
2 changes: 1 addition & 1 deletion ideas/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b1565dd894b95c67eae09b7bd1ceda99a38bee92f051388b00aec5a488114d2e
357038d5824bab66c7797dd7ac911b08c479fa86551478b25c4dc1213d0aeddb
2 changes: 1 addition & 1 deletion model/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4093a766b716adfd0636ff27a7a864232e83646eee091e4e8bcea0490a1ceb1e
356825da4cf63dca5d70cf5c406ce6f1b794f3c84d2d0fc15ad3b3c9e9c9f7f0
2 changes: 1 addition & 1 deletion og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
434162c4fca70b6d72e9374401801e625c188438fb381db2b80b354ac35ff549
9e465cdc89df7f5033bb803b9bc9e7a054cc9f4e450b577331d0d6f143aae3ab
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"pin:check": "node pin-check.mjs"
},
"devDependencies": {
"@robertblust/design": "github:robertblust/design#v0.158.2",
"@robertblust/design": "github:robertblust/design#v0.159.0",
"companygraph-mcp-server": "github:companygraph/mcp-server#v0.69.0",
"pdf-lib": "^1.17.1",
"playwright": "^1.64.1"
Expand Down
2 changes: 1 addition & 1 deletion principles/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
538a4919d09f1b37005ecd8a071de166311929cc4f9c14297ae675c70cc83a66
1e2f392d822319162a4f61c3886f46785b260a5edb175c85644cc6f1c9b85859
2 changes: 1 addition & 1 deletion privacy/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
471b6c68ed2abe748c60f825ea56f0738c7d1ef8a1b5975efaddfcf2b48ca306
20b3bb27554ad772d23d790a1e656dbe1b20adaea52dd489863167514f1b5a9b
2 changes: 1 addition & 1 deletion processes/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f8a8745cbff637f6dc77b873da4f46a2bd1b8de7f52b863f5755a552ae6b2e92
7d8601f806d4fba20e43306cb610500f4bdb80b3f27cb7215a599bb22068d85c
2 changes: 1 addition & 1 deletion processes/pictures/answering.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8e17666c4f962768365ebbaf96b043ca18cb5cda615956e58d2ccf92b85e29c8
610f6047458f5666d89656f0b4825a9a46b7d63a44059764cbd3495df41214b5
2 changes: 1 addition & 1 deletion processes/pictures/deciding.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f082b9822bc98b32c85a24b80b1abf8192e79964966836b3b03b116dd6876279
ea88132bfcfa25ccaf4729eaf232c7f86cbf82c31b63f04017e9153b8b384e38
2 changes: 1 addition & 1 deletion processes/pictures/delivery.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
029de1830614f38a16f00e9ce52a8876f39836588a52bbbf3013179e0e1afe95
5f49f4463780bbd940150c920fe58fc935ed47302af5626b37c0eba02ebcd828
2 changes: 1 addition & 1 deletion processes/pictures/narrating.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b7e0988567cb173727627435c994b28896c9d4c95939b439382f30ce946ed7e3
1b6f46e68be95db285db4c7d00a9dbc160259c6f75d7456d21a213c0db7e650b
2 changes: 1 addition & 1 deletion surfaces/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
01d3d7e3b8c6fd4ad085e12b7bae97c2c6eaa6af0806b4106c059b8580ce12a6
c88d00c0eca40199036c7da1fde41b2b6d26c6696dba7d19c3443099d71d3df7
2 changes: 1 addition & 1 deletion talks/deciding-well/cost/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
41196ec7d5528987e7ca37f4b1677d866bd304344486e4bd32be1fdfe314a9c5
9c54e6176b0d8ed14427aa52a74e26cbf520b5d6c76a6a5a0b582b49e42faec5
2 changes: 1 addition & 1 deletion talks/deciding-well/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
78c6d37125e90157986d31b509cb07477df5ae29f35ed35e843220aa589ffc44
4b191eb1d05cf138d50d77adfe902f4a748affce2d34165aa95e1637a693160e
2 changes: 1 addition & 1 deletion talks/essential-complexity/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2ca758a02320e72f0384e5e39e120f6a2f7d333d304b3312e017bdc932ab6979
79ebef26252b28f0d681260f2dfeb736c71a6b55c813d63b69aa823bade18dd8
2 changes: 1 addition & 1 deletion talks/mental-model/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c5c0be93b8404235133c6b86a5b2c2a813f7a45e46f15311ba4458644108119e
a8fca3758f3e383dbb29568baf20361917fe1c1693b9264e9a2dacc32fa4b23c
2 changes: 1 addition & 1 deletion talks/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
43e125a2cc0ae977351dfc53da248ad8175a60fe44fc98cce9412b0e1855476d
a851c464e729c6ae8dee4d6dad2127a13e360e55064d20c12190d3106990a488
2 changes: 1 addition & 1 deletion timeline/og.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
db3dd1fc016584be02c02034f1cdd5b0e6ca963d92681f61626365c348fe5b00
872230cd0fe4dc13393ab1b596982f85247da606c8f68f11eb1f7e334ea10729
Loading