@jam-overture/loom 0.2.0 → 0.3.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/dist/audience/compose.d.ts +112 -0
- package/dist/audience/compose.js +134 -0
- package/dist/audience/memory.d.ts +14 -0
- package/dist/audience/memory.js +71 -0
- package/dist/audience/overlay-store.d.ts +343 -0
- package/dist/audience/overlay-store.js +217 -0
- package/dist/audience/rule.d.ts +121 -0
- package/dist/audience/rule.js +78 -0
- package/dist/cli/index.d.ts +3 -4
- package/dist/cli/index.js +3 -4
- package/dist/data/adapter.d.ts +9 -1
- package/dist/data/adapter.js +2 -0
- package/dist/data/resolve.d.ts +1 -1
- package/dist/interpretation/anthropic.d.ts +1 -1
- package/dist/interpretation/anthropic.js +2 -22
- package/dist/interpretation/client.d.ts +1 -1
- package/dist/interpretation/materialize.js +67 -22
- package/dist/interpretation/openai-compatible.d.ts +36 -0
- package/dist/interpretation/openai-compatible.js +79 -0
- package/dist/interpretation/status.d.ts +19 -0
- package/dist/interpretation/status.js +26 -0
- package/dist/live/index.d.ts +73 -0
- package/dist/live/index.js +73 -0
- package/dist/live/pages.d.ts +187 -0
- package/dist/live/pages.js +161 -0
- package/dist/live/pull.d.ts +147 -0
- package/dist/live/pull.js +398 -0
- package/dist/live/pulling.d.ts +79 -0
- package/dist/live/pulling.js +117 -0
- package/dist/live/window.d.ts +129 -0
- package/dist/live/window.js +132 -0
- package/dist/render/addressed.d.ts +35 -0
- package/dist/render/addressed.js +79 -0
- package/dist/render/document-theme.d.ts +70 -0
- package/dist/render/document-theme.js +139 -0
- package/dist/render/editable.d.ts +15 -1
- package/dist/render/editable.js +13 -1
- package/dist/render/expected.d.ts +98 -0
- package/dist/render/expected.js +88 -0
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.js +2 -0
- package/dist/render/render.d.ts +11 -0
- package/dist/render/render.js +192 -46
- package/dist/render/request.d.ts +8 -1
- package/dist/render/request.js +1 -0
- package/dist/runtime/auto-apply-ceiling.d.ts +54 -0
- package/dist/runtime/auto-apply-ceiling.js +66 -0
- package/dist/runtime/gate.js +69 -10
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/nesting.d.ts +13 -1
- package/dist/runtime/nesting.js +41 -24
- package/dist/runtime/policy-change.js +8 -2
- package/dist/runtime/policy-log.d.ts +5 -5
- package/dist/runtime/policy.d.ts +8 -6
- package/dist/runtime/policy.js +5 -2
- package/dist/runtime/repointing.js +0 -0
- package/dist/sdk/definition.d.ts +65 -6
- package/dist/sdk/definition.js +44 -0
- package/dist/sdk/registry.d.ts +17 -1
- package/dist/sdk/registry.js +39 -0
- package/dist/signals/acted.contract.d.ts +21 -0
- package/dist/signals/acted.contract.js +236 -0
- package/dist/signals/acted.d.ts +359 -0
- package/dist/signals/acted.js +135 -0
- package/dist/signals/agenda.d.ts +585 -0
- package/dist/signals/agenda.js +295 -0
- package/dist/signals/arrivals.contract.d.ts +21 -0
- package/dist/signals/arrivals.contract.js +180 -0
- package/dist/signals/arrivals.d.ts +375 -0
- package/dist/signals/arrivals.js +254 -0
- package/dist/signals/broadcast.d.ts +25 -15
- package/dist/signals/broadcast.js +209 -36
- package/dist/signals/collect.d.ts +137 -43
- package/dist/signals/collect.js +103 -36
- package/dist/signals/conversion.d.ts +348 -0
- package/dist/signals/conversion.js +235 -0
- package/dist/signals/correlated.contract.d.ts +24 -0
- package/dist/signals/correlated.contract.js +94 -0
- package/dist/signals/counters.d.ts +51 -0
- package/dist/signals/counters.js +58 -0
- package/dist/signals/deployment-change.d.ts +28 -4
- package/dist/signals/deployment-change.js +57 -16
- package/dist/signals/deployment.d.ts +18 -5
- package/dist/signals/deployment.js +37 -11
- package/dist/signals/door.d.ts +34 -12
- package/dist/signals/door.js +37 -13
- package/dist/signals/expire.d.ts +192 -0
- package/dist/signals/expire.js +213 -0
- package/dist/signals/frontier.d.ts +268 -0
- package/dist/signals/frontier.js +145 -0
- package/dist/signals/funnel-hours.contract.d.ts +21 -0
- package/dist/signals/funnel-hours.contract.js +221 -0
- package/dist/signals/funnel-hours.d.ts +293 -0
- package/dist/signals/funnel-hours.js +99 -0
- package/dist/signals/funnel.d.ts +60 -0
- package/dist/signals/funnel.js +35 -20
- package/dist/signals/health.d.ts +201 -4
- package/dist/signals/health.js +214 -2
- package/dist/signals/index.d.ts +19 -0
- package/dist/signals/index.js +19 -0
- package/dist/signals/inside.d.ts +190 -0
- package/dist/signals/inside.js +263 -0
- package/dist/signals/join.d.ts +56 -0
- package/dist/signals/join.js +60 -0
- package/dist/signals/journal.d.ts +112 -9
- package/dist/signals/kept.contract.d.ts +22 -0
- package/dist/signals/kept.contract.js +111 -0
- package/dist/signals/library-agenda-change.d.ts +324 -0
- package/dist/signals/library-agenda-change.js +199 -0
- package/dist/signals/library-agenda.d.ts +258 -0
- package/dist/signals/library-agenda.js +167 -0
- package/dist/signals/library-reach-change.d.ts +10 -0
- package/dist/signals/library-reach-change.js +11 -3
- package/dist/signals/library-senders-change.d.ts +457 -0
- package/dist/signals/library-senders-change.js +367 -0
- package/dist/signals/library-senders-reach-change.d.ts +486 -0
- package/dist/signals/library-senders-reach-change.js +538 -0
- package/dist/signals/library-senders-reach.d.ts +340 -0
- package/dist/signals/library-senders-reach.js +252 -0
- package/dist/signals/library-senders.d.ts +271 -0
- package/dist/signals/library-senders.js +180 -0
- package/dist/signals/library-word-reach-change.js +2 -6
- package/dist/signals/memory.js +142 -1
- package/dist/signals/migrate.d.ts +6 -5
- package/dist/signals/migrate.js +150 -6
- package/dist/signals/notice.d.ts +88 -33
- package/dist/signals/notice.js +38 -16
- package/dist/signals/part-pace.d.ts +378 -0
- package/dist/signals/part-pace.js +333 -0
- package/dist/signals/parts.d.ts +25 -15
- package/dist/signals/parts.js +32 -73
- package/dist/signals/postgres.js +400 -26
- package/dist/signals/region.d.ts +1 -1
- package/dist/signals/retention.d.ts +43 -21
- package/dist/signals/retention.js +25 -8
- package/dist/signals/rhythm.d.ts +302 -0
- package/dist/signals/rhythm.js +262 -0
- package/dist/signals/rollup.d.ts +127 -1
- package/dist/signals/rollup.js +211 -24
- package/dist/signals/schema.d.ts +640 -3
- package/dist/signals/schema.js +239 -3
- package/dist/signals/silences.d.ts +310 -11
- package/dist/signals/silences.js +243 -0
- package/dist/signals/subtrees.d.ts +123 -0
- package/dist/signals/subtrees.js +102 -0
- package/dist/signals/tally.d.ts +125 -4
- package/dist/signals/unread.d.ts +292 -0
- package/dist/signals/unread.js +137 -0
- package/dist/signals/window-agenda.d.ts +276 -0
- package/dist/signals/window-agenda.js +83 -0
- package/dist/signals/window-funnels.d.ts +88 -0
- package/dist/signals/window-funnels.js +47 -0
- package/dist/store/cache.d.ts +101 -0
- package/dist/store/cache.js +149 -0
- package/dist/store/history.d.ts +82 -0
- package/dist/store/history.js +36 -0
- package/dist/store/index.d.ts +11 -0
- package/dist/store/index.js +11 -0
- package/dist/store/migrate.d.ts +26 -0
- package/dist/store/migrate.js +64 -0
- package/dist/store/postgres-audience.d.ts +14 -0
- package/dist/store/postgres-audience.js +272 -0
- package/dist/store/postgres.d.ts +1 -0
- package/dist/store/postgres.js +1 -0
- package/dist/store/schema.d.ts +312 -0
- package/dist/store/schema.js +77 -0
- package/dist/store/source.d.ts +57 -1
- package/dist/store/source.js +65 -1
- package/dist/submit/resolve.d.ts +1 -1
- package/dist/telemetry/index.d.ts +1 -0
- package/dist/telemetry/index.js +1 -0
- package/dist/telemetry/journal.d.ts +32 -0
- package/dist/telemetry/memory.js +10 -1
- package/dist/telemetry/postgres.js +18 -2
- package/dist/telemetry/window.d.ts +135 -0
- package/dist/telemetry/window.js +101 -0
- package/dist/testing/audience-overlay-contract.d.ts +31 -0
- package/dist/testing/audience-overlay-contract.js +354 -0
- package/dist/testing/contracts.d.ts +1 -0
- package/dist/testing/contracts.js +1 -0
- package/dist/testing/journal-contract.js +158 -5
- package/dist/theme/contrast.d.ts +19 -14
- package/dist/theme/contrast.js +181 -17
- package/dist/tree/apply.js +13 -0
- package/dist/tree/mutation.d.ts +18 -0
- package/dist/tree/mutation.js +24 -12
- package/dist/tree/navigation.d.ts +5 -0
- package/dist/tree/navigation.js +32 -10
- package/dist/tree/outline.d.ts +7 -0
- package/dist/tree/outline.js +9 -5
- package/package.json +39 -96
- package/dist/runtime/inverse-interpreter.d.ts +0 -90
- package/dist/runtime/inverse-interpreter.js +0 -56
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { IdFactory } from "../ids.js";
|
|
2
|
-
import type { TreeOperation } from "../tree/delta.js";
|
|
3
|
-
import type { Clock } from "./events.js";
|
|
4
|
-
import type { ChangeInterpreter } from "./interpreter.js";
|
|
5
|
-
import type { DiscardedWork } from "./proposal.js";
|
|
6
|
-
/**
|
|
7
|
-
* Proposing an inverse that is already in hand.
|
|
8
|
-
*
|
|
9
|
-
* The runtime computes the inverse of every change at assessment time
|
|
10
|
-
* (`assessReversibility`), and until now the only way to *offer* one back was
|
|
11
|
-
* `revertRevision`, which plans an undo by replaying a store. That is the right
|
|
12
|
-
* path when the undo is being recovered from a log — it has to read one to know
|
|
13
|
-
* what has been built on top since (0035).
|
|
14
|
-
*
|
|
15
|
-
* It is the wrong path, and an unreachable one, when the inverse never left the
|
|
16
|
-
* process. A surface that composed a change and still holds the `Reversibility`
|
|
17
|
-
* it produced has no log to replay and nothing to contest: the whole of what it
|
|
18
|
-
* needs is the short piece between *here is an inverse* and *here is a proposal
|
|
19
|
-
* the Gate can weigh*. `Loom marketing` wrote that piece by hand on 5 September
|
|
20
|
-
* to make the front door's *Put it back* do what it says, and filed it, because
|
|
21
|
-
* the alternative is every stateless surface rebuilding the same thirty lines
|
|
22
|
-
* with its own idea of what an undo's provenance says.
|
|
23
|
-
*
|
|
24
|
-
* So this is the assembled version, and `revertInterpreter` is now it plus the
|
|
25
|
-
* two things only a log can supply: a rationale naming the revision, and the
|
|
26
|
-
* declaration of what applying it writes over.
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* The inverse, as little of it as proposing one needs.
|
|
30
|
-
*
|
|
31
|
-
* A `TreeDelta` satisfies this, which is the common case — it is what
|
|
32
|
-
* `Reversibility.inverse` hands back. A caller holding operations and the
|
|
33
|
-
* revision they were computed against, and no delta yet, satisfies it too: the
|
|
34
|
-
* delta id and tree id belong to the delta this proposes, not to the inverse it
|
|
35
|
-
* proposes from.
|
|
36
|
-
*/
|
|
37
|
-
export type ProposableInverse = {
|
|
38
|
-
/** The revision the operations were computed against. */
|
|
39
|
-
readonly baseRevision: number;
|
|
40
|
-
readonly operations: readonly TreeOperation[];
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* What the interpreter cannot compute, because it depends on where the inverse
|
|
44
|
-
* came from.
|
|
45
|
-
*
|
|
46
|
-
* Both are required rather than defaulted. A default interpreter id would put
|
|
47
|
-
* one stamp on undos planned by unrelated callers, and reading that stamp back
|
|
48
|
-
* is how a surface tells an undo from a change — `(demo)` does exactly that
|
|
49
|
-
* against `REVERT_INTERPRETER`. A default rationale would be the runtime
|
|
50
|
-
* writing a sentence about a provenance it does not know, on the one field the
|
|
51
|
-
* person answering a hold actually reads (0019).
|
|
52
|
-
*/
|
|
53
|
-
export type InverseTerms = {
|
|
54
|
-
/** What produced the delta, for `Provenance.interpreter`. Not a model. */
|
|
55
|
-
readonly interpreter: string;
|
|
56
|
-
/** Why, in the words the person answering a hold is shown. */
|
|
57
|
-
readonly rationale: string;
|
|
58
|
-
/**
|
|
59
|
-
* Work applying this inverse would write over. Only a caller holding a log
|
|
60
|
-
* can know of any, and absence keeps meaning "nobody looked at a log" rather
|
|
61
|
-
* than "a log was checked and was clean" (0035).
|
|
62
|
-
*/
|
|
63
|
-
readonly discards?: readonly DiscardedWork[];
|
|
64
|
-
/**
|
|
65
|
-
* The revision this puts back, recorded on the provenance the log keeps.
|
|
66
|
-
*
|
|
67
|
-
* Optional because not every inverse has one to name. A stateless surface
|
|
68
|
-
* undoing a change it made in the same session has no revision — nothing was
|
|
69
|
-
* ever appended — and stamping a number it does not have would be worse than
|
|
70
|
-
* the absence. A caller that planned the undo off a log always does.
|
|
71
|
-
*/
|
|
72
|
-
readonly undoes?: number;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* An interpreter that has nothing to interpret.
|
|
76
|
-
*
|
|
77
|
-
* The seam exists because interpretation is the non-deterministic step (0005),
|
|
78
|
-
* not because it is always a model — and an undo is the case that proves the
|
|
79
|
-
* seam was drawn in the right place. Everything downstream of it cannot tell
|
|
80
|
-
* that no model was involved, which is exactly what makes an undo gateable on
|
|
81
|
-
* the same terms as an AI-authored change.
|
|
82
|
-
*
|
|
83
|
-
* `confidence` is 1 because the inverse is computed, not guessed. That is the
|
|
84
|
-
* honest self-grade (0007), and it is also why `authoredBy` is `runtime`: a 1
|
|
85
|
-
* nobody graded is not a claim, and calibration (0031) segments these out of its
|
|
86
|
-
* score rather than letting every undo walk the top band toward a perfect record
|
|
87
|
-
* the model never earned.
|
|
88
|
-
*/
|
|
89
|
-
export declare const inverseInterpreter: (inverse: ProposableInverse, terms: InverseTerms, idFactory: IdFactory, clock: Clock) => ChangeInterpreter;
|
|
90
|
-
//# sourceMappingURL=inverse-interpreter.d.ts.map
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { err, ok } from "../result.js";
|
|
2
|
-
/**
|
|
3
|
-
* An interpreter that has nothing to interpret.
|
|
4
|
-
*
|
|
5
|
-
* The seam exists because interpretation is the non-deterministic step (0005),
|
|
6
|
-
* not because it is always a model — and an undo is the case that proves the
|
|
7
|
-
* seam was drawn in the right place. Everything downstream of it cannot tell
|
|
8
|
-
* that no model was involved, which is exactly what makes an undo gateable on
|
|
9
|
-
* the same terms as an AI-authored change.
|
|
10
|
-
*
|
|
11
|
-
* `confidence` is 1 because the inverse is computed, not guessed. That is the
|
|
12
|
-
* honest self-grade (0007), and it is also why `authoredBy` is `runtime`: a 1
|
|
13
|
-
* nobody graded is not a claim, and calibration (0031) segments these out of its
|
|
14
|
-
* score rather than letting every undo walk the top band toward a perfect record
|
|
15
|
-
* the model never earned.
|
|
16
|
-
*/
|
|
17
|
-
export const inverseInterpreter = (inverse, terms, idFactory, clock) => ({
|
|
18
|
-
interpret: (intent, tree) => Promise.resolve(
|
|
19
|
-
/**
|
|
20
|
-
* An inverse is computed against one arrangement of a tree. Offering it
|
|
21
|
-
* against another would be proposing something whose reasoning has
|
|
22
|
-
* expired, so it declines rather than proposing. The write path refuses a
|
|
23
|
-
* moved head before reaching here; this is what keeps the interpreter safe
|
|
24
|
-
* to wire into a runtime directly, which a stateless caller does.
|
|
25
|
-
*/
|
|
26
|
-
tree.revision === inverse.baseRevision
|
|
27
|
-
? ok({
|
|
28
|
-
proposalId: idFactory.proposalId(),
|
|
29
|
-
intentId: intent.intentId,
|
|
30
|
-
delta: {
|
|
31
|
-
deltaId: idFactory.deltaId(),
|
|
32
|
-
treeId: tree.treeId,
|
|
33
|
-
baseRevision: tree.revision,
|
|
34
|
-
operations: inverse.operations,
|
|
35
|
-
},
|
|
36
|
-
rationale: terms.rationale,
|
|
37
|
-
...(terms.discards === undefined || terms.discards.length === 0
|
|
38
|
-
? {}
|
|
39
|
-
: { discards: terms.discards }),
|
|
40
|
-
provenance: {
|
|
41
|
-
origin: intent.origin,
|
|
42
|
-
...(intent.actor === undefined ? {} : { actor: intent.actor }),
|
|
43
|
-
interpreter: terms.interpreter,
|
|
44
|
-
/** Computed, not inferred — so calibration leaves it out (0031). */
|
|
45
|
-
authoredBy: "runtime",
|
|
46
|
-
...(terms.undoes === undefined ? {} : { undoes: terms.undoes }),
|
|
47
|
-
confidence: 1,
|
|
48
|
-
interpretedAt: clock.now(),
|
|
49
|
-
},
|
|
50
|
-
})
|
|
51
|
-
: err({
|
|
52
|
-
code: "refused",
|
|
53
|
-
detail: `the inverse was computed against revision ${inverse.baseRevision}, and this tree is at ${tree.revision}`,
|
|
54
|
-
})),
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=inverse-interpreter.js.map
|