@noodleseed/one 0.132.2 → 0.134.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.
Files changed (102) hide show
  1. package/dist/commands/author-loop.d.ts.map +1 -1
  2. package/dist/commands/author-loop.js +3 -3
  3. package/dist/commands/author-loop.js.map +1 -1
  4. package/dist/commands/devtools.js +1 -1
  5. package/dist/commands/devtools.js.map +1 -1
  6. package/dist/commands/local-readiness.d.ts +2 -2
  7. package/dist/commands/local-readiness.d.ts.map +1 -1
  8. package/dist/commands/local-readiness.js +15 -7
  9. package/dist/commands/local-readiness.js.map +1 -1
  10. package/dist/dev-local-runtime.d.ts +33 -0
  11. package/dist/dev-local-runtime.d.ts.map +1 -0
  12. package/dist/dev-local-runtime.js +53 -0
  13. package/dist/dev-local-runtime.js.map +1 -0
  14. package/dist/dev.d.ts +4 -0
  15. package/dist/dev.d.ts.map +1 -1
  16. package/dist/dev.js +109 -31
  17. package/dist/dev.js.map +1 -1
  18. package/dist/devtools-harness.js +5 -3
  19. package/dist/devtools-harness.js.map +1 -1
  20. package/dist/devtools-preview.d.ts +2 -0
  21. package/dist/devtools-preview.d.ts.map +1 -1
  22. package/dist/devtools-preview.js +15 -3
  23. package/dist/devtools-preview.js.map +1 -1
  24. package/dist/devtools-rpc-forwarder.js +1 -1
  25. package/dist/devtools-rpc-forwarder.js.map +1 -1
  26. package/dist/preview-session.d.ts.map +1 -1
  27. package/dist/preview-session.js +1 -0
  28. package/dist/preview-session.js.map +1 -1
  29. package/dist/react-widget-build.d.ts +4 -0
  30. package/dist/react-widget-build.d.ts.map +1 -1
  31. package/dist/react-widget-build.js +9 -0
  32. package/dist/react-widget-build.js.map +1 -1
  33. package/node_modules/@noodle-borg/admission-limits/dist/client-address.d.ts +7 -0
  34. package/node_modules/@noodle-borg/admission-limits/dist/counter-store.d.ts +71 -0
  35. package/node_modules/@noodle-borg/admission-limits/dist/envelope.d.ts +67 -0
  36. package/node_modules/@noodle-borg/admission-limits/dist/in-memory-counter-store.d.ts +15 -0
  37. package/node_modules/@noodle-borg/admission-limits/dist/portable.d.ts +6 -0
  38. package/node_modules/@noodle-borg/admission-limits/dist/portable.js +6 -0
  39. package/node_modules/@noodle-borg/admission-limits/package.json +8 -0
  40. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +6 -6
  41. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +1 -1
  42. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +4 -1
  43. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  44. package/node_modules/@noodle-borg/assistant-gateway/dist/artifact-projection.d.ts +21 -0
  45. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-context.d.ts +25 -0
  46. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-customer-issuer.d.ts +3 -0
  47. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-customer-routing.d.ts +19 -0
  48. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-guide.d.ts +39 -0
  49. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-interaction-state.d.ts +181 -0
  50. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-interactive.d.ts +99 -0
  51. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-interactive.js +1 -1
  52. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-presentation.d.ts +35 -0
  53. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-sensitive-values.d.ts +3 -0
  54. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.d.ts +226 -0
  55. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.js +1 -1
  56. package/node_modules/@noodle-borg/assistant-gateway/dist/elevation-store.d.ts +70 -0
  57. package/node_modules/@noodle-borg/assistant-gateway/dist/elevation.d.ts +68 -0
  58. package/node_modules/@noodle-borg/assistant-gateway/dist/embed-script.d.ts +24 -0
  59. package/node_modules/@noodle-borg/assistant-gateway/dist/embed-store.d.ts +73 -0
  60. package/node_modules/@noodle-borg/assistant-gateway/dist/in-memory-elevation-store.d.ts +21 -0
  61. package/node_modules/@noodle-borg/assistant-gateway/dist/in-memory-embed-store.d.ts +28 -0
  62. package/node_modules/@noodle-borg/assistant-gateway/dist/portable.d.ts +24 -0
  63. package/node_modules/@noodle-borg/assistant-gateway/dist/public-session.d.ts +56 -0
  64. package/node_modules/@noodle-borg/assistant-gateway/dist/public-surface.d.ts +21 -0
  65. package/node_modules/@noodle-borg/assistant-gateway/dist/public-surface.js +2 -1
  66. package/node_modules/@noodle-borg/assistant-gateway/dist/public-turn.d.ts +44 -0
  67. package/node_modules/@noodle-borg/assistant-gateway/dist/session-resume.d.ts +22 -0
  68. package/node_modules/@noodle-borg/assistant-gateway/dist/surface-budget.d.ts +16 -0
  69. package/node_modules/@noodle-borg/assistant-gateway/dist/surface-budget.js +1 -1
  70. package/node_modules/@noodle-borg/assistant-gateway/dist/tenant-ref.d.ts +13 -0
  71. package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts +9 -2
  72. package/node_modules/@noodle-borg/authoring/dist/assistant.js +8 -2
  73. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +3 -1
  74. package/node_modules/@noodle-borg/authoring/dist/connectors.js +5 -1
  75. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +2 -1
  76. package/node_modules/@noodle-borg/authoring/dist/server.js +4 -1
  77. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js +1 -1
  78. package/node_modules/@noodle-borg/compiler/dist/artifact/config.js +25 -20
  79. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +16 -12
  80. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +18 -13
  81. package/node_modules/@noodle-borg/connector-defs/dist/compile-http.js +2 -0
  82. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts +3 -3
  83. package/node_modules/@noodle-borg/connector-defs/dist/schema.js +6 -1
  84. package/node_modules/@noodle-borg/connector-http/dist/http-connector.js +31 -8
  85. package/node_modules/@noodle-borg/protocol/dist/mapping.js +8 -0
  86. package/node_modules/@noodle-borg/runtime/dist/index.d.ts +1 -0
  87. package/node_modules/@noodle-borg/runtime/dist/index.js +1 -0
  88. package/node_modules/@noodle-borg/runtime/dist/managed-origins.d.ts +11 -0
  89. package/node_modules/@noodle-borg/runtime/dist/managed-origins.js +105 -0
  90. package/node_modules/@noodle-borg/service/dist/local-options.d.ts +9 -0
  91. package/node_modules/@noodle-borg/service/dist/registry-compile.js +12 -12
  92. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.js +14 -3
  93. package/node_modules/@noodle-borg/service/dist/routes/assistant-embeds.js +1 -1
  94. package/node_modules/@noodle-borg/service/dist/routes/assistant-public-session.js +1 -1
  95. package/node_modules/@noodle-borg/service/dist/routes/assistant-public-turn.js +1 -1
  96. package/node_modules/@noodle-borg/service/dist/routes/assistant.js +1 -1
  97. package/node_modules/@noodle-borg/service/dist/serve-local.js +2 -3
  98. package/node_modules/@noodle-borg/service/package.json +1 -1
  99. package/node_modules/@noodleseed/assistant/README.md +4 -1
  100. package/package.json +5 -3
  101. package/node_modules/@noodle-borg/admission-limits/dist/index.js +0 -15
  102. package/node_modules/@noodle-borg/admission-limits/dist/postgres-counter-store.js +0 -68
