MCPcopy
hub / github.com/TanStack/ai / createEnvelope

Method createEnvelope

packages/ai-client/src/devtools.ts:658–680  ·  view source on GitHub ↗
(
    eventType:
      | 'hook:registered'
      | 'hook:updated'
      | 'hook:unregistered'
      | 'hook:state-snapshot'
      | 'tools:registered'
      | AIDevtoolsRunEventType,
    visibility: AIDevtoolsEventVisibility = 'client-state',
    context: { runId?: string } = {},
  )

Source from the content-addressed store, hash-verified

656 }
657
658 private createEnvelope(
659 eventType:
660 | 'hook:registered'
661 | 'hook:updated'
662 | 'hook:unregistered'
663 | 'hook:state-snapshot'
664 | 'tools:registered'
665 | AIDevtoolsRunEventType,
666 visibility: AIDevtoolsEventVisibility = 'client-state',
667 context: { runId?: string } = {},
668 ) {
669 return createAIDevtoolsEventEnvelope({
670 eventType,
671 source: 'client',
672 visibility,
673 clientId: this.options.clientId,
674 hookId: this.options.hookId,
675 correlationId: this.bridgeId,
676 ...(this.options.threadId ? { threadId: this.options.threadId } : {}),
677 ...(context.runId ? { runId: context.runId } : {}),
678 timestamp: Date.now(),
679 })
680 }
681
682 private createMetadataPayload() {
683 return {

Callers 6

emitRegisteredMethod · 0.95
emitUpdatedMethod · 0.95
emitSnapshotMethod · 0.95
emitToolsRegisteredMethod · 0.95
emitRunLifecycleMethod · 0.95
disposeMethod · 0.95

Calls 2

nowMethod · 0.80

Tested by

no test coverage detected