@indexnetwork/protocol 22.0.0-rc.498.1 → 64.0.0-rc.604.2
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 +1841 -0
- package/IMPLEMENTATION.md +140 -181
- package/README.md +16 -20
- package/STABILITY.md +16 -11
- package/dist/{intents/intent.module.d.ts → capabilities/intents.d.ts} +182 -192
- package/dist/capabilities/intents.js +88 -0
- package/dist/capabilities/negotiations.d.ts +17 -0
- package/dist/capabilities/negotiations.js +16 -0
- package/dist/{networks/network.module.d.ts → capabilities/networks.d.ts} +33 -169
- package/dist/{networks/network.module.js → capabilities/networks.js} +6 -17
- package/dist/index.d.ts +57 -132
- package/dist/index.js +41 -100
- package/dist/internal/agents/agent.repository.port.d.ts +59 -0
- package/dist/internal/agents/agent.repository.port.js +7 -0
- package/dist/internal/agents/agent.types.d.ts +35 -0
- package/dist/{agents → internal/agents}/agent.types.js +1 -6
- package/dist/{intents → internal/intents}/graph/intent.graph.d.ts +142 -151
- package/dist/{intents → internal/intents}/graph/intent.graph.execute.d.ts +5 -1
- package/dist/{intents → internal/intents}/graph/intent.graph.execute.js +165 -46
- package/dist/internal/intents/graph/intent.graph.infer.d.ts +78 -0
- package/dist/internal/intents/graph/intent.graph.infer.js +122 -0
- package/dist/internal/intents/graph/intent.graph.js +108 -0
- package/dist/{intents → internal/intents}/graph/intent.graph.reconcile.d.ts +18 -9
- package/dist/internal/intents/graph/intent.graph.reconcile.js +173 -0
- package/dist/internal/intents/graph/intent.graph.shared.d.ts +55 -0
- package/dist/{intents → internal/intents}/graph/intent.graph.shared.js +25 -70
- package/dist/{intents → internal/intents}/graph/intent.graph.state.d.ts +96 -32
- package/dist/{intents → internal/intents}/graph/intent.graph.state.js +42 -31
- package/dist/internal/intents/intent.admission.d.ts +16 -0
- package/dist/internal/intents/intent.admission.js +30 -0
- package/dist/{intents → internal/intents}/intent.inferrer.d.ts +1 -40
- package/dist/{intents → internal/intents}/intent.inferrer.js +13 -49
- package/dist/internal/intents/intent.preparer.d.ts +52 -0
- package/dist/internal/intents/intent.preparer.js +87 -0
- package/dist/{intents → internal/intents}/intent.verifier.d.ts +3 -36
- package/dist/{intents → internal/intents}/intent.verifier.js +0 -17
- package/dist/{networks → internal/networks}/indexer.graph.d.ts +15 -200
- package/dist/{networks → internal/networks}/indexer.graph.js +19 -128
- package/dist/{networks → internal/networks}/indexer.state.d.ts +8 -63
- package/dist/internal/networks/indexer.state.js +70 -0
- package/dist/{networks → internal/networks}/membership.graph.d.ts +6 -6
- package/dist/{networks → internal/networks}/membership.graph.js +3 -3
- package/dist/{networks → internal/networks}/membership.state.d.ts +2 -2
- package/dist/{networks → internal/networks}/membership.state.js +2 -2
- package/dist/{networks → internal/networks}/network.graph.d.ts +9 -22
- package/dist/{networks → internal/networks}/network.graph.js +13 -27
- package/dist/{networks → internal/networks}/network.recommender.d.ts +2 -2
- package/dist/{networks → internal/networks}/network.recommender.js +2 -2
- package/dist/{networks → internal/networks}/network.state.d.ts +4 -7
- package/dist/{networks → internal/networks}/network.state.js +4 -4
- package/dist/internal/opportunities/negotiation-context.loader.d.ts +26 -0
- package/dist/internal/opportunities/negotiation-context.loader.js +36 -0
- package/dist/{opportunities → internal/opportunities}/opportunity.actor.d.ts +1 -1
- package/dist/{opportunities → internal/opportunities}/opportunity.actor.js +7 -1
- package/dist/internal/opportunities/opportunity.counterparties.d.ts +17 -0
- package/dist/internal/opportunities/opportunity.counterparties.js +19 -0
- package/dist/internal/opportunities/opportunity.events.d.ts +38 -0
- package/dist/internal/opportunities/opportunity.events.js +94 -0
- package/dist/{opportunities → internal/opportunities}/opportunity.feed-selection.d.ts +3 -9
- package/dist/internal/opportunities/opportunity.feed-selection.js +40 -0
- package/dist/internal/opportunities/opportunity.graph.modes.d.ts +39 -0
- package/dist/internal/opportunities/opportunity.graph.modes.js +138 -0
- package/dist/{opportunities → internal/opportunities}/opportunity.labels.d.ts +2 -3
- package/dist/internal/opportunities/opportunity.labels.js +9 -0
- package/dist/{opportunities → internal/opportunities}/opportunity.presentation.d.ts +17 -86
- package/dist/{opportunities → internal/opportunities}/opportunity.presentation.js +54 -447
- package/dist/{opportunities → internal/opportunities}/opportunity.update-admission.d.ts +2 -2
- package/dist/internal/opportunities/opportunity.utils.d.ts +105 -0
- package/dist/internal/opportunities/opportunity.utils.js +165 -0
- package/dist/{opportunities → internal/opportunities}/radar/radar.graph.d.ts +17 -17
- package/dist/{opportunities → internal/opportunities}/radar/radar.graph.js +41 -161
- package/dist/{opportunities → internal/opportunities}/radar/radar.state.d.ts +4 -11
- package/dist/{shared → internal/shared}/agent/model-signal.d.ts +1 -1
- package/dist/{shared → internal/shared}/agent/model-signal.js +1 -1
- package/dist/{shared → internal/shared}/agent/model.config.d.ts +28 -86
- package/dist/{shared → internal/shared}/agent/model.config.js +58 -69
- package/dist/internal/shared/agent/model.resolver.d.ts +33 -0
- package/dist/{shared → internal/shared}/agent/model.resolver.js +18 -33
- package/dist/internal/shared/agent/scope.d.ts +20 -0
- package/dist/internal/shared/agent/scope.js +24 -0
- package/dist/internal/shared/assignment/network-assignment.policy.d.ts +23 -0
- package/dist/internal/shared/assignment/network-assignment.policy.js +28 -0
- package/dist/{shared → internal/shared}/observability/log.d.ts +3 -6
- package/dist/{shared → internal/shared}/observability/log.js +9 -18
- package/dist/{shared → internal/shared}/observability/protocol.logger.d.ts +1 -1
- package/dist/{shared → internal/shared}/observability/protocol.logger.js +1 -1
- package/dist/internal/shared/observability/request-context.d.ts +29 -0
- package/dist/internal/shared/observability/request-context.js +17 -0
- package/dist/{shared → internal/shared}/utils/social-label.d.ts +2 -2
- package/dist/{shared → internal/shared}/utils/social-label.js +1 -1
- package/dist/platform/database/capabilities.d.ts +59 -0
- package/dist/{shared/interfaces/database.entities.d.ts → platform/database/entities.d.ts} +81 -121
- package/dist/{shared/interfaces/database.identity-queries.d.ts → platform/database/identity-queries.d.ts} +55 -20
- package/dist/platform/database/member-queries.d.ts +55 -0
- package/dist/platform/database/member-queries.js +4 -0
- package/dist/platform/database/negotiation.d.ts +38 -0
- package/dist/{shared/interfaces/database.network-queries.d.ts → platform/database/network-queries.d.ts} +66 -67
- package/dist/platform/database/network-queries.js +4 -0
- package/dist/{shared/interfaces/database.opportunity-queries.d.ts → platform/database/opportunity-queries.d.ts} +25 -109
- package/dist/{shared/interfaces/database.port.d.ts → platform/database/port.d.ts} +52 -117
- package/dist/{shared/interfaces/database.port.js → platform/database/port.js} +3 -5
- package/dist/platform/database.d.ts +23 -0
- package/dist/{shared/interfaces/database.interface.js → platform/database.js} +1 -1
- package/dist/{shared/interfaces/cache.interface.d.ts → platform/discovery/cache.d.ts} +2 -4
- package/dist/{shared/interfaces/cache.interface.js → platform/discovery/cache.js} +1 -1
- package/dist/platform/discovery/embedder.d.ts +31 -0
- package/dist/platform/runtime/errors.d.ts +6 -0
- package/dist/platform/runtime/errors.js +9 -0
- package/dist/platform/runtime/follow-up.d.ts +36 -0
- package/dist/platform/runtime/follow-up.js +4 -0
- package/dist/platform/runtime/observability.d.ts +34 -0
- package/dist/protocol/core.d.ts +11 -0
- package/dist/protocol/discovery.rules.d.ts +21 -0
- package/dist/protocol/discovery.rules.js +29 -0
- package/dist/protocol/negotiation.constants.d.ts +3 -0
- package/dist/protocol/negotiation.constants.js +3 -0
- package/dist/protocol/negotiation.rules.d.ts +73 -0
- package/dist/protocol/negotiation.rules.js +68 -0
- package/dist/protocol/protocol.prompt.d.ts +13 -0
- package/dist/protocol/protocol.prompt.js +190 -0
- package/dist/{shared → protocol}/schemas/discovery-question.schema.d.ts +13 -13
- package/dist/{shared → protocol}/schemas/discovery-question.schema.js +2 -2
- package/dist/{shared → protocol}/schemas/identity.schema.d.ts +4 -4
- package/dist/{shared → protocol}/schemas/identity.schema.js +4 -4
- package/dist/{shared → protocol}/schemas/network-assignment.schema.d.ts +11 -20
- package/dist/{shared → protocol}/schemas/network-assignment.schema.js +2 -9
- package/dist/protocol/schemas/underspecification.schema.d.ts +9 -0
- package/dist/protocol/schemas/underspecification.schema.js +12 -0
- package/package.json +7 -15
- package/dist/agents/agent.dispatcher.port.d.ts +0 -25
- package/dist/agents/agent.module.d.ts +0 -19
- package/dist/agents/agent.module.js +0 -11
- package/dist/agents/agent.repository.port.d.ts +0 -118
- package/dist/agents/agent.repository.port.js +0 -10
- package/dist/agents/agent.tools.d.ts +0 -16
- package/dist/agents/agent.tools.js +0 -351
- package/dist/agents/agent.tools.port.d.ts +0 -22
- package/dist/agents/agent.tools.port.js +0 -18
- package/dist/agents/agent.types.d.ts +0 -76
- package/dist/chat/chat-streaming.types.d.ts +0 -618
- package/dist/chat/chat-streaming.types.js +0 -297
- package/dist/chat/chat.agent.d.ts +0 -292
- package/dist/chat/chat.agent.js +0 -1010
- package/dist/chat/chat.graph.d.ts +0 -424
- package/dist/chat/chat.graph.js +0 -257
- package/dist/chat/chat.interrupt.classifier.d.ts +0 -25
- package/dist/chat/chat.interrupt.classifier.js +0 -64
- package/dist/chat/chat.persona.d.ts +0 -39
- package/dist/chat/chat.prompt.d.ts +0 -4
- package/dist/chat/chat.prompt.js +0 -12
- package/dist/chat/chat.prompt.modules.d.ts +0 -30
- package/dist/chat/chat.prompt.modules.js +0 -40
- package/dist/chat/chat.question-dedup.d.ts +0 -14
- package/dist/chat/chat.question-dedup.js +0 -17
- package/dist/chat/chat.state.d.ts +0 -135
- package/dist/chat/chat.state.js +0 -120
- package/dist/chat/chat.streamer.d.ts +0 -64
- package/dist/chat/chat.streamer.js +0 -217
- package/dist/chat/chat.suggester.d.ts +0 -23
- package/dist/chat/chat.suggester.js +0 -95
- package/dist/chat/chat.summarizer.d.ts +0 -20
- package/dist/chat/chat.summarizer.js +0 -97
- package/dist/chat/chat.title.generator.d.ts +0 -19
- package/dist/chat/chat.title.generator.js +0 -66
- package/dist/chat/chat.tools.d.ts +0 -5
- package/dist/chat/chat.tools.js +0 -62
- package/dist/chat/chat.utils.d.ts +0 -41
- package/dist/chat/chat.utils.js +0 -88
- package/dist/chat/negotiator.persona.d.ts +0 -74
- package/dist/chat/negotiator.persona.js +0 -154
- package/dist/chat/negotiator.prompt.d.ts +0 -45
- package/dist/chat/negotiator.prompt.js +0 -160
- package/dist/chat/negotiator.tools.d.ts +0 -42
- package/dist/chat/negotiator.tools.js +0 -134
- package/dist/chat/onboarding.persona.d.ts +0 -28
- package/dist/chat/onboarding.persona.js +0 -86
- package/dist/chat/onboarding.prompt.d.ts +0 -6
- package/dist/chat/onboarding.prompt.js +0 -63
- package/dist/chat/signal.persona.d.ts +0 -47
- package/dist/chat/signal.persona.js +0 -319
- package/dist/chat/signal.prompt.d.ts +0 -39
- package/dist/chat/signal.prompt.js +0 -136
- package/dist/contacts/contact.module.d.ts +0 -8
- package/dist/contacts/contact.module.js +0 -6
- package/dist/contacts/contact.repository.port.d.ts +0 -21
- package/dist/contacts/contact.repository.port.js +0 -12
- package/dist/contacts/contact.tools.d.ts +0 -17
- package/dist/contacts/contact.tools.js +0 -108
- package/dist/contacts/contact.tools.port.d.ts +0 -20
- package/dist/contacts/contact.tools.port.js +0 -16
- package/dist/contacts/contact.types.d.ts +0 -24
- package/dist/contacts/contact.types.js +0 -8
- package/dist/contexts/context.generator.d.ts +0 -95
- package/dist/contexts/context.generator.js +0 -127
- package/dist/contexts/context.module.d.ts +0 -13
- package/dist/contexts/context.module.js +0 -12
- package/dist/contexts/context.tools.port.d.ts +0 -9
- package/dist/discovery/hyde.documents.d.ts +0 -9
- package/dist/discovery/hyde.documents.js +0 -49
- package/dist/discovery/hyde.env.d.ts +0 -8
- package/dist/discovery/hyde.env.js +0 -9
- package/dist/discovery/hyde.frame.d.ts +0 -150
- package/dist/discovery/hyde.frame.js +0 -107
- package/dist/discovery/hyde.generator.d.ts +0 -38
- package/dist/discovery/hyde.generator.js +0 -103
- package/dist/discovery/hyde.graph.d.ts +0 -209
- package/dist/discovery/hyde.graph.js +0 -482
- package/dist/discovery/hyde.state.d.ts +0 -70
- package/dist/discovery/hyde.state.js +0 -85
- package/dist/discovery/hyde.strategies.d.ts +0 -17
- package/dist/discovery/hyde.strategies.js +0 -34
- package/dist/discovery/hyde.validator.d.ts +0 -78
- package/dist/discovery/hyde.validator.js +0 -48
- package/dist/discovery/index.d.ts +0 -26
- package/dist/discovery/index.js +0 -19
- package/dist/discovery/lens.inferrer.d.ts +0 -214
- package/dist/discovery/lens.inferrer.js +0 -152
- package/dist/enrichment/enrichment.generator.d.ts +0 -68
- package/dist/enrichment/enrichment.generator.js +0 -95
- package/dist/enrichment/enrichment.graph.d.ts +0 -544
- package/dist/enrichment/enrichment.graph.js +0 -695
- package/dist/enrichment/enrichment.state.d.ts +0 -141
- package/dist/enrichment/enrichment.state.js +0 -115
- package/dist/enrichment/enrichment.tools.context-read.d.ts +0 -10
- package/dist/enrichment/enrichment.tools.context-read.js +0 -353
- package/dist/enrichment/enrichment.tools.context-write.d.ts +0 -9
- package/dist/enrichment/enrichment.tools.context-write.js +0 -417
- package/dist/enrichment/enrichment.tools.d.ts +0 -13
- package/dist/enrichment/enrichment.tools.helpers.d.ts +0 -139
- package/dist/enrichment/enrichment.tools.helpers.js +0 -234
- package/dist/enrichment/enrichment.tools.js +0 -153
- package/dist/intents/graph/intent.graph.infer.d.ts +0 -44
- package/dist/intents/graph/intent.graph.infer.js +0 -97
- package/dist/intents/graph/intent.graph.js +0 -134
- package/dist/intents/graph/intent.graph.reconcile.js +0 -274
- package/dist/intents/graph/intent.graph.shared.d.ts +0 -68
- package/dist/intents/intake/intake.orchestrator.d.ts +0 -203
- package/dist/intents/intake/intake.orchestrator.js +0 -255
- package/dist/intents/intake/intake.pack.generator.d.ts +0 -57
- package/dist/intents/intake/intake.pack.generator.js +0 -90
- package/dist/intents/intent.clarifier.d.ts +0 -51
- package/dist/intents/intent.clarifier.js +0 -201
- package/dist/intents/intent.indexer.d.ts +0 -82
- package/dist/intents/intent.indexer.js +0 -170
- package/dist/intents/intent.module.js +0 -103
- package/dist/intents/intent.proposal.d.ts +0 -37
- package/dist/intents/intent.proposal.js +0 -14
- package/dist/intents/intent.reconciler.d.ts +0 -105
- package/dist/intents/intent.reconciler.js +0 -186
- package/dist/intents/intent.tools.d.ts +0 -27
- package/dist/intents/intent.tools.js +0 -808
- package/dist/maintenance/maintenance.graph.d.ts +0 -239
- package/dist/maintenance/maintenance.graph.js +0 -199
- package/dist/maintenance/maintenance.state.d.ts +0 -35
- package/dist/maintenance/maintenance.state.js +0 -55
- package/dist/mcp/elicitation.builder.d.ts +0 -53
- package/dist/mcp/elicitation.builder.js +0 -74
- package/dist/mcp/elicitation.dispatcher.d.ts +0 -36
- package/dist/mcp/elicitation.dispatcher.js +0 -86
- package/dist/mcp/mcp.authorization-policy.d.ts +0 -252
- package/dist/mcp/mcp.authorization-policy.js +0 -535
- package/dist/mcp/mcp.server.d.ts +0 -90
- package/dist/mcp/mcp.server.js +0 -631
- package/dist/negotiations/insight.generator.d.ts +0 -31
- package/dist/negotiations/insight.generator.js +0 -105
- package/dist/negotiations/negotiation.agent.d.ts +0 -130
- package/dist/negotiations/negotiation.agent.js +0 -396
- package/dist/negotiations/negotiation.answer-consumption.d.ts +0 -223
- package/dist/negotiations/negotiation.answer-consumption.js +0 -275
- package/dist/negotiations/negotiation.attribution.d.ts +0 -91
- package/dist/negotiations/negotiation.attribution.js +0 -109
- package/dist/negotiations/negotiation.candidates.d.ts +0 -83
- package/dist/negotiations/negotiation.candidates.js +0 -162
- package/dist/negotiations/negotiation.client-dm.d.ts +0 -50
- package/dist/negotiations/negotiation.client-dm.js +0 -66
- package/dist/negotiations/negotiation.consultation-policy.d.ts +0 -95
- package/dist/negotiations/negotiation.consultation-policy.js +0 -159
- package/dist/negotiations/negotiation.deadlock.contracts.d.ts +0 -10
- package/dist/negotiations/negotiation.deadlock.d.ts +0 -87
- package/dist/negotiations/negotiation.deadlock.js +0 -150
- package/dist/negotiations/negotiation.detail-reader.d.ts +0 -94
- package/dist/negotiations/negotiation.detail-reader.js +0 -91
- package/dist/negotiations/negotiation.expected-speaker.d.ts +0 -33
- package/dist/negotiations/negotiation.expected-speaker.js +0 -59
- package/dist/negotiations/negotiation.graph.d.ts +0 -694
- package/dist/negotiations/negotiation.graph.finalize.d.ts +0 -5
- package/dist/negotiations/negotiation.graph.finalize.js +0 -403
- package/dist/negotiations/negotiation.graph.init.d.ts +0 -54
- package/dist/negotiations/negotiation.graph.init.js +0 -256
- package/dist/negotiations/negotiation.graph.js +0 -94
- package/dist/negotiations/negotiation.graph.screen.d.ts +0 -23
- package/dist/negotiations/negotiation.graph.screen.js +0 -108
- package/dist/negotiations/negotiation.graph.shared.d.ts +0 -111
- package/dist/negotiations/negotiation.graph.shared.js +0 -168
- package/dist/negotiations/negotiation.graph.turn.d.ts +0 -134
- package/dist/negotiations/negotiation.graph.turn.js +0 -662
- package/dist/negotiations/negotiation.hermes-contract.d.ts +0 -31
- package/dist/negotiations/negotiation.hermes-contract.js +0 -72
- package/dist/negotiations/negotiation.intent-snapshot-provenance.d.ts +0 -21
- package/dist/negotiations/negotiation.intent-snapshot-provenance.js +0 -28
- package/dist/negotiations/negotiation.lifecycle-narration.d.ts +0 -18
- package/dist/negotiations/negotiation.lifecycle-narration.js +0 -87
- package/dist/negotiations/negotiation.memory.d.ts +0 -65
- package/dist/negotiations/negotiation.memory.js +0 -83
- package/dist/negotiations/negotiation.module.d.ts +0 -36
- package/dist/negotiations/negotiation.module.js +0 -23
- package/dist/negotiations/negotiation.protocol.d.ts +0 -1018
- package/dist/negotiations/negotiation.protocol.js +0 -224
- package/dist/negotiations/negotiation.question-safety.d.ts +0 -52
- package/dist/negotiations/negotiation.question-safety.js +0 -119
- package/dist/negotiations/negotiation.reflect.d.ts +0 -194
- package/dist/negotiations/negotiation.reflect.js +0 -145
- package/dist/negotiations/negotiation.scope.d.ts +0 -41
- package/dist/negotiations/negotiation.scope.js +0 -39
- package/dist/negotiations/negotiation.screen.contracts.d.ts +0 -88
- package/dist/negotiations/negotiation.screen.contracts.js +0 -58
- package/dist/negotiations/negotiation.screen.d.ts +0 -78
- package/dist/negotiations/negotiation.screen.js +0 -112
- package/dist/negotiations/negotiation.stall-gap.d.ts +0 -83
- package/dist/negotiations/negotiation.stall-gap.js +0 -152
- package/dist/negotiations/negotiation.stance.contracts.d.ts +0 -123
- package/dist/negotiations/negotiation.stance.contracts.js +0 -317
- package/dist/negotiations/negotiation.state.d.ts +0 -597
- package/dist/negotiations/negotiation.state.js +0 -286
- package/dist/negotiations/negotiation.summarizer.d.ts +0 -25
- package/dist/negotiations/negotiation.summarizer.js +0 -101
- package/dist/negotiations/negotiation.task-lock-policy.d.ts +0 -10
- package/dist/negotiations/negotiation.task-lock-policy.js +0 -22
- package/dist/negotiations/negotiation.tools.d.ts +0 -18
- package/dist/negotiations/negotiation.tools.js +0 -842
- package/dist/negotiations/negotiation.tools.port.d.ts +0 -17
- package/dist/negotiations/negotiation.turn-cap.d.ts +0 -9
- package/dist/negotiations/negotiation.turn-cap.js +0 -12
- package/dist/networks/indexer.state.js +0 -112
- package/dist/networks/network.tools.d.ts +0 -36
- package/dist/networks/network.tools.js +0 -594
- package/dist/opportunities/delivery-card.cache.d.ts +0 -25
- package/dist/opportunities/delivery-card.cache.js +0 -43
- package/dist/opportunities/discovery.env.d.ts +0 -20
- package/dist/opportunities/discovery.env.js +0 -109
- package/dist/opportunities/discriminator/discriminator.adjustments.d.ts +0 -90
- package/dist/opportunities/discriminator/discriminator.adjustments.js +0 -141
- package/dist/opportunities/discriminator/discriminator.assigner.d.ts +0 -78
- package/dist/opportunities/discriminator/discriminator.assigner.js +0 -153
- package/dist/opportunities/discriminator/discriminator.env.d.ts +0 -103
- package/dist/opportunities/discriminator/discriminator.env.js +0 -103
- package/dist/opportunities/discriminator/discriminator.miner.d.ts +0 -114
- package/dist/opportunities/discriminator/discriminator.miner.js +0 -228
- package/dist/opportunities/discriminator/discriminator.push.d.ts +0 -13
- package/dist/opportunities/discriminator/discriminator.push.js +0 -19
- package/dist/opportunities/discriminator/discriminator.question.d.ts +0 -58
- package/dist/opportunities/discriminator/discriminator.question.js +0 -155
- package/dist/opportunities/discriminator/discriminator.scorer.d.ts +0 -32
- package/dist/opportunities/discriminator/discriminator.scorer.js +0 -105
- package/dist/opportunities/discriminator/discriminator.shadow.d.ts +0 -32
- package/dist/opportunities/discriminator/discriminator.shadow.js +0 -90
- package/dist/opportunities/discriminator/discriminator.types.d.ts +0 -93
- package/dist/opportunities/discriminator/discriminator.types.js +0 -18
- package/dist/opportunities/negotiation-context.loader.d.ts +0 -59
- package/dist/opportunities/negotiation-context.loader.js +0 -90
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.env.d.ts +0 -43
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.env.js +0 -44
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.extractor.d.ts +0 -24
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.extractor.js +0 -188
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.miner.d.ts +0 -26
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.miner.js +0 -112
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.shadow.d.ts +0 -19
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.shadow.js +0 -61
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.types.d.ts +0 -191
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.types.js +0 -18
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.verifier.d.ts +0 -34
- package/dist/opportunities/negotiation-evidence/negotiation-evidence.verifier.js +0 -91
- package/dist/opportunities/negotiation-summary.builder.d.ts +0 -37
- package/dist/opportunities/negotiation-summary.builder.js +0 -66
- package/dist/opportunities/opportunity.discovery-negotiation-summary.d.ts +0 -14
- package/dist/opportunities/opportunity.discovery-negotiation-summary.js +0 -46
- package/dist/opportunities/opportunity.enricher.d.ts +0 -71
- package/dist/opportunities/opportunity.enricher.js +0 -280
- package/dist/opportunities/opportunity.evaluator.d.ts +0 -289
- package/dist/opportunities/opportunity.evaluator.js +0 -516
- package/dist/opportunities/opportunity.evidence.d.ts +0 -22
- package/dist/opportunities/opportunity.evidence.js +0 -87
- package/dist/opportunities/opportunity.existing-negotiation.d.ts +0 -79
- package/dist/opportunities/opportunity.existing-negotiation.js +0 -118
- package/dist/opportunities/opportunity.feed-selection.js +0 -96
- package/dist/opportunities/opportunity.graph.d.ts +0 -1611
- package/dist/opportunities/opportunity.graph.discovery-strategies.d.ts +0 -109
- package/dist/opportunities/opportunity.graph.discovery-strategies.js +0 -451
- package/dist/opportunities/opportunity.graph.discovery.d.ts +0 -69
- package/dist/opportunities/opportunity.graph.discovery.js +0 -397
- package/dist/opportunities/opportunity.graph.evaluation.d.ts +0 -82
- package/dist/opportunities/opportunity.graph.evaluation.js +0 -608
- package/dist/opportunities/opportunity.graph.js +0 -193
- package/dist/opportunities/opportunity.graph.modes.d.ts +0 -538
- package/dist/opportunities/opportunity.graph.modes.js +0 -538
- package/dist/opportunities/opportunity.graph.negotiate.d.ts +0 -109
- package/dist/opportunities/opportunity.graph.negotiate.js +0 -392
- package/dist/opportunities/opportunity.graph.persist-node.d.ts +0 -93
- package/dist/opportunities/opportunity.graph.persist-node.js +0 -765
- package/dist/opportunities/opportunity.graph.prep.d.ts +0 -150
- package/dist/opportunities/opportunity.graph.prep.js +0 -381
- package/dist/opportunities/opportunity.graph.shared.d.ts +0 -173
- package/dist/opportunities/opportunity.graph.shared.js +0 -199
- package/dist/opportunities/opportunity.introducer-feature.d.ts +0 -2
- package/dist/opportunities/opportunity.introducer-feature.js +0 -4
- package/dist/opportunities/opportunity.introducer.d.ts +0 -77
- package/dist/opportunities/opportunity.introducer.js +0 -99
- package/dist/opportunities/opportunity.labels.js +0 -10
- package/dist/opportunities/opportunity.lifecycle.d.ts +0 -63
- package/dist/opportunities/opportunity.lifecycle.js +0 -181
- package/dist/opportunities/opportunity.module.d.ts +0 -54
- package/dist/opportunities/opportunity.module.js +0 -39
- package/dist/opportunities/opportunity.newborn-stamping.d.ts +0 -41
- package/dist/opportunities/opportunity.newborn-stamping.js +0 -81
- package/dist/opportunities/opportunity.owner-approval.d.ts +0 -118
- package/dist/opportunities/opportunity.owner-approval.js +0 -34
- package/dist/opportunities/opportunity.owner-provenance.d.ts +0 -6
- package/dist/opportunities/opportunity.owner-provenance.js +0 -28
- package/dist/opportunities/opportunity.persist.d.ts +0 -58
- package/dist/opportunities/opportunity.persist.js +0 -145
- package/dist/opportunities/opportunity.persistence-admission.d.ts +0 -39
- package/dist/opportunities/opportunity.persistence-admission.js +0 -59
- package/dist/opportunities/opportunity.state.d.ts +0 -451
- package/dist/opportunities/opportunity.state.js +0 -256
- package/dist/opportunities/opportunity.tools.cards.d.ts +0 -138
- package/dist/opportunities/opportunity.tools.cards.js +0 -212
- package/dist/opportunities/opportunity.tools.d.ts +0 -12
- package/dist/opportunities/opportunity.tools.js +0 -236
- package/dist/opportunities/opportunity.tools.list.d.ts +0 -10
- package/dist/opportunities/opportunity.tools.list.js +0 -489
- package/dist/opportunities/opportunity.tools.port.d.ts +0 -16
- package/dist/opportunities/opportunity.utils.d.ts +0 -217
- package/dist/opportunities/opportunity.utils.js +0 -395
- package/dist/opportunities/outcome/outcome.env.d.ts +0 -60
- package/dist/opportunities/outcome/outcome.env.js +0 -63
- package/dist/opportunities/outcome/outcome.hypotheses.d.ts +0 -29
- package/dist/opportunities/outcome/outcome.hypotheses.js +0 -117
- package/dist/opportunities/outcome/outcome.shadow.d.ts +0 -56
- package/dist/opportunities/outcome/outcome.shadow.js +0 -87
- package/dist/opportunities/outcome/outcome.types.d.ts +0 -110
- package/dist/opportunities/outcome/outcome.types.js +0 -26
- package/dist/opportunities/radar/radar.health.d.ts +0 -31
- package/dist/opportunities/radar/radar.health.js +0 -75
- package/dist/premises/premise.analyzer.d.ts +0 -35
- package/dist/premises/premise.analyzer.js +0 -115
- package/dist/premises/premise.decomposer.d.ts +0 -69
- package/dist/premises/premise.decomposer.js +0 -213
- package/dist/premises/premise.graph.d.ts +0 -345
- package/dist/premises/premise.graph.js +0 -278
- package/dist/premises/premise.indexer.d.ts +0 -35
- package/dist/premises/premise.indexer.js +0 -86
- package/dist/premises/premise.state.d.ts +0 -67
- package/dist/premises/premise.state.js +0 -94
- package/dist/premises/premise.tools.d.ts +0 -3
- package/dist/premises/premise.tools.js +0 -248
- package/dist/questions/question.env.d.ts +0 -27
- package/dist/questions/question.env.js +0 -27
- package/dist/questions/question.input.d.ts +0 -107
- package/dist/questions/question.module.d.ts +0 -30
- package/dist/questions/question.module.js +0 -28
- package/dist/questions/question.schema.d.ts +0 -1529
- package/dist/questions/question.schema.js +0 -420
- package/dist/shared/agent/activity-projection.d.ts +0 -271
- package/dist/shared/agent/activity-projection.js +0 -254
- package/dist/shared/agent/canonical-guidance.d.ts +0 -30
- package/dist/shared/agent/canonical-guidance.js +0 -246
- package/dist/shared/agent/model.resolver.d.ts +0 -48
- package/dist/shared/agent/tool.factory.d.ts +0 -17
- package/dist/shared/agent/tool.factory.js +0 -221
- package/dist/shared/agent/tool.helpers.d.ts +0 -482
- package/dist/shared/agent/tool.helpers.js +0 -232
- package/dist/shared/agent/tool.registry.d.ts +0 -25
- package/dist/shared/agent/tool.registry.js +0 -76
- package/dist/shared/agent/tool.runtime.d.ts +0 -28
- package/dist/shared/agent/tool.runtime.js +0 -194
- package/dist/shared/agent/tool.scope.d.ts +0 -44
- package/dist/shared/agent/tool.scope.js +0 -50
- package/dist/shared/agent/utility.tools.d.ts +0 -15
- package/dist/shared/agent/utility.tools.js +0 -322
- package/dist/shared/assignment/network-assignment.policy.d.ts +0 -61
- package/dist/shared/assignment/network-assignment.policy.js +0 -105
- package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +0 -100
- package/dist/shared/interfaces/agent-dispatcher.interface.js +0 -12
- package/dist/shared/interfaces/auth.interface.d.ts +0 -37
- package/dist/shared/interfaces/auth.interface.js +0 -1
- package/dist/shared/interfaces/chat-message-writer.interface.d.ts +0 -18
- package/dist/shared/interfaces/chat-message-writer.interface.js +0 -1
- package/dist/shared/interfaces/chat-session.interface.d.ts +0 -23
- package/dist/shared/interfaces/chat-session.interface.js +0 -18
- package/dist/shared/interfaces/chat-summary.interface.d.ts +0 -16
- package/dist/shared/interfaces/chat-summary.interface.js +0 -1
- package/dist/shared/interfaces/database.capabilities.d.ts +0 -100
- package/dist/shared/interfaces/database.interface.d.ts +0 -16
- package/dist/shared/interfaces/database.member-queries.d.ts +0 -219
- package/dist/shared/interfaces/database.member-queries.js +0 -4
- package/dist/shared/interfaces/database.negotiation.d.ts +0 -329
- package/dist/shared/interfaces/database.negotiation.js +0 -26
- package/dist/shared/interfaces/database.network-queries.js +0 -4
- package/dist/shared/interfaces/database.opportunity-queries.js +0 -4
- package/dist/shared/interfaces/delivery-ledger.interface.d.ts +0 -40
- package/dist/shared/interfaces/delivery-ledger.interface.js +0 -5
- package/dist/shared/interfaces/embedder.interface.d.ts +0 -92
- package/dist/shared/interfaces/embedder.interface.js +0 -4
- package/dist/shared/interfaces/enrichment-run.interface.d.ts +0 -62
- package/dist/shared/interfaces/enrichment-run.interface.js +0 -1
- package/dist/shared/interfaces/enrichment.interface.js +0 -1
- package/dist/shared/interfaces/negotiation-events.interface.d.ts +0 -77
- package/dist/shared/interfaces/negotiation-events.interface.js +0 -6
- package/dist/shared/interfaces/negotiation-summary.interface.d.ts +0 -25
- package/dist/shared/interfaces/negotiation-summary.interface.js +0 -1
- package/dist/shared/interfaces/negotiator-memory.interface.d.ts +0 -58
- package/dist/shared/interfaces/negotiator-memory.interface.js +0 -11
- package/dist/shared/interfaces/queue.interface.d.ts +0 -23
- package/dist/shared/interfaces/queue.interface.js +0 -4
- package/dist/shared/interfaces/scraper.interface.js +0 -1
- package/dist/shared/interfaces/tool-request-context.interface.d.ts +0 -11
- package/dist/shared/interfaces/tool-request-context.interface.js +0 -1
- package/dist/shared/observability/request-context.d.ts +0 -27
- package/dist/shared/observability/request-context.js +0 -6
- package/dist/shared/schemas/mcp-auth.schema.d.ts +0 -87
- package/dist/shared/schemas/mcp-auth.schema.js +0 -56
- package/dist/shared/schemas/negotiation-digest.schema.d.ts +0 -58
- package/dist/shared/schemas/negotiation-digest.schema.js +0 -38
- package/dist/shared/schemas/negotiation-state.schema.d.ts +0 -343
- package/dist/shared/schemas/negotiation-state.schema.js +0 -81
- package/dist/shared/schemas/question-block.fixture.d.ts +0 -12
- package/dist/shared/schemas/question-block.fixture.js +0 -39
- package/dist/shared/schemas/question-block.schema.d.ts +0 -111
- package/dist/shared/schemas/question-block.schema.js +0 -124
- package/dist/shared/schemas/structured-question.schema.d.ts +0 -66
- package/dist/shared/schemas/structured-question.schema.js +0 -31
- package/dist/shared/schemas/underspecification.schema.d.ts +0 -13
- package/dist/shared/schemas/underspecification.schema.js +0 -16
- /package/dist/{opportunities → internal/opportunities}/opportunity.update-admission.js +0 -0
- /package/dist/{opportunities → internal/opportunities}/radar/radar.state.js +0 -0
- /package/dist/{shared → internal/shared}/network/metadata.renderer.d.ts +0 -0
- /package/dist/{shared → internal/shared}/network/metadata.renderer.js +0 -0
- /package/dist/{shared → internal/shared}/observability/debug-meta.sanitizer.d.ts +0 -0
- /package/dist/{shared → internal/shared}/observability/debug-meta.sanitizer.js +0 -0
- /package/dist/{shared → internal/shared}/observability/performance.d.ts +0 -0
- /package/dist/{shared → internal/shared}/observability/performance.js +0 -0
- /package/dist/{shared → internal/shared}/observability/trace.d.ts +0 -0
- /package/dist/{shared → internal/shared}/observability/trace.js +0 -0
- /package/dist/{shared → internal/shared}/utils/claim-safety.d.ts +0 -0
- /package/dist/{shared → internal/shared}/utils/claim-safety.js +0 -0
- /package/dist/{shared → internal/shared}/utils/telegram-handle.d.ts +0 -0
- /package/dist/{shared → internal/shared}/utils/telegram-handle.js +0 -0
- /package/dist/{shared/interfaces/database.capabilities.js → platform/database/capabilities.js} +0 -0
- /package/dist/{shared/interfaces/database.entities.js → platform/database/entities.js} +0 -0
- /package/dist/{shared/interfaces/database.identity-queries.js → platform/database/identity-queries.js} +0 -0
- /package/dist/{agents/agent.dispatcher.port.js → platform/database/negotiation.js} +0 -0
- /package/dist/{chat/chat.persona.js → platform/database/opportunity-queries.js} +0 -0
- /package/dist/{contexts/context.tools.port.js → platform/discovery/embedder.js} +0 -0
- /package/dist/{shared/interfaces/scraper.interface.d.ts → platform/discovery/scraper.d.ts} +0 -0
- /package/dist/{negotiations/negotiation.deadlock.contracts.js → platform/discovery/scraper.js} +0 -0
- /package/dist/{shared/interfaces/enrichment.interface.d.ts → platform/enrichment/ports.d.ts} +0 -0
- /package/dist/{negotiations/negotiation.tools.port.js → platform/enrichment/ports.js} +0 -0
- /package/dist/{opportunities/opportunity.tools.port.js → platform/runtime/observability.js} +0 -0
- /package/dist/{questions/question.input.js → protocol/core.js} +0 -0
- /package/dist/{shared → protocol}/schemas/chat-context.schema.d.ts +0 -0
- /package/dist/{shared → protocol}/schemas/chat-context.schema.js +0 -0
package/IMPLEMENTATION.md
CHANGED
|
@@ -10,20 +10,68 @@ supported entry point is the package root (`import { ... } from "@indexnetwork/p
|
|
|
10
10
|
deep imports are not part of the contract. Every symbol is re-exported explicitly from
|
|
11
11
|
`src/index.ts` and tagged with a stability tier:
|
|
12
12
|
|
|
13
|
-
- **Stable** — interfaces, graph factories, agents,
|
|
14
|
-
|
|
13
|
+
- **Stable** — interfaces, graph factories, agents, and shared schemas.
|
|
14
|
+
Breaking changes require a major bump.
|
|
15
15
|
- **Experimental** (`@experimental`) — advanced graph-state types and internal
|
|
16
16
|
helpers; may change in a minor release.
|
|
17
17
|
|
|
18
18
|
See [STABILITY.md](./STABILITY.md) for the full policy and the deprecation path,
|
|
19
19
|
and [CHANGELOG.md](./CHANGELOG.md) for release history.
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
`
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
Private source under `src/internal/` is domain-first: `agents`, `networks`,
|
|
22
|
+
`opportunities`, with `shared` for cross-cutting model and scope
|
|
23
|
+
helpers. The `intents` capability is
|
|
24
|
+
organized by function behind a single exported class, `Intents`: files sit flat
|
|
25
|
+
and named for what they do, with `graph/` the one multi-file stage
|
|
26
|
+
that keep a directory.
|
|
27
|
+
|
|
28
|
+
`Negotiations` is the autonomous participation capability. It observes current
|
|
29
|
+
state and returns protocol guidance, available actions, and block reasons. Its
|
|
30
|
+
execute path passes a pure protocol decision function into the host's transaction:
|
|
31
|
+
the host locks current membership, intent, and negotiation state, evaluates the
|
|
32
|
+
function, and atomically applies the turn and opportunity transition.
|
|
33
|
+
`openCounterparties` likewise receives the protocol's opening decision callback.
|
|
34
|
+
The protocol enforces 12 total turns, leaving exhausted matches undecided, and
|
|
35
|
+
A2A agreement only advances to pending owner review. `NegotiationContextDatabase`
|
|
36
|
+
continues to provide scoped turn logs for opportunity presentation.
|
|
37
|
+
|
|
38
|
+
Personal-agent reasoning and H2A communication live in the independent
|
|
39
|
+
`@indexnetwork/agent` package. The API imports both libraries and supplies
|
|
40
|
+
persistence, principal context, models, and events. The scenario TUI uses the same
|
|
41
|
+
protocol capability with memory storage. Neither library imports the other.
|
|
42
|
+
|
|
43
|
+
## Boundary model
|
|
44
|
+
|
|
45
|
+
The package is migrating incrementally to a protocol kernel. `protocol/`
|
|
46
|
+
contains portable, framework-free contracts and shared protocol instructions; `platform/` contains host-facing
|
|
47
|
+
ports and supported runtime hooks; and `capabilities/` exposes small named
|
|
48
|
+
behavior surfaces. Graphs, internal model prompts, retrieval, and agent helpers remain
|
|
49
|
+
private implementation. These are source boundaries only: import supported
|
|
50
|
+
symbols from `@indexnetwork/protocol`, not source subpaths. See
|
|
51
|
+
[docs/protocol-kernel.md](./docs/protocol-kernel.md) for migration status.
|
|
52
|
+
|
|
53
|
+
## Shared protocol instructions
|
|
54
|
+
|
|
55
|
+
[`src/protocol/protocol.prompt.ts`](./src/protocol/protocol.prompt.ts) owns shared
|
|
56
|
+
protocol instruction text in named constants. The module depends only
|
|
57
|
+
on the negotiation limits, with no models, hosts, environment variables, or
|
|
58
|
+
transport implementations.
|
|
59
|
+
|
|
60
|
+
| Prompt or content | Consumer |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `NEGOTIATION_GUIDANCE` | `protocol/negotiation.rules.ts`: `observeNegotiation` returns it to negotiation hosts; also the canonical `negotiations` topic |
|
|
63
|
+
| `CANONICAL_GUIDANCE_SUMMARY`, `CANONICAL_GUIDANCE_TOPICS`, `CANONICAL_GUIDANCE_TOPICS_CONTENT` | The host's `GET /api/docs`: summary, topic metadata, and canonical sections |
|
|
64
|
+
|
|
65
|
+
The host picks the topic and shapes the response.
|
|
66
|
+
`negotiation.rules.ts` keeps validation and transitions. Guidance and enforcement
|
|
67
|
+
share limits from
|
|
68
|
+
[`src/protocol/negotiation.constants.ts`](./src/protocol/negotiation.constants.ts).
|
|
69
|
+
Internal model prompts and personal-agent prompt composition stay with their
|
|
70
|
+
existing owners.
|
|
71
|
+
|
|
72
|
+
These paths describe internal ownership, not new public APIs. The package root
|
|
73
|
+
continues to export `NEGOTIATION_GUIDANCE`, `NEGOTIATION_MAX_TURNS`, and
|
|
74
|
+
`NEGOTIATION_MESSAGE_LIMIT` directly from their owning modules.
|
|
27
75
|
|
|
28
76
|
|
|
29
77
|
## Install
|
|
@@ -38,118 +86,55 @@ npm install @indexnetwork/protocol
|
|
|
38
86
|
|
|
39
87
|
The package reads `OPENROUTER_API_KEY` (required), `CHAT_MODEL`, and `CHAT_REASONING_EFFORT` from environment variables. No startup call is needed.
|
|
40
88
|
|
|
41
|
-
Environment variables are the supported way to configure models. `CHAT_MODEL` and `CHAT_REASONING_EFFORT` (`minimal | low | medium | high | xhigh`) drive the
|
|
89
|
+
Environment variables are the supported way to configure models. `CHAT_MODEL` and `CHAT_REASONING_EFFORT` (`minimal | low | medium | high | xhigh`) drive the default model; every protocol agent reads `OPENROUTER_API_KEY` from the environment.
|
|
42
90
|
|
|
43
|
-
|
|
91
|
+
Programmatic model override is not part of the public contract — use the environment variables. If you need a typed override path, open an issue rather than reaching through a deep import.
|
|
44
92
|
|
|
45
93
|
### 2. Implement the adapters
|
|
46
94
|
|
|
47
95
|
The package defines interfaces — your application provides the concrete implementations.
|
|
48
96
|
|
|
49
|
-
**Required** (always needed by the
|
|
97
|
+
**Required** (always needed by the graphs):
|
|
50
98
|
|
|
51
99
|
| Interface | Responsibility |
|
|
52
100
|
|---|---|
|
|
53
|
-
| `
|
|
101
|
+
| `CompositeDatabase` | Core data access (users, intents, networks, opportunities) |
|
|
54
102
|
| `UserDatabase` / `SystemDatabase` | Context-bound databases built by `createUserDatabase` / `createSystemDatabase` |
|
|
55
103
|
| `Embedder` | Vector embeddings for semantic search |
|
|
56
104
|
| `Scraper` | Web content extraction |
|
|
57
|
-
| `Cache` / `
|
|
58
|
-
| `
|
|
59
|
-
| `IntentGraphQueue` | Background intent processing queue |
|
|
60
|
-
| `ContactServiceAdapter` | Contact management |
|
|
61
|
-
| `ChatSessionReader` | Load conversation history |
|
|
105
|
+
| `Cache` / `OpportunityCache` | Presentation/result caching |
|
|
106
|
+
| `IntentFollowUp` | Lifecycle follow-up (`scoreIntent`, `onIntentSaved`, `onIntentArchived`, `onIntentResumed`) |
|
|
62
107
|
| `ProfileEnricher` | Enrich profiles from external sources |
|
|
63
|
-
| `
|
|
108
|
+
| `NegotiationDatabase` | Current negotiation state and atomic commit with the supplied protocol decision function |
|
|
109
|
+
| `NegotiationContextDatabase` | Read-only negotiation turn log, for opportunity presentation (folded into `CompositeDatabase`) |
|
|
64
110
|
|
|
65
111
|
**Optional** (enable specific capabilities; omit to run without that feature):
|
|
66
112
|
|
|
67
113
|
| Interface | Responsibility |
|
|
68
114
|
|---|---|
|
|
69
|
-
| `AgentDatabase` | Agent registry CRUD (agents,
|
|
70
|
-
| `AgentDispatcher` | Resolves and invokes personal agents during negotiation turns — required to register the negotiation tools |
|
|
71
|
-
| `McpAuthResolver` | Resolves `{ userId, agentId }` from an incoming MCP HTTP request (MCP server only) |
|
|
72
|
-
| `DeliveryLedger` | Commits OpenClaw opportunity-delivery rows |
|
|
73
|
-
| `EnrichmentRunStore` / `EnrichmentRunQueue` | Persist and execute async MCP enrichment runs |
|
|
74
|
-
| `MintConnectLink` | Mints short connect links for opportunity accepts |
|
|
75
|
-
| `ChatSummaryReader` | Read-through chat-session digest |
|
|
76
|
-
| `ChatMessageWriter` | Writes user messages into the most-recent chat session (MCP elicitation) |
|
|
77
|
-
| `QuestionGeneratorReader` / `QuestionerDatabase` | Decision-question generation and persistence |
|
|
78
|
-
| `NegotiationSummaryReader` | Negotiation-digest summarization (falls back to deterministic digests) |
|
|
115
|
+
| `AgentDatabase` | Agent registry CRUD (agents, permissions) |
|
|
79
116
|
|
|
80
117
|
All interfaces are exported from the package root — import them with `import type { ... } from "@indexnetwork/protocol"`.
|
|
81
118
|
|
|
82
|
-
### 3.
|
|
83
|
-
|
|
84
|
-
Two entry points are supported, both taking a single dependency object built
|
|
85
|
-
from the adapters above.
|
|
86
|
-
|
|
87
|
-
`createMcpServer` is the complete integration: it composes every capability's
|
|
88
|
-
tools internally, applies the authorization policy, and returns a ready MCP
|
|
89
|
-
server.
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
import { createMcpServer, CANONICAL_MCP_CAPABILITY_POLICY_OPTIONS } from "@indexnetwork/protocol";
|
|
93
|
-
|
|
94
|
-
const server = createMcpServer(
|
|
95
|
-
deps, // ToolDeps + the opportunity owner-approval port
|
|
96
|
-
authResolver, // McpAuthResolver
|
|
97
|
-
scopedDepsFactory, // ScopedDepsFactory — builds per-user scoped userDb/systemDb
|
|
98
|
-
CANONICAL_MCP_CAPABILITY_POLICY_OPTIONS,
|
|
99
|
-
authorizationObserver, // optional McpAuthorizationObserver
|
|
100
|
-
);
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
`createToolRegistry` is the lower-level surface for hosts running their own
|
|
104
|
-
runtime. It returns a `Map` of tool name to `RawToolDefinition` — raw async
|
|
105
|
-
handlers taking `{ context, query }` — which you invoke through
|
|
106
|
-
`invokeToolRuntime`:
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
import { createToolRegistry, invokeToolRuntime, resolveChatContext } from "@indexnetwork/protocol";
|
|
110
|
-
|
|
111
|
-
const registry = createToolRegistry(deps, { surface: "mcp" }); // omit `surface` for the full REST set
|
|
112
|
-
|
|
113
|
-
const context = await resolveChatContext({
|
|
114
|
-
database, // the ChatGraphCompositeDatabase reads listed above
|
|
115
|
-
userId: "user-uuid",
|
|
116
|
-
networkId, // optional — scopes tools to one network
|
|
117
|
-
sessionId, // optional — enables draft opportunities
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const tool = registry.get("search_intents")!;
|
|
121
|
-
const result = await invokeToolRuntime({
|
|
122
|
-
toolName: tool.name,
|
|
123
|
-
tool,
|
|
124
|
-
context,
|
|
125
|
-
query: { /* validated against tool.schema */ },
|
|
126
|
-
});
|
|
127
|
-
```
|
|
119
|
+
### 3. Compile the graphs
|
|
128
120
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
Intent/network graph factories take the adapters above and return compiled LangGraphs.
|
|
122
|
+
Opportunity read and lifecycle operations are plain async functions. The database ports
|
|
123
|
+
`updateOpportunityStatus(id, status, acceptedBy?)` and
|
|
124
|
+
`stampOpportunityActorAction(id, actorUserId, status, acceptedBy?)` do not capture
|
|
125
|
+
outcome feedback or accept an outbox. Negotiation outcomes remain part of the
|
|
126
|
+
negotiation state and presentation contracts.
|
|
132
127
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
package-internal as of 15.0.0 and are not part of the supported surface.
|
|
136
|
-
`createEnrichmentTools` remains exported for hosts that run enrichment on its
|
|
137
|
-
own worker, separately from the chat runtime.
|
|
128
|
+
Optional capabilities default to a
|
|
129
|
+
degraded-but-functional mode when omitted.
|
|
138
130
|
|
|
139
131
|
## Graphs
|
|
140
132
|
|
|
141
|
-
|
|
133
|
+
A `*GraphFactory` class is exported for each workflow:
|
|
142
134
|
|
|
143
135
|
```typescript
|
|
144
136
|
import {
|
|
145
|
-
ChatGraphFactory,
|
|
146
|
-
OpportunityGraphFactory,
|
|
147
|
-
EnrichmentGraphFactory,
|
|
148
|
-
PremiseGraphFactory,
|
|
149
|
-
NegotiationGraphFactory,
|
|
150
|
-
HydeGraphFactory,
|
|
151
137
|
RadarGraphFactory,
|
|
152
|
-
MaintenanceGraphFactory,
|
|
153
138
|
} from "@indexnetwork/protocol";
|
|
154
139
|
```
|
|
155
140
|
|
|
@@ -162,24 +147,32 @@ The intent and community graphs are the exceptions: they are reached through the
|
|
|
162
147
|
|
|
163
148
|
| Factory | Workflow |
|
|
164
149
|
|---|---|
|
|
165
|
-
| `ChatGraphFactory` | ReAct chat loop — LLM calls tools, responds to the user |
|
|
166
|
-
| `OpportunityGraphFactory` | Background matching: search, evaluate (valency), rank, persist |
|
|
167
|
-
| `EnrichmentGraphFactory` | Enrich users (scrape + embed) and decompose into premises |
|
|
168
|
-
| `PremiseGraphFactory` | Decompose and index a user's premises |
|
|
169
|
-
| `NegotiationGraphFactory` | Multi-turn bilateral negotiation flows |
|
|
170
|
-
| `HydeGraphFactory` | Generate hypothetical documents and embed them (cache-aware) |
|
|
171
150
|
| `RadarGraphFactory` | Build the radar view: flat presenter-card list, optionally intent-scoped |
|
|
172
|
-
| `MaintenanceGraphFactory` | Periodic maintenance (feed health, opportunity expiration) |
|
|
173
151
|
|
|
174
|
-
|
|
152
|
+
## On-demand discovery
|
|
175
153
|
|
|
176
|
-
|
|
154
|
+
Discovery is not a protocol workflow and does not run when a signal is written.
|
|
155
|
+
The host exposes it as a search: the owner's agent sends a query, the host
|
|
156
|
+
embeds it and retrieves candidate signals from the communities that signal is
|
|
157
|
+
shared in, and the agent picks which counterparties are worth an opportunity.
|
|
158
|
+
Nothing is generated ahead of the query and nothing is cached.
|
|
159
|
+
|
|
160
|
+
Protocol owns only what the picks are committed with. The host assigns
|
|
161
|
+
`pairKeyOf(...)` and calls `openCounterparties(pairs, decideNegotiationOpening)`,
|
|
162
|
+
which writes the opportunity and its negotiation; opening rules run inside the
|
|
163
|
+
existing host transaction. Network/broadcast scope remains a protocol rule
|
|
164
|
+
exposed through `resolveDiscoveryNetworkScope`, with context permissions handled
|
|
165
|
+
by `renderDiscoveryNetworkContext`.
|
|
166
|
+
|
|
167
|
+
`IntentFollowUp` therefore has no matching work to schedule: `onIntentSaved`,
|
|
168
|
+
`onIntentArchived`, and `onIntentResumed` exist for hosts that want them and may
|
|
169
|
+
do nothing. `scoreIntent` remains independent metadata work.
|
|
177
170
|
|
|
178
171
|
## Intents
|
|
179
172
|
|
|
180
173
|
Signals are the protocol's base unit, and the whole capability ships as one
|
|
181
|
-
class. `Intents` covers the lifecycle graph, semantic verification,
|
|
182
|
-
|
|
174
|
+
class. `Intents` covers the lifecycle graph, semantic verification, and payload
|
|
175
|
+
clarification.
|
|
183
176
|
|
|
184
177
|
```typescript
|
|
185
178
|
import { Intents } from "@indexnetwork/protocol";
|
|
@@ -187,8 +180,7 @@ import { Intents } from "@indexnetwork/protocol";
|
|
|
187
180
|
const intents = new Intents({
|
|
188
181
|
database, // IntentGraphDatabase — required only by createGraph()
|
|
189
182
|
embedder, // EmbeddingGenerator
|
|
190
|
-
|
|
191
|
-
questionerEnqueue, // QuestionerEnqueueFn
|
|
183
|
+
followUp, // IntentFollowUp
|
|
192
184
|
});
|
|
193
185
|
```
|
|
194
186
|
|
|
@@ -198,108 +190,75 @@ first use, so an unused method costs nothing.
|
|
|
198
190
|
|
|
199
191
|
| Method | Purpose |
|
|
200
192
|
|---|---|
|
|
201
|
-
| `createGraph()` |
|
|
193
|
+
| `createGraph()` | Prepare and create exactly one new signal; explicitly read, update, archive, or transition existing signals. Requires `database` |
|
|
202
194
|
| `verifyIntent(content, profileContext)` | Felicity conditions, speech-act classification, semantic entropy, specificity |
|
|
203
|
-
| `
|
|
204
|
-
| `
|
|
205
|
-
| `
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
195
|
+
| `prepare({ payload, answers? })` | Fold recovery answers into the draft, then return `ready` with metadata or `needs_revision` with admission feedback and a dynamic recovery form; model failures throw for retry |
|
|
196
|
+
| `scoreIntent(content, profileContext?)` | Measure saved text without admission filters; a negative verdict still returns metadata |
|
|
197
|
+
| `Intents.normalizeDescription(description)` | Normalize an explicit update description; creation preserves text verbatim |
|
|
198
|
+
|
|
199
|
+
Creation with `inputContent` prepares the description once and persists that exact
|
|
200
|
+
text in a new record, even if a similar signal exists. Guided hosts call `prepare`
|
|
201
|
+
until it returns `ready`, then issue their own authenticated preparation receipt
|
|
202
|
+
bound to the owner and admitted draft. After authenticating the receipt, pass
|
|
203
|
+
`preparation: { metadata }` to `createGraph().invoke()` alongside the final
|
|
204
|
+
`inputContent`. If the user edited the text, pass `metadata: null`: permission to
|
|
205
|
+
create survives revisions, but the draft's scores do not describe the edited text.
|
|
206
|
+
Never accept this graph input directly from an untrusted client.
|
|
207
|
+
|
|
208
|
+
No inference, admission, or reconciliation runs on prepared creation. The graph
|
|
209
|
+
persists first and invokes `IntentFollowUp.scoreIntent` for revised text. Hosts
|
|
210
|
+
must run scoring as best-effort background work, apply only metadata while the
|
|
211
|
+
owner and payload still match, and leave the saved record usable on negative
|
|
212
|
+
verdicts or failures. Authentication, nonempty text, length limits, and network
|
|
213
|
+
membership remain the host's responsibility.
|
|
210
214
|
|
|
211
215
|
## Networks
|
|
212
216
|
|
|
213
217
|
Communities ship the same way: one class covering the community lifecycle graph,
|
|
214
|
-
the membership graph, signal↔community assignment
|
|
215
|
-
community tools.
|
|
218
|
+
the membership graph, and signal↔community assignment.
|
|
216
219
|
|
|
217
220
|
```typescript
|
|
218
221
|
import { Networks } from "@indexnetwork/protocol";
|
|
219
222
|
|
|
220
223
|
const networks = new Networks({
|
|
221
|
-
database,
|
|
222
|
-
indexer: intents, // an `Intents` instance — scores a signal against a community
|
|
224
|
+
database, // community, roster, and assignment persistence
|
|
223
225
|
});
|
|
224
226
|
```
|
|
225
227
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
+
The dependency is optional; each method names what it requires, so
|
|
229
|
+
construction never fails.
|
|
228
230
|
|
|
229
231
|
| Method | Purpose |
|
|
230
232
|
|---|---|
|
|
231
233
|
| `createGraph()` | Compile the community lifecycle graph — create, read, update, delete. Requires `database` |
|
|
232
234
|
| `createMembershipGraph()` | Compile the roster graph — add, list, remove members. Requires `database` |
|
|
233
|
-
| `createAssignmentGraph()` | Compile signal↔community assignment
|
|
234
|
-
| `Networks.createTools(defineTool, deps)` | Register the agent-facing community tools |
|
|
235
|
+
| `createAssignmentGraph()` | Compile signal↔community assignment — link and unlink. Requires `database` |
|
|
235
236
|
|
|
236
|
-
Assignment
|
|
237
|
-
|
|
237
|
+
Assignment applies no scoring policy: a link exists because the signal's owner
|
|
238
|
+
asked for it, so the row is written at score 1 with `mode: manual_override`.
|
|
238
239
|
|
|
239
|
-
##
|
|
240
|
+
## The REST API and the CLI
|
|
240
241
|
|
|
241
|
-
|
|
242
|
+
External agents use `@indexnetwork/cli` against the host's REST API. Every
|
|
243
|
+
capability is a named resource — `/api/intents`, `/api/networks`,
|
|
244
|
+
`/api/opportunities`, `/api/negotiations`, `/api/conversations`, `/api/scrape`,
|
|
245
|
+
`/api/docs` — and the user's single event stream is `GET /api/events`. Ownership
|
|
246
|
+
and network membership checks live in the host's controllers and services.
|
|
242
247
|
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
async resolveIdentity(req) {
|
|
248
|
-
// Look up the API key in `x-api-key` and return { userId, agentId? }.
|
|
249
|
-
// `agentId` should come from Better Auth token metadata so downstream
|
|
250
|
-
// tool handlers can attribute every call to a concrete agent identity.
|
|
251
|
-
return resolveFromApiKey(req);
|
|
252
|
-
},
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
const server = createMcpServer(
|
|
256
|
-
deps,
|
|
257
|
-
authResolver,
|
|
258
|
-
{
|
|
259
|
-
// Per-request factory for scoped user/system databases.
|
|
260
|
-
create: (userId, indexScope) => createScopedDeps(userId, indexScope),
|
|
261
|
-
},
|
|
262
|
-
);
|
|
248
|
+
```bash
|
|
249
|
+
index --api-url https://protocol.index.network docs --json
|
|
250
|
+
index --api-url https://protocol.index.network docs workflows --json
|
|
251
|
+
index --api-url https://protocol.index.network intent list --json
|
|
263
252
|
```
|
|
264
253
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
- **Session humans** administer their owned agents (`register_agent`, `list_agents`, `update_agent`, `delete_agent`, `grant_agent_permission`, `revoke_agent_permission`) but are never offered the agent-only `read_own_agent`.
|
|
274
|
-
- Contact/Gmail-import tools, `scrape_url`, and the deprecated `*_user_profile`/`*_profile_run` aliases are not registered on the MCP surface at all (IND-596/597/598).
|
|
275
|
-
4. Builds per-request scoped databases via `scopedDepsFactory` and invokes the tool handler through the shared runtime.
|
|
276
|
-
|
|
277
|
-
### Runtime controls
|
|
278
|
-
|
|
279
|
-
MCP tools are bounded by `ToolInvocationRuntime`:
|
|
280
|
-
|
|
281
|
-
| Class | Default | Class override |
|
|
282
|
-
|---|---:|---|
|
|
283
|
-
| `fast` | 10 s | `MCP_TOOL_TIMEOUT_FAST_MS` |
|
|
284
|
-
| `bounded_slow` | 45 s | `MCP_TOOL_TIMEOUT_BOUNDED_SLOW_MS` |
|
|
285
|
-
| `async_candidate` | 50 s | `MCP_TOOL_TIMEOUT_ASYNC_CANDIDATE_MS` |
|
|
286
|
-
|
|
287
|
-
Per-tool timeout overrides use `MCP_TOOL_TIMEOUT_<TOOL_NAME>_MS`. Tool outputs are capped by `MCP_TOOL_MAX_OUTPUT_BYTES` (default `1000000`) or `MCP_TOOL_MAX_OUTPUT_<TOOL_NAME>_BYTES`; inbound MCP request bodies are capped by the backend with `MCP_MAX_REQUEST_BYTES` (default `1000000`). Runtime failures return JSON text envelopes with stable `code` values: `TOOL_TIMEOUT`, `TOOL_CANCELLED`, or `TOOL_OUTPUT_TOO_LARGE`.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
### `MCP_INSTRUCTIONS`
|
|
291
|
-
|
|
292
|
-
The instructions string is the single canonical behavioral contract for every runtime that connects to Index Network — voice, entity model, discovery-first rule, output rules, and the **Negotiation turn mode** block that tells a silent subagent how to handle a live negotiation turn when its session key is prefixed `index:negotiation:`. Plugin skills and bootstrap scripts do **not** redefine this guidance; they defer to whatever ships in `MCP_INSTRUCTIONS`.
|
|
293
|
-
|
|
294
|
-
### Negotiation-facing tools
|
|
295
|
-
|
|
296
|
-
Personal agents participate in bilateral negotiation via a small set of MCP tools:
|
|
297
|
-
|
|
298
|
-
| Tool | Purpose |
|
|
299
|
-
|---|---|
|
|
300
|
-
| `get_negotiation` | Fetch the full turn history and assessment seed for a negotiation |
|
|
301
|
-
| `list_negotiations` | List current and concluded agent negotiations with lifecycle-explicit opportunity and owner-action narration |
|
|
302
|
-
| `respond_to_negotiation` | Submit a turn (propose / counter / accept / reject / question) |
|
|
254
|
+
`GET /api/docs` serves canonical protocol guidance, including the resource
|
|
255
|
+
routes and negotiation rules. Integrations read that guidance before writing.
|
|
256
|
+
`GET /api/negotiations` lists the seat's negotiations across every opportunity;
|
|
257
|
+
one negotiation is observed and turned through its opportunity, at
|
|
258
|
+
`GET /api/opportunities/:id/negotiation` and
|
|
259
|
+
`POST /api/opportunities/:id/negotiation/turns`, because exactly one is written
|
|
260
|
+
with each opportunity. Personal-agent conversations require an intent scope and
|
|
261
|
+
the current question ID when answering a pending question.
|
|
303
262
|
|
|
304
263
|
## Publishing
|
|
305
264
|
|
package/README.md
CHANGED
|
@@ -24,7 +24,6 @@ flowchart LR
|
|
|
24
24
|
Participant --> Context[Context]
|
|
25
25
|
Participant --> Signal[Signal]
|
|
26
26
|
|
|
27
|
-
Premises[Premises] --> Context
|
|
28
27
|
Context --> Scope[Effective scope]
|
|
29
28
|
Signal --> Scope
|
|
30
29
|
Community[Community membership and norms] --> Scope
|
|
@@ -54,7 +53,7 @@ The graph is intentionally consent-centered: agents can construct context, disco
|
|
|
54
53
|
3. **Semantic discovery** — matching is based on role fit, constraints, complementarity, and contextual relevance rather than exact keyword overlap.
|
|
55
54
|
4. **Explainable surfacing** — every surfaced opportunity SHOULD include a legible reason: why these participants, why now, and what the next action might be.
|
|
56
55
|
5. **Consent at relationship boundaries** — agents MAY discover and negotiate, but MUST NOT create or accept a relationship without explicit participant approval.
|
|
57
|
-
6. **Agent interoperability** — first-party agents, personal agents, community agents, and external
|
|
56
|
+
6. **Agent interoperability** — first-party agents, personal agents, community agents, and external CLI clients SHOULD be able to participate under the same behavioral contract.
|
|
58
57
|
|
|
59
58
|
## Non-goals
|
|
60
59
|
|
|
@@ -74,8 +73,7 @@ The protocol does not attempt to be:
|
|
|
74
73
|
| **Participant** | A human principal represented in the network. A participant may act directly or through one or more agents. |
|
|
75
74
|
| **Agent** | A software actor authorized to act for a participant or community within a declared scope. |
|
|
76
75
|
| **Signal** | A participant's actionable expression of intent: what they seek, offer, need, are building, are exploring, or can support. |
|
|
77
|
-
| **
|
|
78
|
-
| **Context** | A synthesized representation of premises, history, constraints, and community-specific relevance. |
|
|
76
|
+
| **Context** | A synthesized representation of a participant's identity, history, constraints, and community-specific relevance. |
|
|
79
77
|
| **Community** | A bounded discovery scope with membership, purpose, norms, and relevance criteria. |
|
|
80
78
|
| **Membership** | The relationship between a participant and a community. Agents receive community authority through separate scoped permissions. |
|
|
81
79
|
| **Candidate** | A possible counterpart or opportunity component identified during discovery but not yet surfaced. |
|
|
@@ -91,7 +89,6 @@ Some implementation APIs may expose historical names such as `intent`, `index`,
|
|
|
91
89
|
erDiagram
|
|
92
90
|
PARTICIPANT ||--o{ AGENT : authorizes
|
|
93
91
|
PARTICIPANT ||--o{ SIGNAL : expresses
|
|
94
|
-
PARTICIPANT ||--o{ PREMISE : asserts
|
|
95
92
|
PARTICIPANT ||--o{ CONTEXT : represented_by
|
|
96
93
|
PARTICIPANT ||--o{ MEMBERSHIP : holds
|
|
97
94
|
AGENT ||--o{ AGENT_PERMISSION : receives
|
|
@@ -180,7 +177,7 @@ A broader credential MUST NOT expand a narrower request. A narrower agent permis
|
|
|
180
177
|
|
|
181
178
|
The protocol separates internal state from participant-facing language.
|
|
182
179
|
|
|
183
|
-
Internal records MAY contain IDs, embeddings, scores, graph state
|
|
180
|
+
Internal records MAY contain IDs, embeddings, scores, and graph state. Participant-facing responses MUST NOT expose these implementation details unless an identifier is directly actionable by the participant, such as a conversation identifier needed to open an accepted connection.
|
|
184
181
|
|
|
185
182
|
## Core objects
|
|
186
183
|
|
|
@@ -202,13 +199,13 @@ Signals have the following conceptual lifecycle:
|
|
|
202
199
|
|
|
203
200
|
A signal MUST NOT be treated as active if it is outside the participant's authority, obviously insincere, unsafe to act on, or too vague to evaluate.
|
|
204
201
|
|
|
205
|
-
###
|
|
202
|
+
### Context
|
|
206
203
|
|
|
207
|
-
|
|
204
|
+
Context describes a participant: background, role, current work, capability, location, affiliation, constraints, and declared preferences. It grounds discovery by determining whether a signal is plausible and which communities or counterparts are relevant.
|
|
208
205
|
|
|
209
|
-
Context
|
|
206
|
+
Context MAY be global to a participant or specific to a community. Community-specific context SHOULD emphasize facts relevant to that community's purpose and suppress irrelevant detail.
|
|
210
207
|
|
|
211
|
-
|
|
208
|
+
Context updates SHOULD cause downstream discovery representations to refresh. Stale context SHOULD NOT be used when fresher participant-approved context exists.
|
|
212
209
|
|
|
213
210
|
### Community
|
|
214
211
|
|
|
@@ -316,7 +313,7 @@ sequenceDiagram
|
|
|
316
313
|
|
|
317
314
|
### 1. Context construction
|
|
318
315
|
|
|
319
|
-
The protocol collects participant-provided or participant-authorized material and turns it into
|
|
316
|
+
The protocol collects participant-provided or participant-authorized material and turns it into context. Context construction MUST preserve provenance and SHOULD prefer participant-approved information over inferred information.
|
|
320
317
|
|
|
321
318
|
### 2. Signal admission
|
|
322
319
|
|
|
@@ -328,7 +325,7 @@ The protocol determines the effective communities in which the signal can operat
|
|
|
328
325
|
|
|
329
326
|
### 4. Candidate generation
|
|
330
327
|
|
|
331
|
-
The protocol generates candidates by comparing signals and context inside the effective scope. Candidate generation MAY use multiple strategies, including signal-to-signal, context-to-signal,
|
|
328
|
+
The protocol generates candidates by comparing signals and context inside the effective scope. Candidate generation MAY use multiple strategies, including signal-to-signal, context-to-signal, semantic retrieval, and directed target construction.
|
|
332
329
|
|
|
333
330
|
Candidate generation is not surfacing. Candidate data MUST remain internal until evaluation and visibility checks pass.
|
|
334
331
|
|
|
@@ -352,7 +349,7 @@ A conforming agent MUST:
|
|
|
352
349
|
|
|
353
350
|
- act only within its authenticated participant and community scope,
|
|
354
351
|
- preserve participant consent at send, accept, and connection boundaries,
|
|
355
|
-
- avoid exposing internal IDs, raw
|
|
352
|
+
- avoid exposing internal IDs, raw graph results, embeddings, scores, or database field names,
|
|
356
353
|
- distinguish known facts from inferred context,
|
|
357
354
|
- ask for clarification when required information is missing,
|
|
358
355
|
- use the protocol vocabulary in participant-facing output,
|
|
@@ -389,21 +386,20 @@ The following invariants define the protocol's trust boundary:
|
|
|
389
386
|
|
|
390
387
|
## Interoperability
|
|
391
388
|
|
|
392
|
-
The reference implementation exposes the protocol
|
|
389
|
+
The reference implementation exposes the protocol through a REST API and typed package APIs. External agents use the Index CLI against those resources, reading canonical guidance from `GET /api/docs`. The API resolves identity and enforces ownership, network scope, and protocol rules.
|
|
393
390
|
|
|
394
391
|
```mermaid
|
|
395
392
|
flowchart LR
|
|
396
|
-
ExternalAgent[External agent]
|
|
393
|
+
ExternalAgent[External agent] --> CLI[Index CLI]
|
|
394
|
+
CLI --> HTTP[Index REST API]
|
|
397
395
|
FirstPartyAgent[First-party agent] -->|typed runtime| Runtime[Protocol runtime]
|
|
398
|
-
PersonalAgent[Personal agent] -->|MCP tools or REST polling| McpServer
|
|
399
396
|
|
|
400
|
-
|
|
397
|
+
HTTP --> Identity[Identity resolution]
|
|
401
398
|
Identity --> AgentGate[Agent registration and scope]
|
|
402
399
|
AgentGate --> ScopedDeps[Scoped protocol dependencies]
|
|
403
400
|
ScopedDeps --> Runtime
|
|
404
401
|
|
|
405
|
-
Runtime -->
|
|
406
|
-
Tools --> Graphs[Discovery, context, signal, negotiation graphs]
|
|
402
|
+
Runtime --> Graphs[Discovery, context, signal graphs]
|
|
407
403
|
Graphs --> Results[Bounded results]
|
|
408
404
|
Results --> Runtime
|
|
409
405
|
Runtime --> ParticipantOutput[Participant-facing output rules]
|
|
@@ -422,6 +418,6 @@ Implementations MAY expose additional transports, but they SHOULD preserve the s
|
|
|
422
418
|
|
|
423
419
|
The canonical TypeScript implementation is `@indexnetwork/protocol`.
|
|
424
420
|
|
|
425
|
-
- [IMPLEMENTATION.md](./IMPLEMENTATION.md) — package installation, adapters, graph factories,
|
|
421
|
+
- [IMPLEMENTATION.md](./IMPLEMENTATION.md) — package installation, adapters, graph factories, REST API and CLI usage, and publishing.
|
|
426
422
|
- [STABILITY.md](./STABILITY.md) — public API contract and SemVer policy.
|
|
427
423
|
- [CHANGELOG.md](./CHANGELOG.md) — release history.
|
package/STABILITY.md
CHANGED
|
@@ -10,8 +10,7 @@ change. It is the reference behind the tier annotations in `src/index.ts`.
|
|
|
10
10
|
- The supported entry points are the package root:
|
|
11
11
|
`import { ... } from "@indexnetwork/protocol"` — and the **browser-safe
|
|
12
12
|
subpaths** listed in `package.json` `exports` (as of 21.1.0:
|
|
13
|
-
|
|
14
|
-
`@indexnetwork/protocol/question-block/fixture`). A browser-safe subpath
|
|
13
|
+
package root. There are no supported browser subpaths.
|
|
15
14
|
exposes one shared-schema module whose only runtime dependency is `zod`, for
|
|
16
15
|
consumers (the web client) that cannot load the node-only package root. The
|
|
17
16
|
schema module's symbols are also re-exported from the root (the fixture is
|
|
@@ -30,6 +29,9 @@ change. It is the reference behind the tier annotations in `src/index.ts`.
|
|
|
30
29
|
as a class rather than a re-export list — `intents` does, via `Intents` in
|
|
31
30
|
`intents/intent.module.ts` — which makes the whole capability one exported
|
|
32
31
|
symbol and its internal layout free to change without a contract change.
|
|
32
|
+
- `protocol/`, `platform/`, `capabilities/`, and `internal/` are source-level
|
|
33
|
+
boundaries, not consumer subpaths. The sole supported Node import remains the
|
|
34
|
+
package root.
|
|
33
35
|
|
|
34
36
|
## Stability tiers
|
|
35
37
|
|
|
@@ -41,14 +43,17 @@ Covered by SemVer below. Breaking changes require a **major** bump.
|
|
|
41
43
|
|
|
42
44
|
| Barrel section | What it is |
|
|
43
45
|
|---|---|
|
|
44
|
-
| **Public API** |
|
|
45
|
-
| **Interfaces** | Every
|
|
46
|
-
| **Shared schemas** | Zod schemas + inferred types that cross the boundary (
|
|
47
|
-
| **Graph factories** | `*GraphFactory` classes (
|
|
48
|
-
| **Intents** | `Intents` — the whole signal capability as one class (lifecycle graph, verification,
|
|
49
|
-
| **Agents** | Structured LLM agents (`
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
| **Public API** | Model config helpers, request scope helpers (`deriveAllowedNetworkIds`, `deriveDiscoveryNetworkIds`), `requestContext`. |
|
|
47
|
+
| **Interfaces** | Every port you implement to inject infrastructure (databases, embedder, cache, scraper, integration, …). |
|
|
48
|
+
| **Shared schemas** | Zod schemas + inferred types that cross the boundary (underspecification, identity, network-assignment, chat-context, …). |
|
|
49
|
+
| **Graph factories** | `*GraphFactory` classes (for example, `RadarGraphFactory`). |
|
|
50
|
+
| **Intents** | `Intents` — the whole signal capability as one class (lifecycle graph, verification, preparation) plus `IntentsDeps` and the `Prepare*` / `RecoveryField*` types. Replaced the six separate intent exports in 18.0.0. |
|
|
51
|
+
| **Agents** | Structured LLM agents (`OpportunityEvaluator`, …). |
|
|
52
|
+
|
|
53
|
+
`Negotiations`, `NegotiationDatabase`, the opening and turn decision functions,
|
|
54
|
+
the observation function, and `negotiationTurnSchema` are stable. Hosts must
|
|
55
|
+
evaluate supplied decision callbacks against locked current state and commit
|
|
56
|
+
their effects atomically. `openCounterparties` takes the protocol opening callback.
|
|
52
57
|
|
|
53
58
|
### Experimental
|
|
54
59
|
|
|
@@ -57,7 +62,7 @@ a major bump. Use at your own risk and pin a version if you depend on them.
|
|
|
57
62
|
|
|
58
63
|
| Area | What it is |
|
|
59
64
|
|---|---|
|
|
60
|
-
| **States** | Advanced graph-state shapes
|
|
65
|
+
| **States** | Advanced graph-state shapes exposed for advanced graph consumers. |
|
|
61
66
|
| **Internal helpers** | Low-level support utilities re-exported for the backend's own use (selection/eval/evidence helpers) that are not part of the recommended integration surface. |
|
|
62
67
|
|
|
63
68
|
> Most symbols in the barrel are consumed by the Index Network backend itself; a
|