@mindot/will 0.8.0 → 0.10.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/README.md +15 -11
- package/dist/index.d.ts +188 -141
- package/dist/index.js +6985 -3337
- package/dist/index.js.map +1 -1
- package/dist/surface/channels/discord.d.ts +177 -0
- package/dist/surface/channels/discord.js +394 -0
- package/dist/surface/channels/discord.js.map +1 -0
- package/dist/{channels → surface/channels}/whatsapp.d.ts +2 -2
- package/dist/{channels → surface/channels}/whatsapp.js +11 -5
- package/dist/surface/channels/whatsapp.js.map +1 -0
- package/dist/{cli.js → surface/cli.js} +5382 -1573
- package/dist/surface/cli.js.map +1 -0
- package/dist/{mcp → surface/mcp}/effectors.d.ts +1 -1
- package/dist/{mcp → surface/mcp}/effectors.js +10 -4
- package/dist/surface/mcp/effectors.js.map +1 -0
- package/dist/{will-cS6k4uiJ.d.ts → will-evj9_vrd.d.ts} +6658 -5078
- package/package.json +11 -12
- package/src/cognition/agency/consequence.ts +356 -1
- package/src/cognition/agency/conversation.aim.ts +292 -0
- package/src/cognition/agency/engines/action.selector.ts +142 -5
- package/src/cognition/agency/engines/affordance.synthesizer.ts +200 -7
- package/src/cognition/agency/engines/deliberation.engine.ts +76 -3
- package/src/cognition/agency/engines/motor.schema.executor.ts +509 -32
- package/src/cognition/agency/engines/reafference.engine.ts +160 -4
- package/src/cognition/agency/execution.primitives.ts +17 -4
- package/src/cognition/agency/proactive.communicator.ts +19 -3
- package/src/cognition/agency/reconcile.learning.ts +5 -4
- package/src/cognition/agency/restart.ts +66 -0
- package/src/cognition/agency/schemas/innate.ts +96 -1
- package/src/cognition/agency/schemas/repertoire.ts +19 -1
- package/src/cognition/agency/selection.scoring.ts +49 -0
- package/src/cognition/agency/settlement.ts +203 -0
- package/src/cognition/agency/types.ts +73 -1
- package/src/cognition/cache/composition.ts +232 -0
- package/src/cognition/cache/deliberation.cache.ts +219 -0
- package/src/cognition/cache/fingerprint.ts +120 -0
- package/src/cognition/cache/types.ts +105 -0
- package/src/cognition/config.mirror.entities.ts +108 -1
- package/src/cognition/event.schemas.ts +22 -8
- package/src/cognition/faculties/affective.blender.ts +21 -4
- package/src/cognition/faculties/autobiographical.narrator.ts +5 -10
- package/src/cognition/faculties/circadian.oscillator.ts +36 -7
- package/src/cognition/faculties/episodic.consolidator.ts +59 -3
- package/src/cognition/faculties/executive.engine/action.record.ts +129 -0
- package/src/cognition/faculties/executive.engine/commands.ts +189 -14
- package/src/cognition/faculties/executive.engine/context.ts +106 -46
- package/src/cognition/faculties/executive.engine/deliberate.reasoning.ts +1 -1
- package/src/cognition/faculties/executive.engine/engine.ts +714 -136
- package/src/cognition/faculties/executive.engine/escalation.buffer.ts +230 -45
- package/src/cognition/faculties/executive.engine/facet.supervisor.ts +320 -65
- package/src/cognition/faculties/executive.engine/facet.ts +81 -26
- package/src/cognition/faculties/executive.engine/gating.ts +14 -14
- package/src/cognition/faculties/executive.engine/parser.ts +120 -38
- package/src/cognition/faculties/executive.engine/prompt.factory.ts +331 -38
- package/src/cognition/faculties/executive.engine/types.ts +84 -12
- package/src/cognition/faculties/exteroception.ts +99 -98
- package/src/cognition/faculties/goal.manager.ts +144 -16
- package/src/cognition/faculties/known.entity.tracker.ts +287 -29
- package/src/cognition/faculties/moral.evaluator.ts +8 -3
- package/src/cognition/faculties/persona.consolidator.ts +141 -0
- package/src/cognition/faculties/planning.engine/engine.ts +4 -4
- package/src/cognition/faculties/planning.engine/plan.frontier.ts +1 -1
- package/src/cognition/faculties/reputation.tracker.ts +66 -2
- package/src/cognition/faculties/self.model.updater.ts +19 -12
- package/src/cognition/faculties/semantic.engine/integrator.ts +1 -1
- package/src/cognition/faculties/social.perception.ts +47 -3
- package/src/cognition/faculties/threat.evaluator.ts +7 -0
- package/src/cognition/faculties/working.memory.ts +16 -21
- package/src/cognition/identity.entity.ts +205 -0
- package/src/cognition/index.ts +7 -0
- package/src/cognition/instruction.handler.ts +1 -1
- package/src/cognition/memory/vector.adapter.ts +12 -3
- package/src/cognition/memory/vector.embedder.ts +45 -4
- package/src/cognition/percept.entity.ts +122 -0
- package/src/cognition/persona.prior.ts +6 -0
- package/src/cognition/sense.boundary.ts +176 -0
- package/src/cognition/senses/audition.engine/engine.ts +492 -53
- package/src/cognition/senses/base.sense.engine.ts +105 -7
- package/src/cognition/senses/index.ts +83 -13
- package/src/cognition/senses/provenance.ts +128 -0
- package/src/cognition/senses/somatosensation.engine.ts +117 -9
- package/src/cognition/social.identity.ts +296 -0
- package/src/cognition/utilities/token.tracker.ts +94 -10
- package/src/core/orchestrator.ts +51 -0
- package/src/index.ts +39 -5
- package/src/llm/gate.ts +48 -0
- package/src/llm/index.ts +127 -33
- package/src/llm/routing.ts +6 -0
- package/src/llm/summarizer.ts +1 -1
- package/src/llm/wire.contracts.ts +57 -0
- package/src/pma/index.ts +68 -54
- package/src/stem/assembly.audit.ts +1 -0
- package/src/stem/guards/identity.coherence.ts +1 -1
- package/src/stem/index.ts +171 -23
- package/src/stem/mind.ts +198 -57
- package/src/stem/policy/arbiter.ts +10 -0
- package/src/stem/profiles/built-in.ts +7 -0
- package/src/{profiles → stem/profiles}/companion.ts +1 -1
- package/src/{profiles → stem/profiles}/company-brain.ts +1 -1
- package/src/{profiles → stem/profiles}/customer-service.ts +1 -1
- package/src/{profiles → stem/profiles}/game-npc.ts +1 -1
- package/src/{profiles → stem/profiles}/index.ts +1 -1
- package/src/{profiles → stem/profiles}/smart-home.ts +1 -1
- package/src/stem/tracts/effector/escalation.lifecycle.ts +239 -0
- package/src/stem/tracts/effector/policy.enforcement.ts +261 -0
- package/src/stem/tracts/effector/types.ts +110 -0
- package/src/stem/tracts/effector.controller.ts +112 -401
- package/src/stem/tracts/outbox.controller.ts +30 -17
- package/src/stem/tracts/outbox.writer.ts +40 -2
- package/src/stem/tracts/sensory.controller.ts +6 -6
- package/src/stem/tracts/session.logger.ts +6 -1
- package/src/stem/tracts/transport/types.ts +20 -1
- package/src/stem/tracts/transport.controller.ts +33 -9
- package/src/surface/channels/discord.ts +609 -0
- package/src/{channels → surface/channels}/roster.ts +1 -1
- package/src/surface/channels/types.ts +136 -0
- package/src/{channels → surface/channels}/whatsapp.ts +22 -10
- package/src/{cli.ts → surface/cli.ts} +14 -9
- package/src/{host → surface/host}/boot.ts +3 -3
- package/src/{host → surface/host}/utterances.ts +2 -2
- package/src/{mcp → surface/mcp}/effectors.ts +19 -6
- package/src/{mcp → surface/mcp}/server.ts +19 -5
- package/src/{sdk → surface/sdk}/will.ts +194 -33
- package/src/{serve → surface/serve}/server.ts +11 -4
- package/src/types.ts +24 -3
- package/dist/channels/discord.d.ts +0 -69
- package/dist/channels/discord.js +0 -193
- package/dist/channels/discord.js.map +0 -1
- package/dist/channels/whatsapp.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/mcp/effectors.js.map +0 -1
- package/src/channels/discord.ts +0 -214
- package/src/channels/types.ts +0 -46
- package/src/cognition/faculties/executive.engine/messages.ts +0 -102
- package/src/extensions/livestream.ext.ts +0 -570
- package/src/extensions/time.ext.ts +0 -339
- package/src/profiles/built-in.ts +0 -7
- package/src/runners/coherence.runner.ts +0 -49
- package/src/runners/outreach.runner.ts +0 -155
- package/src/runners/social.runner.ts +0 -179
- package/src/runners/thin-shim.runner.ts +0 -205
- /package/dist/{cli.d.ts → surface/cli.d.ts} +0 -0
|
@@ -91,24 +91,37 @@ export class OutboxController {
|
|
|
91
91
|
break
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
// 2.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
94
|
+
// 2. The world's answer about my own words — in through the sense door.
|
|
95
|
+
//
|
|
96
|
+
// SIGNAL_BOUNDARY P4. This tract used to build the percept entity itself and
|
|
97
|
+
// `setEntity` it, which made it one of three places outside a sense that
|
|
98
|
+
// wrote a percept. It is reafference by construction ("the ear hears the
|
|
99
|
+
// word you spoke"): the message went out, and the world said whether it
|
|
100
|
+
// landed. That is precisely what the somatosensation door carries since P2,
|
|
101
|
+
// and going through it means the percept is stamped, traced and swept by the
|
|
102
|
+
// same machinery as every other one instead of by hand here.
|
|
103
|
+
//
|
|
104
|
+
// The facts go as `data`, not as prose. `delivered` and the id are what the
|
|
105
|
+
// mind has to reason from; the sentence it reads is the engine's business.
|
|
106
|
+
// Two deliveries in one tick stay distinct because `messageId` is in the
|
|
107
|
+
// data and the trace id hashes the label the data composes — identical
|
|
108
|
+
// payloads in one tick are what that hash is meant to collapse.
|
|
109
|
+
//
|
|
110
|
+
// `summary` here is a host-style hint, and the engine may bound it; the data
|
|
111
|
+
// beside it is never bounded. Salience keeps the old asymmetry — a failure
|
|
112
|
+
// is worth more attention than a success, because only one of them needs
|
|
113
|
+
// anything done about it.
|
|
114
|
+
void instance.cognition.somatosensationEngine.sense({
|
|
115
|
+
kind: 'system',
|
|
116
|
+
signal: 'message_delivery',
|
|
117
|
+
provenance: 'reafferent',
|
|
118
|
+
data: {
|
|
111
119
|
messageId,
|
|
120
|
+
delivered,
|
|
121
|
+
salience: delivered ? 0.35 : 0.6,
|
|
122
|
+
summary: delivered
|
|
123
|
+
? 'My message was delivered successfully.'
|
|
124
|
+
: 'My message failed to reach the recipient.',
|
|
112
125
|
},
|
|
113
126
|
})
|
|
114
127
|
|
|
@@ -21,6 +21,19 @@ import { logger } from '#core/logger'
|
|
|
21
21
|
import type { OutboxMessage } from '#types'
|
|
22
22
|
import type { SessionLogger } from './session.logger'
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Referent → a deliverable address, and the room to use when none was chosen.
|
|
26
|
+
*
|
|
27
|
+
* Returns null when the referent is already an address (nothing to translate) or
|
|
28
|
+
* when the mind holds no route at all — in which case the row goes out as-is and
|
|
29
|
+
* the bridge's own roster fallback still applies, so a message is never silently
|
|
30
|
+
* dropped for want of a handle.
|
|
31
|
+
*/
|
|
32
|
+
export type OutboxRouting = (
|
|
33
|
+
targetEntityId: string,
|
|
34
|
+
chosenThread: string | undefined,
|
|
35
|
+
) => { targetEntityId: string; threadId?: string } | null
|
|
36
|
+
|
|
24
37
|
/** The caller-supplied fields of an outbox row; the writer stamps id + defaults. */
|
|
25
38
|
export interface OutboxRow {
|
|
26
39
|
targetEntityId: string
|
|
@@ -43,6 +56,7 @@ export class OutboxWriter {
|
|
|
43
56
|
* which made the embedded ids in `conversation.sent` diverge every run).
|
|
44
57
|
*/
|
|
45
58
|
private _seq = 0
|
|
59
|
+
private _routing: OutboxRouting | null = null
|
|
46
60
|
|
|
47
61
|
constructor( opts: { outbox?: OutboxMessage[]; willId?: string } = {} ){
|
|
48
62
|
this._outbox = opts.outbox ?? []
|
|
@@ -53,6 +67,21 @@ export class OutboxWriter {
|
|
|
53
67
|
this._sessionLogger = logger
|
|
54
68
|
}
|
|
55
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Turn a referent into somewhere the world can actually be spoken to.
|
|
72
|
+
*
|
|
73
|
+
* Injected rather than read here, because this writer is deliberately dumb —
|
|
74
|
+
* it holds no state and must stay replay-safe. Assembly closes over the state
|
|
75
|
+
* manager (the same shape as `attachMemorySink`).
|
|
76
|
+
*
|
|
77
|
+
* This is the ONE seam both send paths cross: ProactiveCommunicator's
|
|
78
|
+
* `enqueue()` and AuditionEngine's `enqueueReply()`. Translating anywhere else
|
|
79
|
+
* would mean doing it twice and getting it wrong once.
|
|
80
|
+
*/
|
|
81
|
+
attachRouting( resolve: OutboxRouting | null ): void {
|
|
82
|
+
this._routing = resolve
|
|
83
|
+
}
|
|
84
|
+
|
|
56
85
|
private _genId( suffix = ''): string {
|
|
57
86
|
return `outbox-${ this._willId }-${ ++this._seq }${ suffix }`
|
|
58
87
|
}
|
|
@@ -63,15 +92,24 @@ export class OutboxWriter {
|
|
|
63
92
|
*/
|
|
64
93
|
enqueue( row: OutboxRow, idSuffix = ''): string {
|
|
65
94
|
const id = this._genId( idSuffix )
|
|
95
|
+
// A `ke:` anchor is who, never where. Resolve it to an address the bridge can
|
|
96
|
+
// deliver to and a room to say it in — and where a room was already chosen
|
|
97
|
+
// (a reply answers into the thread it was asked in), that choice WINS. The
|
|
98
|
+
// mind picking a room is a decision; this is only the fallback for when it
|
|
99
|
+
// made none, and the alternative to the fallback is dropping the message.
|
|
100
|
+
const routed = this._routing?.( row.targetEntityId, row.threadId ) ?? null
|
|
101
|
+
const target = routed?.targetEntityId ?? row.targetEntityId
|
|
102
|
+
const thread = row.threadId ?? routed?.threadId
|
|
103
|
+
|
|
66
104
|
this._outbox.push({
|
|
67
105
|
id,
|
|
68
|
-
targetEntityId:
|
|
106
|
+
targetEntityId: target,
|
|
69
107
|
...( row.targetEntityName !== undefined ? { targetEntityName: row.targetEntityName } : {} ),
|
|
70
108
|
content: row.content,
|
|
71
109
|
effectorName: row.effectorName,
|
|
72
110
|
...( row.gestureType ? { gestureType: row.gestureType } : {} ),
|
|
73
111
|
...( row.replyToMessageId ? { replyToMessageId: row.replyToMessageId } : {} ),
|
|
74
|
-
...(
|
|
112
|
+
...( thread ? { threadId: thread } : {} ),
|
|
75
113
|
deliveryStatus: 'pending',
|
|
76
114
|
createdAtTick: 0,
|
|
77
115
|
createdAt: Date.now(),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
//
|
|
5
5
|
// SensoryController owns the senses input + LLM chunk-streaming output
|
|
6
6
|
// boundary extracted from WillStem (R5-e):
|
|
7
|
-
// - input ingestion:
|
|
7
|
+
// - input ingestion: senseText / senseSignal / injectEvent
|
|
8
8
|
// - real-time chunk streaming: addChunkListener / addSensoryChunkListener
|
|
9
9
|
// and their sync helpers (syncChunkBroadcaster + the addChunkCallback fan-out)
|
|
10
10
|
//
|
|
@@ -34,17 +34,17 @@ export class SensoryController {
|
|
|
34
34
|
* LanguagePercept publication, conversation-facet spawn/reuse, and LLM
|
|
35
35
|
* reply generation. Reply delivery is async via the outbox / SSE channel.
|
|
36
36
|
*/
|
|
37
|
-
async
|
|
38
|
-
await instance.cognition.auditionEngine.
|
|
37
|
+
async senseText( instance: WillInstance, input: TextMessage ): Promise<void> {
|
|
38
|
+
await instance.cognition.auditionEngine.sense( input )
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Route a raw SensoryInput to the appropriate sense engine by domain.
|
|
43
43
|
* Used by the debug `POST /senses/:domain/ingest` route.
|
|
44
44
|
*/
|
|
45
|
-
async
|
|
45
|
+
async senseSignal( instance: WillInstance, domain: string, input: SensoryInput ): Promise<void> {
|
|
46
46
|
const cog = instance.cognition
|
|
47
|
-
const engineMap: Record<string, {
|
|
47
|
+
const engineMap: Record<string, { sense: (i: SensoryInput) => Promise<void> }> = {
|
|
48
48
|
audition: cog.auditionEngine,
|
|
49
49
|
vision: cog.visionEngine,
|
|
50
50
|
somatosensation: cog.somatosensationEngine,
|
|
@@ -53,7 +53,7 @@ export class SensoryController {
|
|
|
53
53
|
}
|
|
54
54
|
const engine = engineMap[ domain ]
|
|
55
55
|
if( !engine ) throw Object.assign( new Error(`Unknown sense domain: ${domain}`), { code: 400 } )
|
|
56
|
-
await engine.
|
|
56
|
+
await engine.sense( input )
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -50,7 +50,12 @@ export type LogEntryType =
|
|
|
50
50
|
| 'executive.facet.destroy'
|
|
51
51
|
| 'action.execute'
|
|
52
52
|
| 'action.error'
|
|
53
|
-
|
|
53
|
+
// A HOST ACKED AN EFFECTOR — not the `action.outcome` BUS EVENT, which is a
|
|
54
|
+
// different shape with six subscribers (SIGNAL_BOUNDARY P3). The two shared
|
|
55
|
+
// this string, and the prompt section named after it renders a third thing
|
|
56
|
+
// again. One word, three shapes; this is the one that gives it up, because
|
|
57
|
+
// "a host acked" is what it actually records and nothing else logs it.
|
|
58
|
+
| 'effector.acked'
|
|
54
59
|
| 'belief.integrate'
|
|
55
60
|
| 'conversation.in'
|
|
56
61
|
| 'conversation.out'
|
|
@@ -29,7 +29,7 @@ interface BaseEnvelope {
|
|
|
29
29
|
/**
|
|
30
30
|
* Stable id used to match an outbound envelope to its ack(s).
|
|
31
31
|
* For messages this is the OutboxMessage id; for effector invocations the
|
|
32
|
-
*
|
|
32
|
+
* intentId; for replies/chunks a generated id.
|
|
33
33
|
*/
|
|
34
34
|
correlationId: string
|
|
35
35
|
/** Monotonic per-Will sequence number — ordering + dedup at the peer. */
|
|
@@ -123,6 +123,25 @@ export interface InboundMessageEnvelope extends BaseEnvelope {
|
|
|
123
123
|
threadId: string
|
|
124
124
|
content: string
|
|
125
125
|
speakerName?: string
|
|
126
|
+
/**
|
|
127
|
+
* Whose doing this was, as the SENDING host asserts it. Optional on the wire
|
|
128
|
+
* and only there: `SensoryInput.provenance` is required inside the package,
|
|
129
|
+
* but a wire type cannot make an older peer send a field, so absence has to
|
|
130
|
+
* be survivable. It is read through `asProvenance()`, which owns the
|
|
131
|
+
* direction for untyped ingress.
|
|
132
|
+
*
|
|
133
|
+
* This field is why the transport no longer says `'unknown'`. It used to,
|
|
134
|
+
* and correctly — the absence was STRUCTURAL, there was no field to fill —
|
|
135
|
+
* but `unknown` percepts are skipped by the rupture gate in `action.selector`,
|
|
136
|
+
* so a mind reached over a transport could not be interrupted by anyone
|
|
137
|
+
* speaking to it, while the same words in-process could interrupt it. Two
|
|
138
|
+
* transports, two different minds.
|
|
139
|
+
*/
|
|
140
|
+
provenance?: import('#senses/index').SignalProvenance
|
|
141
|
+
/** True when this thread is private — just this someone and the Will. */
|
|
142
|
+
direct?: boolean
|
|
143
|
+
/** What the room is called, e.g. `#general`. A label, not an address. */
|
|
144
|
+
threadName?: string
|
|
126
145
|
}
|
|
127
146
|
|
|
128
147
|
/** A non-conversational external percept (webhook, system signal, etc.). */
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
import { logger } from '#core/logger'
|
|
24
24
|
import { wallClock } from '#core/wall.clock'
|
|
25
25
|
import { getInboundRecorder, getInboundSource } from '#core/inbound.recorder'
|
|
26
|
+
import { asProvenance } from '#senses/index'
|
|
26
27
|
import type { SensoryInput } from '#senses/index'
|
|
27
28
|
import type { effectorInvocation, OutboxMessage } from '#types'
|
|
28
29
|
import type { WillInstance } from '#stem/index'
|
|
@@ -242,7 +243,7 @@ export class TransportController {
|
|
|
242
243
|
/**
|
|
243
244
|
* Emit drained external effector invocations over the transport (2.4). Called
|
|
244
245
|
* by the tick loop after `pendingEffectorInvocations` is spliced. The peer
|
|
245
|
-
* executes each and returns a result-ack (correlationId =
|
|
246
|
+
* executes each and returns a result-ack (correlationId = intentId),
|
|
246
247
|
* which inbound dispatch routes to `confirmExecution`.
|
|
247
248
|
*/
|
|
248
249
|
emitInvocations( instance: WillInstance, invocations: effectorInvocation[] ): void {
|
|
@@ -254,7 +255,7 @@ export class TransportController {
|
|
|
254
255
|
this._emit( instance, {
|
|
255
256
|
channel: 'effector_invocation',
|
|
256
257
|
willId: instance.config.id,
|
|
257
|
-
correlationId: invocation.
|
|
258
|
+
correlationId: invocation.intentId,
|
|
258
259
|
seq: this._nextSeq( instance.config.id ),
|
|
259
260
|
wallTime: wallClock(),
|
|
260
261
|
invocation,
|
|
@@ -339,18 +340,41 @@ export class TransportController {
|
|
|
339
340
|
private _dispatch( instance: WillInstance, env: InboundEnvelope, deps: InboundApplyDeps ): void {
|
|
340
341
|
switch( env.channel ){
|
|
341
342
|
case 'inbound_message': {
|
|
342
|
-
// Fire-and-forget: AuditionEngine.
|
|
343
|
+
// Fire-and-forget: AuditionEngine.sense() serializes per-entity
|
|
343
344
|
// internally; the tick must not block on the LLM reply.
|
|
345
|
+
// THE FIX THIS COMMENT USED TO PROMISE. It said `'unknown'` was right
|
|
346
|
+
// because the absence was STRUCTURAL — the envelope had no provenance
|
|
347
|
+
// field, so a remote host could not declare one however much it knew —
|
|
348
|
+
// and that all three dropped fields were one deliberate wire change
|
|
349
|
+
// rather than three patches. This is that change: the envelope now
|
|
350
|
+
// carries `provenance`, `direct` and `threadName`.
|
|
351
|
+
//
|
|
352
|
+
// With the field there, an omission stops being structural and becomes
|
|
353
|
+
// a caller's omission, which is exactly what `asProvenance()` is for at
|
|
354
|
+
// an untyped boundary (its own comment sends this case here).
|
|
355
|
+
//
|
|
356
|
+
// It is not cosmetic. `'unknown'` percepts are skipped by the rupture
|
|
357
|
+
// gate in `action.selector`, so a mind reached over a transport COULD
|
|
358
|
+
// NOT BE INTERRUPTED by anyone speaking to it, while the same words
|
|
359
|
+
// in-process could interrupt it — and the transport path is the default
|
|
360
|
+
// whenever one is bound. Two transports, two different minds.
|
|
361
|
+
const provenance = asProvenance( env.provenance )
|
|
344
362
|
const input: SensoryInput = env.kind === 'voice'
|
|
345
|
-
? { kind: 'voice', entityId: env.entityId, threadId: env.threadId, transcription: env.content }
|
|
363
|
+
? { kind: 'voice', entityId: env.entityId, threadId: env.threadId, transcription: env.content, provenance }
|
|
346
364
|
: {
|
|
347
|
-
kind:
|
|
348
|
-
entityId:
|
|
349
|
-
threadId:
|
|
350
|
-
content:
|
|
365
|
+
kind: 'text',
|
|
366
|
+
entityId: env.entityId,
|
|
367
|
+
threadId: env.threadId,
|
|
368
|
+
content: env.content,
|
|
369
|
+
provenance,
|
|
351
370
|
...( env.speakerName ? { speakerName: env.speakerName } : {} ),
|
|
371
|
+
// Omitted rather than defaulted, the same way the SDK door does
|
|
372
|
+
// it: an unknown room is not known to be public, and a room with
|
|
373
|
+
// no name stays unnamed rather than being labelled with its id.
|
|
374
|
+
...( env.direct !== undefined ? { direct: env.direct } : {} ),
|
|
375
|
+
...( env.threadName ? { threadName: env.threadName } : {} ),
|
|
352
376
|
}
|
|
353
|
-
void instance.cognition.auditionEngine.
|
|
377
|
+
void instance.cognition.auditionEngine.sense( input )
|
|
354
378
|
break
|
|
355
379
|
}
|
|
356
380
|
|