@@ -0,0 +1,71 @@
1
+ /**
2
+ * The durable daily-counter port.
3
+ *
4
+ * Types are declared here rather than imported from the service's policy layer on purpose: this package
5
+ * must not reach into a commercial carve-out cluster, and the shape is small enough that an independent
6
+ * declaration is cheaper than the coupling (the same precedent `@noodle-borg/module` and
7
+ * `@noodle-borg/transport-http` set for `AccessMode`).
8
+ */
9
+ export interface CounterRequest {
10
+ /** Stable identity of the thing being bounded — a surface's embed id, never a raw address. */
11
+ readonly key: string;
12
+ /** Ceiling for this key on this UTC day. Zero means the surface is switched off. */
13
+ readonly limit: number;
14
+ /** Units to consume; a mint and a turn are both 1 today. */
15
+ readonly amount?: number;
16
+ /**
17
+ * Which window the ceiling belongs to. Solvency bounds are daily (the default); the per-address
18
+ * fairness tier is hourly, so a visitor's accidental burst forgives itself within the same visit.
19
+ */
20
+ readonly window?: 'day' | 'hour';
21
+ }
22
+ export interface CounterOutcome {
23
+ readonly allowed: boolean;
24
+ /** Units used after this call (unchanged when the call was denied). */
25
+ readonly used: number;
26
+ readonly limit: number;
27
+ /** Start of the window after the one this counter belongs to. */
28
+ readonly resetAt: Date;
29
+ }
30
+ export interface DailyCounterStore {
31
+ /**
32
+ * Atomically consume against a key's daily budget. Must be safe under concurrency: N simultaneous
33
+ * callers on one key may never push `used` past `limit`, because that is the whole point of the
34
+ * counter.
35
+ */
36
+ consume(request: CounterRequest, now: Date): Promise<CounterOutcome>;
37
+ /** Usage without consuming, for operator reads. */
38
+ peek(key: string, now: Date): Promise<number>;
39
+ /**
40
+ * Whether this store survives a process restart and is shared across service instances. The public
41
+ * mint route refuses to serve when this is false: a per-process counter silently resets a customer's
42
+ * spend ceiling on every deploy, restart, and scale-out, which is indistinguishable from having no
43
+ * ceiling at all.
44
+ */
45
+ readonly durable: boolean;
46
+ }
47
+ /** Counters roll at UTC midnight — a fixed boundary no tenant timezone can shift. */
48
+ export declare function dayKey(now: Date): string;
49
+ /**
50
+ * Tier 3 rolls hourly rather than daily. A fairness bound wants a window short enough that an
51
+ * accidental burst forgives itself within the same visit, where a solvency bound wants the whole day.
52
+ */
53
+ export declare function hourKey(now: Date): string;
54
+ /**
55
+ * The row identity for a request, and the reason the hour is folded into the **key** rather than the day.
56
+ *
57
+ * The counter table's `day` column is a real `date`, so an hour-resolution value cannot go there: it
58
+ * fails at the database with `invalid input syntax for type date`, which is exactly how the per-address
59
+ * tier took production down after passing every test — the shared suite only exercised the daily window
60
+ * and the route tests used a mocked counter, so no test ever put an hourly request through real SQL.
61
+ *
62
+ * Partitioning by date and distinguishing the hour inside the key keeps both windows in one table with
63
+ * no migration and no ambiguity: a daily row and an hourly row can never collide, because the hourly key
64
+ * carries a suffix the daily key cannot produce.
65
+ */
66
+ export declare function counterRow(request: Pick<CounterRequest, 'key' | 'window'>, now: Date): {
67
+ readonly key: string;
68
+ readonly day: string;
69
+ };
70
+ export declare function nextReset(now: Date, window?: 'day' | 'hour'): Date;
71
+ //# sourceMappingURL=counter-store.d.ts.map
@@ -0,0 +1,67 @@
1
+ /**
2
+ * The public-surface safety envelope (ADR 0201 §7, amended 2026-08-12).
3
+ *
4
+ * Two ideas are deliberately separate here:
5
+ *
6
+ * - **Structural maximums** are the ceiling neither app code nor managed config may raise. They exist
7
+ * because a public surface faces the open internet, and "the author configured it" is not a reason to
8
+ * trust a larger bound.
9
+ * - **Operator defaults** are what a surface gets when nobody says otherwise. Operators may lower any of
10
+ * them, and lowering the daily caps to zero is the kill switch — one mechanism, not two.
11
+ *
12
+ * `clamp()` is the only way to build an envelope, so raising a bound is unrepresentable rather than
13
+ * merely discouraged.
14
+ */
15
+ export interface AdmissionEnvelope {
16
+ /** Longest visitor message accepted, in characters. */
17
+ readonly messageCharacters: number;
18
+ /** Model turns one session may run before it must be replaced. */
19
+ readonly turnsPerSession: number;
20
+ /** Model steps inside a single turn (the agent loop bound). */
21
+ readonly modelStepsPerTurn: number;
22
+ /** Tool calls inside a single turn, across all steps. */
23
+ readonly toolCallsPerTurn: number;
24
+ /** Inputs or confirmations that may be outstanding on one session at a time. */
25
+ readonly pendingInteractions: number;
26
+ /** Lifetime of a single-use confirmation, in milliseconds. */
27
+ readonly confirmationTtlMs: number;
28
+ /** Idle timeout before a session is unusable, in milliseconds. */
29
+ readonly sessionIdleMs: number;
30
+ /** Absolute session lifetime regardless of activity, in milliseconds. */
31
+ readonly sessionAbsoluteMs: number;
32
+ /**
33
+ * Model turns this surface may run per UTC day. This is the solvency bound: it caps what a bot can
34
+ * spend of the customer's model budget without depending on client-IP attribution.
35
+ */
36
+ readonly turnsPerDay: number;
37
+ /**
38
+ * Sessions this surface may mint per UTC day. Turns alone are not enough — a bot that only mints
39
+ * writes durable session rows forever while spending nothing.
40
+ */
41
+ readonly mintsPerDay: number;
42
+ /**
43
+ * Sessions one source address may mint per hour, and turns it may run (admission tier 3).
44
+ *
45
+ * A different question from the daily caps, which is why it is a separate tier rather than a tighter
46
+ * number: the per-surface cap governs **solvency** — the customer's model spend is bounded whatever
47
+ * happens — while this governs **fairness**, so one visitor cannot consume the surface's whole day
48
+ * before anybody else arrives. Losing this tier loses fairness and never solvency, which is why the
49
+ * pilot shipped without it.
50
+ */
51
+ readonly mintsPerAddressHour: number;
52
+ readonly turnsPerAddressHour: number;
53
+ }
54
+ /** Ceilings. Nothing may exceed these, whatever the manifest or managed config asks for. */
55
+ export declare const ADMISSION_MAXIMUM: AdmissionEnvelope;
56
+ /** What a surface gets when nobody configures it. Conservative by intent for a first pilot. */
57
+ export declare const ADMISSION_DEFAULTS: AdmissionEnvelope;
58
+ /**
59
+ * Build an envelope from an operator request. Every field is clamped to {@link ADMISSION_MAXIMUM};
60
+ * a request below the ceiling is honoured exactly, and a request above it is silently reduced rather
61
+ * than rejected, so a stale or over-eager configuration degrades to safe instead of failing a surface
62
+ * closed at request time. Zero is meaningful for the daily caps and is preserved.
63
+ */
64
+ export declare function clamp(requested?: Partial<AdmissionEnvelope>): AdmissionEnvelope;
65
+ /** A surface whose daily budget is exhausted or switched off serves nobody until it is raised. */
66
+ export declare function isDisabled(envelope: AdmissionEnvelope): boolean;
67
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { type CounterOutcome, type CounterRequest, type DailyCounterStore } from './counter-store.js';
2
+ /**
3
+ * Process-local counters for local development and tests.
4
+ *
5
+ * `durable` is false, and that is load-bearing rather than informational: the public mint route refuses
6
+ * to serve a surface backed by this store, because a ceiling that resets on every restart and is not
7
+ * shared across instances would look like protection while providing none.
8
+ */
9
+ export declare class InMemoryDailyCounterStore implements DailyCounterStore {
10
+ #private;
11
+ readonly durable = false;
12
+ consume(request: CounterRequest, now: Date): Promise<CounterOutcome>;
13
+ peek(key: string, now: Date): Promise<number>;
14
+ }
15
+ //# sourceMappingURL=in-memory-counter-store.d.ts.map
@@ -0,0 +1,6 @@
1
+ /** Admission contracts and in-memory adapters safe for the published CLI runtime. */
2
+ export * from './client-address.js';
3
+ export * from './counter-store.js';
4
+ export * from './envelope.js';
5
+ export * from './in-memory-counter-store.js';
6
+ //# sourceMappingURL=portable.d.ts.map
@@ -0,0 +1,6 @@
1
+ /** Admission contracts and in-memory adapters safe for the published CLI runtime. */
2
+ export * from './client-address.js';
3
+ export * from './counter-store.js';
4
+ export * from './envelope.js';
5
+ export * from './in-memory-counter-store.js';
6
+ //# sourceMappingURL=portable.js.map
@@ -12,6 +12,14 @@
12
12
  ".": {
13
13
  "types": "./dist/index.d.ts",
14
14
  "import": "./dist/index.js"
15
+ },
16
+ "./portable": {
17
+ "types": "./dist/portable.d.ts",
18
+ "import": "./dist/portable.js"
19
+ },
20
+ "./postgres": {
21
+ "types": "./dist/postgres.d.ts",
22
+ "import": "./dist/postgres.js"
15
23
  }
16
24
  },
17
25
  "files": [