@abide/abide 0.118.0 → 0.120.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/CHANGELOG.md +17 -0
- package/bin/abide.ts +74 -11
- package/docs/REGISTRY.md +5 -4
- package/docs/RULEBOOK.md +35 -0
- package/docs/abide.md +363 -127
- package/package.json +1 -1
- package/scaffold/src/getGreeting.test.ts +1 -0
- package/scaffold/src/index.abide +4 -1
- package/scaffold/src/index.test.ts +2 -0
- package/scaffold/src/layout.abide +6 -6
- package/src/compiler/Lowering.ts +20 -2
- package/src/compiler/PositionTable.ts +1 -0
- package/src/compiler/Refusals.ts +1 -0
- package/src/compiler/TypeSession.ts +11 -8
- package/src/compiler/aliasedSymbol.ts +1 -1
- package/src/compiler/ambientReadsIn.ts +1 -0
- package/src/compiler/appLayout.ts +4 -2
- package/src/compiler/argsDefaultsIn.ts +1 -0
- package/src/compiler/argsSchemaOf.ts +1 -0
- package/src/compiler/checkApp.ts +3 -1
- package/src/compiler/checkedShadow.ts +2 -1
- package/src/compiler/classifyRead.ts +1 -0
- package/src/compiler/classifyTemplate.ts +1 -0
- package/src/compiler/compileApp.ts +4 -2
- package/src/compiler/compiledEntry.ts +1 -0
- package/src/compiler/componentGraph.ts +1 -0
- package/src/compiler/declaredExports.ts +4 -2
- package/src/compiler/emitClient.ts +19 -14
- package/src/compiler/emitComponent.ts +1 -0
- package/src/compiler/emitSource.ts +2 -1
- package/src/compiler/formatAbide.ts +857 -0
- package/src/compiler/formatDiagnosis.ts +1 -0
- package/src/compiler/handlersUnder.ts +2 -1
- package/src/compiler/hookCalls.ts +1 -0
- package/src/compiler/lineOf.ts +17 -0
- package/src/compiler/matchersOf.ts +13 -3
- package/src/compiler/mountsOf.ts +2 -0
- package/src/compiler/paramFile.ts +1 -0
- package/src/compiler/parseAbide.ts +48 -28
- package/src/compiler/projectShadow.ts +10 -3
- package/src/compiler/reactiveOptions.ts +1 -0
- package/src/compiler/reactiveTypes.ts +2 -1
- package/src/compiler/readsIn.ts +3 -2
- package/src/compiler/renderMarkup.ts +3 -2
- package/src/compiler/resolverIn.ts +2 -0
- package/src/compiler/sameTemplate.ts +150 -0
- package/src/compiler/scaffold.ts +4 -11
- package/src/compiler/serveLanguage.ts +46 -19
- package/src/compiler/sharedModuleWrites.ts +2 -1
- package/src/compiler/sourceMapOf.ts +1 -0
- package/src/compiler/splitImports.ts +2 -0
- package/src/compiler/templateWarnings.ts +2 -2
- package/src/compiler/trackingWarnings.ts +1 -0
- package/src/compiler/writeDefaultProject.ts +5 -1
- package/src/server/BRIDGE_SCHEME.ts +3 -0
- package/src/server/BRIDGE_VERSION.ts +1 -1
- package/src/server/abideModules.ts +2 -0
- package/src/server/answerFailure.ts +1 -0
- package/src/server/answerRequest.ts +15 -14
- package/src/server/answerRpc.ts +3 -2
- package/src/server/answerSocket.ts +2 -1
- package/src/server/answerValue.ts +1 -0
- package/src/server/answerWorker.ts +1 -0
- package/src/server/appTree.ts +3 -1
- package/src/server/argsFor.ts +1 -0
- package/src/server/assistant.ts +2 -1
- package/src/server/banner.ts +2 -0
- package/src/server/bridgeRelay.ts +1 -0
- package/src/server/callerOf.ts +1 -0
- package/src/server/claudeApi.ts +1 -0
- package/src/server/claudeCode.ts +30 -14
- package/src/server/clientBundle.ts +1 -0
- package/src/server/coerceArgs.ts +1 -2
- package/src/server/commands.ts +9 -0
- package/src/server/compressAnswer.ts +2 -1
- package/src/server/config.ts +2 -0
- package/src/server/createApp.ts +4 -2
- package/src/server/crossingOrigin.ts +1 -0
- package/src/server/csp.ts +1 -0
- package/src/server/deferredBuilds.ts +1 -0
- package/src/server/derivedArgs.ts +1 -0
- package/src/server/devWorker.ts +2 -1
- package/src/server/faceOf.ts +2 -7
- package/src/server/generatedSurfaces.ts +5 -1
- package/src/server/hooks.ts +1 -0
- package/src/server/iconAccent.ts +1 -1
- package/src/server/installServer.ts +1 -0
- package/src/server/installSourceMaps.ts +1 -0
- package/src/server/launcherPage.ts +2 -2
- package/src/server/manifestOf.ts +1 -0
- package/src/server/muxUpgrade.ts +1 -0
- package/src/server/nativeMenu.ts +2 -0
- package/src/server/principal.ts +2 -1
- package/src/server/remote.ts +1 -0
- package/src/server/render.ts +3 -3
- package/src/server/renderComponent.ts +1 -0
- package/src/server/reportHealth.ts +1 -0
- package/src/server/requestScope.ts +3 -1
- package/src/server/runDesktop.ts +3 -2
- package/src/server/seedBuffer.ts +1 -0
- package/src/server/serveDev.ts +3 -2
- package/src/server/shell.ts +2 -0
- package/src/server/streamEvent.ts +1 -0
- package/src/server/surfaceOf.ts +1 -0
- package/src/server/testBuild.ts +1 -0
- package/src/server/testMount.ts +1 -0
- package/src/server/trace.ts +2 -0
- package/src/server/withAbideSources.ts +1 -0
- package/src/shared/Attributes.ts +12 -8
- package/src/shared/cookies.ts +1 -1
- package/src/shared/escapeText.ts +1 -1
- package/src/shared/index.ts +1 -5
- package/src/shared/jsonSchema.ts +1 -3
- package/src/shared/menuBridge.ts +1 -2
- package/src/shared/outbox.ts +1 -1
- package/src/shared/reactive/Keyed.ts +2 -2
- package/src/shared/reactive/Reactive.ts +12 -16
- package/src/shared/reactive/index.ts +3 -4
- package/src/shared/reactive/isReactive.ts +1 -1
- package/src/shared/reactive/scoped.ts +2 -2
- package/src/shared/reactive/share.ts +1 -1
- package/src/shared/reactive/watch.ts +4 -4
- package/src/shared/refuse.ts +1 -1
- package/src/shared/rpc.ts +8 -11
- package/src/shared/url.ts +1 -1
- package/src/shared/validateJson.ts +1 -1
- package/src/ui/ArmRegion.ts +1 -0
- package/src/ui/Level.ts +1 -0
- package/src/ui/List.ts +1 -0
- package/src/ui/RawRun.ts +1 -0
- package/src/ui/Router.ts +1 -0
- package/src/ui/TryRegion.ts +1 -0
- package/src/ui/adoptWalk.ts +2 -1
- package/src/ui/bindElement.ts +1 -0
- package/src/ui/bindFiles.ts +1 -0
- package/src/ui/bindGroup.ts +1 -0
- package/src/ui/bindProperty.ts +1 -0
- package/src/ui/bindSpread.ts +1 -0
- package/src/ui/index.ts +1 -6
- package/src/ui/outboxQueue.ts +1 -1
- package/src/ui/parseMarkup.ts +2 -1
- package/src/ui/reconcile.ts +2 -1
- package/src/ui/reconcileHead.ts +1 -0
- package/src/ui/regions.ts +2 -1
- package/src/ui/registerWorker.ts +1 -0
- package/src/ui/rows.ts +1 -0
- package/src/ui/setMarkup.ts +1 -0
- package/src/ui/setText.ts +1 -0
- package/src/ui/socketWire.ts +4 -3
- package/src/ui/wire.ts +2 -1
package/src/server/createApp.ts
CHANGED
|
@@ -5,17 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
import { existsSync } from 'node:fs' // bun exposes no sync existence check of its own
|
|
7
7
|
import { resolve } from 'node:path' // bun exposes no path helpers of its own
|
|
8
|
+
|
|
8
9
|
import { FAILURE_STATUS_TEXT } from '#shared/FAILURE_STATUS_TEXT.ts'
|
|
9
10
|
import { framingOf } from '#shared/framing.ts'
|
|
10
11
|
import { IN_PROCESS_ORIGIN } from '#shared/IN_PROCESS_ORIGIN.ts'
|
|
11
|
-
import { LONGEST_DELAY } from '#shared/LONGEST_DELAY.ts'
|
|
12
12
|
import { namedLogger } from '#shared/log.ts'
|
|
13
|
+
import { LONGEST_DELAY } from '#shared/LONGEST_DELAY.ts'
|
|
13
14
|
import { compose } from '#shared/Middleware.ts'
|
|
14
15
|
import { MOUNT, unmounted } from '#shared/mount.ts'
|
|
15
16
|
import { PRINCIPAL_HEADER } from '#shared/PRINCIPAL_HEADER.ts'
|
|
16
17
|
import { RPC_SERVER } from '#shared/RPC_SERVER.ts'
|
|
18
|
+
|
|
17
19
|
import { servedTable } from './abideModules.ts'
|
|
18
|
-
import { type AppSources
|
|
20
|
+
import { answerRequest, type AppSources } from './answerRequest.ts'
|
|
19
21
|
import type { Mount } from './answerRpc.ts'
|
|
20
22
|
import { Mux, type MuxConnection } from './answerSocket.ts'
|
|
21
23
|
import { appDirectories } from './appDirectories.ts'
|
package/src/server/csp.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// rung writing a document's header — so the two agree, and an answer that is not a document mints none.
|
|
7
7
|
|
|
8
8
|
import type { Middleware } from '#shared/Middleware.ts'
|
|
9
|
+
|
|
9
10
|
import { randomToken } from './randomToken.ts'
|
|
10
11
|
import { EARLY_CALL_HASH } from './render.ts'
|
|
11
12
|
import { within } from './requestScope.ts'
|
|
@@ -3,6 +3,7 @@ import type { JsonValue } from '#shared/JsonValue.ts'
|
|
|
3
3
|
import type { Gated } from '#shared/reactive/argsContract.ts'
|
|
4
4
|
import type { HeldToAnnotation } from '#shared/rpc.ts'
|
|
5
5
|
import { validateJson } from '#shared/validateJson.ts'
|
|
6
|
+
|
|
6
7
|
import { argsDocumentOf } from './coerceArgs.ts'
|
|
7
8
|
|
|
8
9
|
/**
|
package/src/server/devWorker.ts
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
import { DEV_ADDRESS } from '#shared/ADDRESSES.ts'
|
|
22
22
|
import { escapeText } from '#shared/escapeText.ts'
|
|
23
|
+
|
|
23
24
|
import {
|
|
24
25
|
type Compilation,
|
|
25
26
|
serveCompilation,
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
clientBundle,
|
|
35
36
|
type ServedFile,
|
|
36
37
|
} from './clientBundle.ts'
|
|
37
|
-
import { type BootedApp,
|
|
38
|
+
import { bootApp, type BootedApp, originUnder } from './createApp.ts'
|
|
38
39
|
import { keepServing } from './faultPolicy.ts'
|
|
39
40
|
import { type Manifest, NO_MANIFEST } from './manifestOf.ts'
|
|
40
41
|
import { admitsMux, muxSocketOptions } from './muxUpgrade.ts'
|
package/src/server/faceOf.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// specifier, an `onLoad` for a path), and this decides what the answer is.
|
|
5
5
|
|
|
6
6
|
import type { JsonValue } from '#shared/JsonValue.ts'
|
|
7
|
+
|
|
7
8
|
import { HANDLER_SUFFIX, SERVER_QUERY } from './MODULE_QUERIES.ts'
|
|
8
9
|
|
|
9
10
|
// A VIRTUAL FACE'S PATH: its file's, with a suffix that is not a query. Both registries key a module
|
|
@@ -38,13 +39,7 @@ export type Face = { path: string; namespace: string }
|
|
|
38
39
|
* module (`?server`), a `.abide` named bare, or a module that may be a handler file.
|
|
39
40
|
*/
|
|
40
41
|
export type Asked =
|
|
41
|
-
| '
|
|
42
|
-
| 'style'
|
|
43
|
-
| 'component'
|
|
44
|
-
| 'client'
|
|
45
|
-
| 'server'
|
|
46
|
-
| 'abide'
|
|
47
|
-
| 'handler'
|
|
42
|
+
'text' | 'style' | 'component' | 'client' | 'server' | 'abide' | 'handler'
|
|
48
43
|
|
|
49
44
|
/**
|
|
50
45
|
* One handler file, as `Compilation.handlers` holds it — and 19.9's schema its default's annotation
|
|
@@ -20,6 +20,7 @@ import { mounted } from '#shared/mount.ts'
|
|
|
20
20
|
import { type Reactive, reactive } from '#shared/reactive/index.ts'
|
|
21
21
|
import { parseRoutePattern, type Segment } from '#shared/routePattern.ts'
|
|
22
22
|
import { argsInURL, rpcRequest } from '#shared/rpcRequest.ts'
|
|
23
|
+
|
|
23
24
|
import { answered } from './answerFailure.ts'
|
|
24
25
|
import { bodyWithin, type Mounted } from './answerRpc.ts'
|
|
25
26
|
import type { ToolAnswer, ToolDefinition } from './assistant.ts'
|
|
@@ -146,7 +147,10 @@ function openApiOf(handlers: Map<string, Mounted>): {
|
|
|
146
147
|
schema:
|
|
147
148
|
segment.kind === 'rest'
|
|
148
149
|
? declared
|
|
149
|
-
: patterned(
|
|
150
|
+
: patterned(
|
|
151
|
+
declared,
|
|
152
|
+
patternOf(segment, each.matchers),
|
|
153
|
+
),
|
|
150
154
|
}
|
|
151
155
|
if (segment.kind === 'optional')
|
|
152
156
|
parameter.description = 'May be left out, with its segment.'
|
package/src/server/hooks.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
type Segment,
|
|
22
22
|
} from '#shared/routePattern.ts'
|
|
23
23
|
import type { Schema } from '#shared/Schema.ts'
|
|
24
|
+
|
|
24
25
|
import { config } from './config.ts'
|
|
25
26
|
import type { LauncherOptions } from './launcherOptions.ts'
|
|
26
27
|
import { currentRequestScope } from './requestScope.ts'
|
package/src/server/iconAccent.ts
CHANGED
|
@@ -82,7 +82,7 @@ function decoded(
|
|
|
82
82
|
let channels = 0
|
|
83
83
|
const compressed: Uint8Array[] = []
|
|
84
84
|
let length = 0
|
|
85
|
-
for (let at = 8; at + 8 <= png.length;
|
|
85
|
+
for (let at = 8; at + 8 <= png.length;) {
|
|
86
86
|
const size = view.getUint32(at)
|
|
87
87
|
const type = String.fromCharCode(...png.subarray(at + 4, at + 8))
|
|
88
88
|
const body = png.subarray(at + 8, at + 8 + size)
|
|
@@ -14,6 +14,7 @@ import { MOUNT } from '#shared/mount.ts'
|
|
|
14
14
|
import { PRINCIPAL } from '#shared/principal.ts'
|
|
15
15
|
import { RPC_SERVER } from '#shared/RPC_SERVER.ts'
|
|
16
16
|
import { UNEXPECTED } from '#shared/UNEXPECTED.ts'
|
|
17
|
+
|
|
17
18
|
import { reachedInRender } from './answerRequest.ts'
|
|
18
19
|
import { environmentTimeout } from './answerRpc.ts'
|
|
19
20
|
import { broadcast, feedFromServed, swept } from './answerSocket.ts'
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// rebuild, and a test boots several apps in one process.
|
|
8
8
|
|
|
9
9
|
import { resolve } from 'node:path' // bun exposes no path helpers of its own
|
|
10
|
+
|
|
10
11
|
import { HANDLER_FACE } from './MODULE_QUERIES.ts'
|
|
11
12
|
import { decodeMappings, placeAt, type Segment } from './sourceMappings.ts'
|
|
12
13
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// asks something first, so a Start with no configuration to ask for has none and starts at once.
|
|
8
8
|
|
|
9
9
|
import { escapeAttribute, escapeText } from '#shared/escapeText.ts'
|
|
10
|
+
|
|
10
11
|
import type { ConfigField } from './configFields.ts'
|
|
11
12
|
import { inkOn } from './iconAccent.ts'
|
|
12
13
|
|
|
@@ -77,8 +78,7 @@ export function launcherPage(page: Launch): string {
|
|
|
77
78
|
// field shows them.
|
|
78
79
|
const failureLine = (
|
|
79
80
|
failure:
|
|
80
|
-
|
|
81
|
-
| undefined,
|
|
81
|
+
{ message: string; issues: Record<string, string[]> } | undefined,
|
|
82
82
|
): string => {
|
|
83
83
|
if (failure === undefined) return ''
|
|
84
84
|
let line = `<p class="failure" role="alert">${escapeText(failure.message)}</p>`
|
package/src/server/manifestOf.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// a preload of the same address is a second request line for bytes already on their way.
|
|
17
17
|
|
|
18
18
|
import { resolve } from 'node:path' // bun exposes no path helpers of its own
|
|
19
|
+
|
|
19
20
|
import { CLIENT_ENTRY } from './CLIENT_BUILD.ts'
|
|
20
21
|
import { VIRTUAL_DIRECTORY } from './VIRTUAL_DIRECTORY.ts'
|
|
21
22
|
|
package/src/server/muxUpgrade.ts
CHANGED
package/src/server/nativeMenu.ts
CHANGED
package/src/server/principal.ts
CHANGED
|
@@ -9,14 +9,15 @@ import { cookies } from '#shared/cookies.ts'
|
|
|
9
9
|
import { isFailed } from '#shared/Failed.ts'
|
|
10
10
|
import { isRecord } from '#shared/isRecord.ts'
|
|
11
11
|
import { namedLogger } from '#shared/log.ts'
|
|
12
|
-
import { PRINCIPAL_HEADER } from '#shared/PRINCIPAL_HEADER.ts'
|
|
13
12
|
import {
|
|
14
13
|
type PRINCIPAL,
|
|
15
14
|
type Principal,
|
|
16
15
|
principalMembers,
|
|
17
16
|
} from '#shared/principal.ts'
|
|
17
|
+
import { PRINCIPAL_HEADER } from '#shared/PRINCIPAL_HEADER.ts'
|
|
18
18
|
import { refuse } from '#shared/refuse.ts'
|
|
19
19
|
import { declare } from '#shared/rpc.ts'
|
|
20
|
+
|
|
20
21
|
import { mountedOwn } from './answerRpc.ts'
|
|
21
22
|
import { signedInAt } from './bridgeRelay.ts'
|
|
22
23
|
import { callerOf, callerOrMint, mintCaller } from './callerOf.ts'
|
package/src/server/remote.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { PatchOp } from '#shared/reactive/PATCH_SINKS.ts'
|
|
|
11
11
|
import { rankRoutes } from '#shared/routePattern.ts'
|
|
12
12
|
import type { Method } from '#shared/rpc.ts'
|
|
13
13
|
import { argsInURL, rpcRequest } from '#shared/rpcRequest.ts'
|
|
14
|
+
|
|
14
15
|
import type { Mount } from './answerRpc.ts'
|
|
15
16
|
import { DEFAULT_PORT } from './DEFAULT_PORT.ts'
|
|
16
17
|
import { withoutTrailingSlash } from './withoutTrailingSlash.ts'
|
package/src/server/render.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { headKeyOf } from '#shared/headKeyOf.ts'
|
|
|
9
9
|
import { isThenable } from '#shared/reactive/isThenable.ts'
|
|
10
10
|
import type { ShareScope } from '#shared/reactive/share.ts'
|
|
11
11
|
import { setUpLevels } from '#shared/setUpLevels.ts'
|
|
12
|
+
|
|
12
13
|
import { buildDeferred, markPainted } from './deferredBuilds.ts'
|
|
13
14
|
import { currentRequestScope, type PageCall } from './requestScope.ts'
|
|
14
15
|
|
|
@@ -23,7 +24,7 @@ import { currentRequestScope, type PageCall } from './requestScope.ts'
|
|
|
23
24
|
* satisfy the linter would put the code and the registry row out of step, which is the drift
|
|
24
25
|
* the documents exist to stop.
|
|
25
26
|
*/
|
|
26
|
-
//
|
|
27
|
+
// REGISTRY declares `interface Component {}`.
|
|
27
28
|
export interface Component {}
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -364,8 +365,7 @@ export async function renderDocument(
|
|
|
364
365
|
*/
|
|
365
366
|
function earlyCallScript(calls: PageCall[]): string {
|
|
366
367
|
const rows: (
|
|
367
|
-
| [string, string, RequestInit]
|
|
368
|
-
| [string, string, RequestInit, 1]
|
|
368
|
+
[string, string, RequestInit] | [string, string, RequestInit, 1]
|
|
369
369
|
)[] = []
|
|
370
370
|
for (const { request, painted } of calls)
|
|
371
371
|
rows.push(
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type { Health } from '#shared/health.ts'
|
|
8
8
|
import { isRecord } from '#shared/isRecord.ts'
|
|
9
9
|
import { namedLogger } from '#shared/log.ts'
|
|
10
|
+
|
|
10
11
|
import abidePackage from '../../package.json' with { type: 'json' }
|
|
11
12
|
import { appIdentity, config } from './config.ts'
|
|
12
13
|
import { HOOKS, inOrder } from './hooks.ts'
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
// values forwarders rather than process-wide.
|
|
11
11
|
|
|
12
12
|
import { AsyncLocalStorage } from 'node:async_hooks' // bun implements AsyncLocalStorage and has no context-carrying api of its own
|
|
13
|
+
|
|
13
14
|
import { Cookies } from '#shared/cookies.ts'
|
|
14
15
|
import type { Framed } from '#shared/framing.ts'
|
|
15
16
|
import type { Params } from '#shared/matchRoute.ts'
|
|
16
17
|
import type { Principal } from '#shared/principal.ts'
|
|
17
|
-
import {
|
|
18
|
+
import { type Scope, SCOPING } from '#shared/reactive/scoping.ts'
|
|
18
19
|
import type { RpcRequest } from '#shared/rpcRequest.ts'
|
|
20
|
+
|
|
19
21
|
import type { McpSurface } from './generatedSurfaces.ts'
|
|
20
22
|
import { IDLE_TIMEOUT_SECONDS } from './IDLE_TIMEOUT_SECONDS.ts'
|
|
21
23
|
|
package/src/server/runDesktop.ts
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import { FFIType } from 'bun:ffi'
|
|
10
10
|
import { mkdir } from 'node:fs/promises' // bun exposes no directory creation of its own
|
|
11
|
+
|
|
11
12
|
import { isFailed } from '#shared/Failed.ts'
|
|
13
|
+
|
|
12
14
|
import {
|
|
13
15
|
callBlock,
|
|
14
16
|
created,
|
|
@@ -54,8 +56,7 @@ type Failure = {
|
|
|
54
56
|
export type Desktop = {
|
|
55
57
|
/** 38.82 — `src/launcher.abide`'s page, where the app has one that paints. */
|
|
56
58
|
launch:
|
|
57
|
-
|
|
58
|
-
| undefined
|
|
59
|
+
(() => Promise<{ default: (props: Launch) => Component }>) | undefined
|
|
59
60
|
/** The document the launch page renders into, its stylesheet already in its head (38.84). */
|
|
60
61
|
document: string
|
|
61
62
|
/** 38.101 — the app's icon as a data URL, and the accent taken from it. */
|
package/src/server/seedBuffer.ts
CHANGED
package/src/server/serveDev.ts
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
import { watch } from 'node:fs' // bun exposes no file watcher of its own
|
|
22
22
|
import { dirname, resolve } from 'node:path' // bun exposes no path helpers of its own
|
|
23
|
+
|
|
23
24
|
import {
|
|
24
25
|
type AppChecker,
|
|
25
26
|
compilationOf,
|
|
@@ -28,6 +29,7 @@ import {
|
|
|
28
29
|
} from '#compiler/compileApp.ts'
|
|
29
30
|
import { formatDiagnosis } from '#compiler/formatDiagnosis.ts'
|
|
30
31
|
import { DEV_ADDRESS } from '#shared/ADDRESSES.ts'
|
|
32
|
+
|
|
31
33
|
import type { Compilation } from './abideModules.ts'
|
|
32
34
|
import { DEFAULT_PORT } from './DEFAULT_PORT.ts'
|
|
33
35
|
import type { FromWorker, ToWorker } from './devWorker.ts'
|
|
@@ -66,8 +68,7 @@ const LAST_DEV_PORT = 3099
|
|
|
66
68
|
// An app-mux socket's data: the id the worker knows its connection by, and what `Mux.connect` reads
|
|
67
69
|
// off the upgrade. `undefined` on the reload client's.
|
|
68
70
|
type Carried =
|
|
69
|
-
|
|
70
|
-
| undefined
|
|
71
|
+
{ connection: number; url: string; headers: [string, string][] } | undefined
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* `abide dev`'s listener, compiling the app here and serving it from a child process.
|
package/src/server/shell.ts
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
// is the only part that needs a terminal. A call goes over http through `remote.ts`, as any client's.
|
|
5
5
|
|
|
6
6
|
import { createInterface } from 'node:readline' // bun exposes no line editor of its own
|
|
7
|
+
|
|
7
8
|
import { isRecord } from '#shared/isRecord.ts'
|
|
8
9
|
import { useColor } from '#shared/log.ts'
|
|
9
10
|
import { paint as painted } from '#shared/paint.ts'
|
|
11
|
+
|
|
10
12
|
import type { Mount } from './answerRpc.ts'
|
|
11
13
|
import { LogPanel } from './LogPanel.ts'
|
|
12
14
|
import { callHandler, watch } from './remote.ts'
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import type { Problem } from '#shared/Failed.ts'
|
|
6
6
|
import type { Framed } from '#shared/framing.ts'
|
|
7
7
|
import { REFUSAL_KEY } from '#shared/REFUSAL_KEY.ts'
|
|
8
|
+
|
|
8
9
|
import { HEARTBEAT_MILLISECONDS } from './HEARTBEAT_MILLISECONDS.ts'
|
|
9
10
|
|
|
10
11
|
/** AN EVENT STREAM OPENS ON A COMMENT, so a proxy has bytes to pass before the first event. */
|
package/src/server/surfaceOf.ts
CHANGED
package/src/server/testBuild.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { mkdir, rename, rm, utimes, writeFile } from 'node:fs/promises' // bun exposes no directory creation, rename, removal, mtime write or exclusive create of its own
|
|
8
8
|
import { dirname } from 'node:path' // bun exposes no path helpers of its own
|
|
9
|
+
|
|
9
10
|
import { namesUnder } from './namesUnder.ts'
|
|
10
11
|
import { runBuild } from './runBuild.ts'
|
|
11
12
|
|
package/src/server/testMount.ts
CHANGED
package/src/server/trace.ts
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
// (24.5) while a sibling running concurrently names its own.
|
|
8
8
|
|
|
9
9
|
import { AsyncLocalStorage } from 'node:async_hooks' // bun implements AsyncLocalStorage and has no context-carrying api of its own
|
|
10
|
+
|
|
10
11
|
import { writeSpan } from '#shared/log.ts'
|
|
12
|
+
|
|
11
13
|
import { randomToken } from './randomToken.ts'
|
|
12
14
|
import {
|
|
13
15
|
currentRequestScope,
|
package/src/shared/Attributes.ts
CHANGED
|
@@ -47,11 +47,13 @@ type Reflected<Element> = {
|
|
|
47
47
|
|
|
48
48
|
/** `Element`'s keys without its index signatures. */
|
|
49
49
|
type Named<Element> = keyof {
|
|
50
|
-
[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
[
|
|
51
|
+
Key in keyof Element as string extends Key
|
|
52
|
+
? never
|
|
53
|
+
: number extends Key
|
|
54
|
+
? never
|
|
55
|
+
: Key
|
|
56
|
+
]: Element[Key]
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/** The properties whose attribute is not their name lowercased. */
|
|
@@ -119,9 +121,11 @@ export type Attributes<
|
|
|
119
121
|
|
|
120
122
|
/** An HTML element's attributes, derived from what its DOM type reflects. */
|
|
121
123
|
type HtmlAttributes<Tag extends keyof HTMLElementTagNameMap> = {
|
|
122
|
-
[
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
[
|
|
125
|
+
Key in Reflected<
|
|
126
|
+
HTMLElementTagNameMap[Tag]
|
|
127
|
+
> as Key extends `on${string}` ? never : AttributeName<Key>
|
|
128
|
+
]?: Written<
|
|
125
129
|
AttributeName<Key>,
|
|
126
130
|
NonNullable<HTMLElementTagNameMap[Tag][Key]>
|
|
127
131
|
> | null
|
package/src/shared/cookies.ts
CHANGED
|
@@ -238,7 +238,7 @@ export function browserCookies(): Cookies {
|
|
|
238
238
|
const jar = new Cookies(
|
|
239
239
|
document.cookie,
|
|
240
240
|
(serialized) => {
|
|
241
|
-
//
|
|
241
|
+
// The Cookie Store API is asynchronous and missing from some browsers, and a read of the jar is synchronous.
|
|
242
242
|
document.cookie = serialized
|
|
243
243
|
},
|
|
244
244
|
true,
|
package/src/shared/escapeText.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// `escapeless` in #ui is that path, and the two sitting apart is what keeps them from being
|
|
5
5
|
// confused for one another.
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Raw, RAW_WRITES, textOf } from './Raw.ts'
|
|
8
8
|
|
|
9
9
|
// The common slot holds nothing to escape, so the scan is the fast path and the rewrite is
|
|
10
10
|
// the fallback: a clean string is returned as it arrived, with no allocation.
|
package/src/shared/index.ts
CHANGED
|
@@ -23,11 +23,7 @@ export {
|
|
|
23
23
|
} from './boundValue.ts'
|
|
24
24
|
export { type Cookies, cookies } from './cookies.ts'
|
|
25
25
|
export { csp } from './csp.ts'
|
|
26
|
-
export {
|
|
27
|
-
escapeAttribute,
|
|
28
|
-
escapeStyleValue,
|
|
29
|
-
escapeText,
|
|
30
|
-
} from './escapeText.ts'
|
|
26
|
+
export { escapeAttribute, escapeStyleValue, escapeText } from './escapeText.ts'
|
|
31
27
|
export { type Failed, isFailed } from './Failed.ts'
|
|
32
28
|
// 25 — the account of the app.
|
|
33
29
|
export { type Health, health } from './health.ts'
|
package/src/shared/jsonSchema.ts
CHANGED
|
@@ -31,9 +31,7 @@ export function jsonSchema<T = Untyped>(
|
|
|
31
31
|
vendor: 'abide',
|
|
32
32
|
validate(value: unknown) {
|
|
33
33
|
const found = validateJson(document, value) as
|
|
34
|
-
|
|
35
|
-
| string[]
|
|
36
|
-
| null
|
|
34
|
+
Record<string, string[]> | string[] | null
|
|
37
35
|
if (found === null) return { value: value as T }
|
|
38
36
|
const issues: { message: string; path: string[] }[] = []
|
|
39
37
|
// A value that is not an object came back as the bare list, every issue on `''`.
|
package/src/shared/menuBridge.ts
CHANGED
package/src/shared/outbox.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
import type { Failed } from './Failed.ts'
|
|
11
11
|
import type { JsonValue } from './JsonValue.ts'
|
|
12
|
+
import { OUTBOX_SENDING } from './OUTBOX_SENDING.ts'
|
|
12
13
|
import { ambient, type Reactive, type Selection } from './reactive/index.ts'
|
|
13
14
|
import { matchesPattern } from './reactive/matchesPattern.ts'
|
|
14
|
-
import { OUTBOX_SENDING } from './OUTBOX_SENDING.ts'
|
|
15
15
|
import type { Method } from './rpc.ts'
|
|
16
16
|
|
|
17
17
|
/** One call `outbox` holds: what it sends, when it was queued, how often it was sent, and its value. */
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
normalized,
|
|
16
16
|
PARAMETER_DEFAULTS,
|
|
17
17
|
} from './argsContract.ts'
|
|
18
|
-
import { CELL } from './CELL.ts'
|
|
19
18
|
import { canonicalKey } from './canonicalKey.ts'
|
|
19
|
+
import { CELL } from './CELL.ts'
|
|
20
20
|
import { ENTRY_LIVES } from './ENTRY_LIVES.ts'
|
|
21
21
|
import { armTimer } from './Expiry.ts'
|
|
22
22
|
import { KEYED_BRAND } from './KEYED_BRAND.ts'
|
|
@@ -43,8 +43,8 @@ import {
|
|
|
43
43
|
newSubscriber,
|
|
44
44
|
newTracked,
|
|
45
45
|
type Subscriber,
|
|
46
|
-
TRACKING,
|
|
47
46
|
type Tracked,
|
|
47
|
+
TRACKING,
|
|
48
48
|
trackProbe,
|
|
49
49
|
} from './tracking.ts'
|
|
50
50
|
import { owned, owning } from './watch.ts'
|
|
@@ -31,23 +31,23 @@ import { NotLanded } from './NotLanded.ts'
|
|
|
31
31
|
import { PATCH_SINKS, type PatchOp } from './PATCH_SINKS.ts'
|
|
32
32
|
import { REACTIVE_BRAND } from './REACTIVE_BRAND.ts'
|
|
33
33
|
import { recordWrites } from './recordWrites.ts'
|
|
34
|
-
import { STREAMING } from './STREAMING.ts'
|
|
35
34
|
import { currentScope, runInScope, type Scope } from './scoping.ts'
|
|
35
|
+
import { STREAMING } from './STREAMING.ts'
|
|
36
36
|
import {
|
|
37
37
|
CHECK,
|
|
38
38
|
CLEAN,
|
|
39
|
-
DIRTY,
|
|
40
39
|
detach,
|
|
40
|
+
DIRTY,
|
|
41
41
|
dropProbeReader,
|
|
42
42
|
newSubscriber,
|
|
43
43
|
newTracked,
|
|
44
44
|
RELEASING,
|
|
45
45
|
revive,
|
|
46
46
|
type Subscriber,
|
|
47
|
-
TRACKING,
|
|
48
|
-
type Tracked,
|
|
49
47
|
tombstone,
|
|
50
48
|
track,
|
|
49
|
+
type Tracked,
|
|
50
|
+
TRACKING,
|
|
51
51
|
trackProbe,
|
|
52
52
|
truncate,
|
|
53
53
|
truncateProbes,
|
|
@@ -252,12 +252,12 @@ export type Reactive<
|
|
|
252
252
|
| Accepted
|
|
253
253
|
| PromiseLike<Accepted>
|
|
254
254
|
| Reactive<Accepted, unknown, Failures, unknown>,
|
|
255
|
-
//
|
|
255
|
+
// Same reason as `watch` below — a `set` that returns nothing infers `void`, and 4.18's refusal is the other arm.
|
|
256
256
|
): void | Failures
|
|
257
257
|
patch(mutate: (value: Stored) => void): void
|
|
258
258
|
refresh(): void
|
|
259
259
|
invalidate(): void
|
|
260
|
-
//
|
|
260
|
+
// `void`, not `undefined`: see `Effect` in `watch.ts` — `(v) => { read(v) }` infers `void`.
|
|
261
261
|
watch(effect: (value: Stored) => void | (() => void)): () => void
|
|
262
262
|
/** What one run produced: the settled value once, or a stream's chunks to its close (2.5, 2.6). */
|
|
263
263
|
[Symbol.asyncIterator](): AsyncIterator<Produced>
|
|
@@ -658,8 +658,7 @@ class Cell {
|
|
|
658
658
|
* keyed on `.id` read every number as the same `undefined` and never woke again.
|
|
659
659
|
*/
|
|
660
660
|
declare declaredIdentityFn:
|
|
661
|
-
|
|
662
|
-
| null
|
|
661
|
+
((next: unknown, previous: unknown) => boolean) | null
|
|
663
662
|
declare transform: ((value: unknown) => unknown) | null
|
|
664
663
|
/**
|
|
665
664
|
* `null` on every value that declares no `schema`, which keeps the gate off the write
|
|
@@ -859,8 +858,7 @@ class Cell {
|
|
|
859
858
|
)
|
|
860
859
|
this.declaredIdentityFn = this.identityFn
|
|
861
860
|
this.transform = (options?.transform ?? null) as
|
|
862
|
-
|
|
863
|
-
| null
|
|
861
|
+
((value: unknown) => unknown) | null
|
|
864
862
|
this.schema = (options?.schema ?? null) as Schema<unknown> | null
|
|
865
863
|
this.ring = EMPTY_RING
|
|
866
864
|
this.ringBase = 0
|
|
@@ -906,9 +904,7 @@ class Cell {
|
|
|
906
904
|
unwatch: null,
|
|
907
905
|
}
|
|
908
906
|
this.by = (options?.by ?? null) as
|
|
909
|
-
|
|
|
910
|
-
| ((element: unknown) => unknown)
|
|
911
|
-
| null
|
|
907
|
+
string | ((element: unknown) => unknown) | null
|
|
912
908
|
this.probePass = 0
|
|
913
909
|
this.owes = OWES_NOTHING
|
|
914
910
|
this.isEffect = false
|
|
@@ -3502,7 +3498,7 @@ function settled(cell: Cell, untilStreaming = false): Promise<unknown> {
|
|
|
3502
3498
|
*/
|
|
3503
3499
|
function watchCell(
|
|
3504
3500
|
cell: Cell,
|
|
3505
|
-
//
|
|
3501
|
+
// `void`, not `undefined`: see `Effect` in `watch.ts`.
|
|
3506
3502
|
effect: (value: unknown) => void | (() => void),
|
|
3507
3503
|
): () => void {
|
|
3508
3504
|
return owned(
|
|
@@ -4459,7 +4455,7 @@ const MEMBERS = {
|
|
|
4459
4455
|
},
|
|
4460
4456
|
watch(
|
|
4461
4457
|
this: Callable,
|
|
4462
|
-
//
|
|
4458
|
+
// `void`, not `undefined`: see `Effect` in `watch.ts`.
|
|
4463
4459
|
effect: (value: unknown) => void | (() => void),
|
|
4464
4460
|
): () => void {
|
|
4465
4461
|
return watchCell(this[CELL], effect)
|
|
@@ -4467,7 +4463,7 @@ const MEMBERS = {
|
|
|
4467
4463
|
[Symbol.asyncIterator](this: Callable): AsyncIterator<unknown> {
|
|
4468
4464
|
return producedRun(this[CELL])
|
|
4469
4465
|
},
|
|
4470
|
-
//
|
|
4466
|
+
// RULEBOOK 1.4 — a `Reactive` MUST be thenable. Banning it buys a discrimination rather than a semantics, and 16.4's in-process `Rpc` arm is what that discrimination would have cost. 1.6 is the guard that makes thenability safe — the brand is read before `then`.
|
|
4471
4467
|
then(
|
|
4472
4468
|
this: Callable,
|
|
4473
4469
|
onSettled?: (value: unknown) => unknown,
|