@copilotkit/sdk-js 1.4.0-pre.16 → 1.4.1-pre.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/CHANGELOG.md CHANGED
@@ -1,88 +1,97 @@
1
1
  # @copilotkit/sdk-js
2
2
 
3
- ## 1.4.0-pre.16
4
-
5
- ### Minor Changes
6
-
7
- - lgc and lgjs alpha
3
+ ## 1.4.1-pre.0
8
4
 
9
5
  ### Patch Changes
10
6
 
7
+ - lower case copilotkit property
11
8
  - Updated dependencies
12
- - @copilotkit/shared@1.4.0-pre.16
13
-
14
- ## 1.4.0-pre.15
9
+ - @copilotkit/shared@1.4.1-pre.0
15
10
 
16
- ### Patch Changes
17
-
18
- - No changes
19
- - Updated dependencies
20
- - @copilotkit/shared@1.4.0-pre.15
21
-
22
- ## 1.4.0-pre-1-4-0.14
11
+ ## 1.4.0
23
12
 
24
13
  ### Minor Changes
25
14
 
26
- - lgc & lgjs alpha release
15
+ CopilotKit Core:
27
16
 
28
- ### Patch Changes
17
+ - Improved error messages and overall logs
18
+ - `useCopilotAction.renderAndAwait` renamed to `.renderAndAwaitForResponse` (backwards compatible, will be deprecated in the future)
19
+ - Improved scrolling behavior. It is now possible to scroll up during LLM response generation
20
+ - Added Azure OpenAI integration
21
+ - Updated interfaces for better developer ergonomics
29
22
 
30
- - a5efccd: Revert rxjs changes
31
- - Updated dependencies [a5efccd]
32
- - Updated dependencies
33
- - @copilotkit/shared@1.4.0-pre-1-4-0.14
23
+ CoAgents:
34
24
 
35
- ## 1.4.0-pre-1-4-0.13
25
+ - Renamed `remoteActions` to `remoteEndpoints` (backwards compatible, will be deprecated in the future)
26
+ - Support for LangGraph Platform in Remote Endpoints
27
+ - LangGraph JS Support for CoAgents (locally via `langgraph dev`, `langgraph up` or deployed to LangGraph Platform)
28
+ - Improved LangSmith integration - requests made through CoAgents will now surface in LangSmith
29
+ - Enhanced state management and message handling
36
30
 
37
- ### Minor Changes
31
+ CopilotKid Back-end SDK:
38
32
 
39
- - lgc & lgjs alpha
33
+ - Released a whole-new `@copilotkit/sdk-js` for building agents with LangGraph JS Support
40
34
 
41
35
  ### Patch Changes
42
36
 
43
- - Updated dependencies
44
- - @copilotkit/shared@1.4.0-pre-1-4-0.13
45
-
46
- ## 1.4.0-pre-1-4-0.12
47
-
48
- ### Minor Changes
37
+ - f6fab28: update tsup config
38
+ - f6fab28: update entry
39
+ - f6fab28: export langchain module
40
+ - f6fab28: Ensure intermediate state config is sent as snake case
41
+ - f6fab28: update entry in tsup config
42
+ - a5efccd: Revert rxjs changes
43
+ - f6fab28: update entry
44
+ - f6fab28: Update exports
45
+ - f6fab28: Update exports
46
+ - f6fab28: Export LangGraph functions
47
+ - f6fab28: Update lockfile
48
+ - Updated dependencies [f6fab28]
49
+ - Updated dependencies [f6fab28]
50
+ - Updated dependencies
51
+ - Updated dependencies [f6fab28]
52
+ - Updated dependencies [8a77944]
53
+ - Updated dependencies [f6fab28]
54
+ - Updated dependencies [f6fab28]
55
+ - Updated dependencies [8a77944]
56
+ - Updated dependencies [a5efccd]
57
+ - Updated dependencies [f6fab28]
58
+ - Updated dependencies [f6fab28]
59
+ - Updated dependencies [f6fab28]
60
+ - Updated dependencies [332d744]
61
+ - Updated dependencies [f6fab28]
62
+ - Updated dependencies [f6fab28]
63
+ - @copilotkit/shared@1.4.0
49
64
 
50
- - c6b489d: LangGraph Platform and LangGraph JS support
51
- - 7cc6cc8: LangGraph Cloud and LangGraphJS alpha release
52
- - prerelease lgc and lgjs
53
- - Add LangGraph Platform and LangGraph JS support
65
+ ## 1.3.16-mme-revert-rxjs-changes.10
54
66
 
55
67
  ### Patch Changes
56
68
 
57
- - 9ea9db1: update tsup config
58
- - d52c1f9: update entry
59
- - e71d469: export langchain module
60
- - 3caa5d5: Ensure intermediate state config is sent as snake case
61
- - cf3a787: update entry in tsup config
62
- - 264a693: update entry
63
- - dd99f00: Update exports
64
- - a28fb90: Update exports
65
- - 1f8032e: Export LangGraph functions
66
- - c3576f6: Update lockfile
67
- - Updated dependencies [9ea9db1]
68
- - Updated dependencies [d52c1f9]
69
- - Updated dependencies [c6b489d]
70
- - Updated dependencies [7cc6cc8]
71
- - Updated dependencies [e71d469]
69
+ - f6fab28: update tsup config
70
+ - f6fab28: update entry
71
+ - f6fab28: export langchain module
72
+ - f6fab28: Ensure intermediate state config is sent as snake case
73
+ - f6fab28: update entry in tsup config
74
+ - Revert rxjs changes
75
+ - f6fab28: update entry
76
+ - f6fab28: Update exports
77
+ - f6fab28: Update exports
78
+ - f6fab28: Export LangGraph functions
79
+ - f6fab28: Update lockfile
80
+ - Updated dependencies [f6fab28]
81
+ - Updated dependencies [f6fab28]
82
+ - Updated dependencies [f6fab28]
72
83
  - Updated dependencies [8a77944]
73
- - Updated dependencies [3caa5d5]
74
- - Updated dependencies [cf3a787]
75
- - Updated dependencies
76
- - Updated dependencies
84
+ - Updated dependencies [f6fab28]
85
+ - Updated dependencies [f6fab28]
77
86
  - Updated dependencies [8a77944]
78
- - Updated dependencies [264a693]
79
- - Updated dependencies [dd99f00]
80
- - Updated dependencies [a28fb90]
87
+ - Updated dependencies
88
+ - Updated dependencies [f6fab28]
89
+ - Updated dependencies [f6fab28]
90
+ - Updated dependencies [f6fab28]
81
91
  - Updated dependencies [332d744]
82
- - Updated dependencies [b318b18]
83
- - Updated dependencies [1f8032e]
84
- - Updated dependencies [c3576f6]
85
- - @copilotkit/shared@1.4.0-pre-1-4-0.12
92
+ - Updated dependencies [f6fab28]
93
+ - Updated dependencies [f6fab28]
94
+ - @copilotkit/shared@1.3.16-mme-revert-rxjs-changes.10
86
95
 
87
96
  ## 1.3.16-mme-lgc-langgraph-package.9
88
97
 
@@ -22,7 +22,7 @@ declare const CopilotKitPropertiesAnnotation: _langchain_langgraph._INTERNAL_ANN
22
22
  }>;
23
23
  declare const CopilotKitStateAnnotation: _langchain_langgraph._INTERNAL_ANNOTATION_ROOT<{
24
24
  messages: _langchain_langgraph.BinaryOperatorAggregate<_langchain_core_messages.BaseMessage[], _langchain_langgraph.Messages>;
25
- copilotKit: {
25
+ copilotkit: {
26
26
  (): _langchain_langgraph.LastValue<_langchain_langgraph.StateType<{
27
27
  actions: {
28
28
  (): _langchain_langgraph.LastValue<any[]>;
package/dist/langchain.js CHANGED
@@ -36,7 +36,7 @@ var CopilotKitPropertiesAnnotation = import_langgraph.Annotation.Root({
36
36
  actions: import_langgraph.Annotation
37
37
  });
38
38
  var CopilotKitStateAnnotation = import_langgraph.Annotation.Root({
39
- copilotKit: import_langgraph.Annotation,
39
+ copilotkit: import_langgraph.Annotation,
40
40
  ...import_langgraph.MessagesAnnotation.spec
41
41
  });
42
42
  function copilotKitCustomizeConfig(baseConfig, options) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/langchain.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { dispatchCustomEvent } from \"@langchain/core/callbacks/dispatch\";\nimport { randomId } from \"@copilotkit/shared\";\nimport { Annotation, MessagesAnnotation } from \"@langchain/langgraph\";\n\ninterface IntermediateStateConfig {\n stateKey: string;\n tool: string;\n toolArgument?: string;\n}\n\ninterface OptionsConfig {\n emitToolCalls?: boolean | string | string[];\n emitMessages?: boolean;\n emitAll?: boolean;\n emitIntermediateState?: IntermediateStateConfig[];\n}\n\nexport const CopilotKitPropertiesAnnotation = Annotation.Root({\n actions: Annotation<any[]>,\n});\n\nexport const CopilotKitStateAnnotation = Annotation.Root({\n copilotKit: Annotation<typeof CopilotKitPropertiesAnnotation.State>,\n ...MessagesAnnotation.spec,\n});\n\nexport type CopilotKitState = typeof CopilotKitStateAnnotation.State;\nexport type CopilotKitProperties = typeof CopilotKitPropertiesAnnotation.State;\n\nexport function copilotKitCustomizeConfig(\n baseConfig: RunnableConfig,\n options?: OptionsConfig,\n): RunnableConfig {\n const metadata = baseConfig?.metadata || {};\n\n if (options?.emitAll) {\n metadata[\"copilotkit:emit-tool-calls\"] = true;\n metadata[\"copilotkit:emit-messages\"] = true;\n } else {\n if (options?.emitToolCalls !== undefined) {\n metadata[\"copilotkit:emit-tool-calls\"] = options.emitToolCalls;\n }\n if (options?.emitMessages !== undefined) {\n metadata[\"copilotkit:emit-messages\"] = options.emitMessages;\n }\n }\n\n if (options?.emitIntermediateState) {\n const snakeCaseIntermediateState = options.emitIntermediateState.map((state) => ({\n tool: state.tool,\n tool_argument: state.toolArgument,\n state_key: state.stateKey,\n }));\n\n metadata[\"copilotkit:emit-intermediate-state\"] = snakeCaseIntermediateState;\n }\n\n baseConfig = baseConfig || {};\n\n return {\n ...baseConfig,\n metadata: metadata,\n };\n}\n\nexport async function copilotKitExit(config: RunnableConfig) {\n await dispatchCustomEvent(\"copilotkit_exit\", {}, config);\n}\n\nexport async function copilotKitEmitState(config: RunnableConfig, state: any) {\n await dispatchCustomEvent(\"copilotkit_manually_emit_intermediate_state\", state, config);\n}\n\nexport async function copilotKitEmitMessage(config: RunnableConfig, message: string) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_message\",\n { message, message_id: randomId(), role: \"assistant\" },\n config,\n );\n}\n\nexport async function copilotKitEmitToolCall(config: RunnableConfig, name: string, args: any) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_tool_call\",\n { name, args, id: randomId() },\n config,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;sBAAoC;AACpC,oBAAyB;AACzB,uBAA+C;AAexC,IAAMA,iCAAiCC,4BAAWC,KAAK;EAC5DC,SAASF;AACX,CAAA;AAEO,IAAMG,4BAA4BH,4BAAWC,KAAK;EACvDG,YAAYJ;EACZ,GAAGK,oCAAmBC;AACxB,CAAA;AAKO,SAASC,0BACdC,YACAC,SAAuB;AAEvB,QAAMC,YAAWF,yCAAYE,aAAY,CAAC;AAE1C,MAAID,mCAASE,SAAS;AACpBD,aAAS,4BAAA,IAAgC;AACzCA,aAAS,0BAAA,IAA8B;EACzC,OAAO;AACL,SAAID,mCAASG,mBAAkBC,QAAW;AACxCH,eAAS,4BAAA,IAAgCD,QAAQG;IACnD;AACA,SAAIH,mCAASK,kBAAiBD,QAAW;AACvCH,eAAS,0BAAA,IAA8BD,QAAQK;IACjD;EACF;AAEA,MAAIL,mCAASM,uBAAuB;AAClC,UAAMC,6BAA6BP,QAAQM,sBAAsBE,IAAI,CAACC,WAAW;MAC/EC,MAAMD,MAAMC;MACZC,eAAeF,MAAMG;MACrBC,WAAWJ,MAAMK;IACnB,EAAA;AAEAb,aAAS,oCAAA,IAAwCM;EACnD;AAEAR,eAAaA,cAAc,CAAC;AAE5B,SAAO;IACL,GAAGA;IACHE;EACF;AACF;AAlCgBH;AAoChB,eAAsBiB,eAAeC,QAAsB;AACzD,YAAMC,qCAAoB,mBAAmB,CAAC,GAAGD,MAAAA;AACnD;AAFsBD;AAItB,eAAsBG,oBAAoBF,QAAwBP,OAAU;AAC1E,YAAMQ,qCAAoB,+CAA+CR,OAAOO,MAAAA;AAClF;AAFsBE;AAItB,eAAsBC,sBAAsBH,QAAwBI,SAAe;AACjF,YAAMH,qCACJ,oCACA;IAAEG;IAASC,gBAAYC,wBAAAA;IAAYC,MAAM;EAAY,GACrDP,MAAAA;AAEJ;AANsBG;AAQtB,eAAsBK,uBAAuBR,QAAwBS,MAAcC,MAAS;AAC1F,YAAMT,qCACJ,sCACA;IAAEQ;IAAMC;IAAMC,QAAIL,wBAAAA;EAAW,GAC7BN,MAAAA;AAEJ;AANsBQ;","names":["CopilotKitPropertiesAnnotation","Annotation","Root","actions","CopilotKitStateAnnotation","copilotKit","MessagesAnnotation","spec","copilotKitCustomizeConfig","baseConfig","options","metadata","emitAll","emitToolCalls","undefined","emitMessages","emitIntermediateState","snakeCaseIntermediateState","map","state","tool","tool_argument","toolArgument","state_key","stateKey","copilotKitExit","config","dispatchCustomEvent","copilotKitEmitState","copilotKitEmitMessage","message","message_id","randomId","role","copilotKitEmitToolCall","name","args","id"]}
1
+ {"version":3,"sources":["../src/langchain.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { dispatchCustomEvent } from \"@langchain/core/callbacks/dispatch\";\nimport { randomId } from \"@copilotkit/shared\";\nimport { Annotation, MessagesAnnotation } from \"@langchain/langgraph\";\n\ninterface IntermediateStateConfig {\n stateKey: string;\n tool: string;\n toolArgument?: string;\n}\n\ninterface OptionsConfig {\n emitToolCalls?: boolean | string | string[];\n emitMessages?: boolean;\n emitAll?: boolean;\n emitIntermediateState?: IntermediateStateConfig[];\n}\n\nexport const CopilotKitPropertiesAnnotation = Annotation.Root({\n actions: Annotation<any[]>,\n});\n\nexport const CopilotKitStateAnnotation = Annotation.Root({\n copilotkit: Annotation<typeof CopilotKitPropertiesAnnotation.State>,\n ...MessagesAnnotation.spec,\n});\n\nexport type CopilotKitState = typeof CopilotKitStateAnnotation.State;\nexport type CopilotKitProperties = typeof CopilotKitPropertiesAnnotation.State;\n\nexport function copilotKitCustomizeConfig(\n baseConfig: RunnableConfig,\n options?: OptionsConfig,\n): RunnableConfig {\n const metadata = baseConfig?.metadata || {};\n\n if (options?.emitAll) {\n metadata[\"copilotkit:emit-tool-calls\"] = true;\n metadata[\"copilotkit:emit-messages\"] = true;\n } else {\n if (options?.emitToolCalls !== undefined) {\n metadata[\"copilotkit:emit-tool-calls\"] = options.emitToolCalls;\n }\n if (options?.emitMessages !== undefined) {\n metadata[\"copilotkit:emit-messages\"] = options.emitMessages;\n }\n }\n\n if (options?.emitIntermediateState) {\n const snakeCaseIntermediateState = options.emitIntermediateState.map((state) => ({\n tool: state.tool,\n tool_argument: state.toolArgument,\n state_key: state.stateKey,\n }));\n\n metadata[\"copilotkit:emit-intermediate-state\"] = snakeCaseIntermediateState;\n }\n\n baseConfig = baseConfig || {};\n\n return {\n ...baseConfig,\n metadata: metadata,\n };\n}\n\nexport async function copilotKitExit(config: RunnableConfig) {\n await dispatchCustomEvent(\"copilotkit_exit\", {}, config);\n}\n\nexport async function copilotKitEmitState(config: RunnableConfig, state: any) {\n await dispatchCustomEvent(\"copilotkit_manually_emit_intermediate_state\", state, config);\n}\n\nexport async function copilotKitEmitMessage(config: RunnableConfig, message: string) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_message\",\n { message, message_id: randomId(), role: \"assistant\" },\n config,\n );\n}\n\nexport async function copilotKitEmitToolCall(config: RunnableConfig, name: string, args: any) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_tool_call\",\n { name, args, id: randomId() },\n config,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;sBAAoC;AACpC,oBAAyB;AACzB,uBAA+C;AAexC,IAAMA,iCAAiCC,4BAAWC,KAAK;EAC5DC,SAASF;AACX,CAAA;AAEO,IAAMG,4BAA4BH,4BAAWC,KAAK;EACvDG,YAAYJ;EACZ,GAAGK,oCAAmBC;AACxB,CAAA;AAKO,SAASC,0BACdC,YACAC,SAAuB;AAEvB,QAAMC,YAAWF,yCAAYE,aAAY,CAAC;AAE1C,MAAID,mCAASE,SAAS;AACpBD,aAAS,4BAAA,IAAgC;AACzCA,aAAS,0BAAA,IAA8B;EACzC,OAAO;AACL,SAAID,mCAASG,mBAAkBC,QAAW;AACxCH,eAAS,4BAAA,IAAgCD,QAAQG;IACnD;AACA,SAAIH,mCAASK,kBAAiBD,QAAW;AACvCH,eAAS,0BAAA,IAA8BD,QAAQK;IACjD;EACF;AAEA,MAAIL,mCAASM,uBAAuB;AAClC,UAAMC,6BAA6BP,QAAQM,sBAAsBE,IAAI,CAACC,WAAW;MAC/EC,MAAMD,MAAMC;MACZC,eAAeF,MAAMG;MACrBC,WAAWJ,MAAMK;IACnB,EAAA;AAEAb,aAAS,oCAAA,IAAwCM;EACnD;AAEAR,eAAaA,cAAc,CAAC;AAE5B,SAAO;IACL,GAAGA;IACHE;EACF;AACF;AAlCgBH;AAoChB,eAAsBiB,eAAeC,QAAsB;AACzD,YAAMC,qCAAoB,mBAAmB,CAAC,GAAGD,MAAAA;AACnD;AAFsBD;AAItB,eAAsBG,oBAAoBF,QAAwBP,OAAU;AAC1E,YAAMQ,qCAAoB,+CAA+CR,OAAOO,MAAAA;AAClF;AAFsBE;AAItB,eAAsBC,sBAAsBH,QAAwBI,SAAe;AACjF,YAAMH,qCACJ,oCACA;IAAEG;IAASC,gBAAYC,wBAAAA;IAAYC,MAAM;EAAY,GACrDP,MAAAA;AAEJ;AANsBG;AAQtB,eAAsBK,uBAAuBR,QAAwBS,MAAcC,MAAS;AAC1F,YAAMT,qCACJ,sCACA;IAAEQ;IAAMC;IAAMC,QAAIL,wBAAAA;EAAW,GAC7BN,MAAAA;AAEJ;AANsBQ;","names":["CopilotKitPropertiesAnnotation","Annotation","Root","actions","CopilotKitStateAnnotation","copilotkit","MessagesAnnotation","spec","copilotKitCustomizeConfig","baseConfig","options","metadata","emitAll","emitToolCalls","undefined","emitMessages","emitIntermediateState","snakeCaseIntermediateState","map","state","tool","tool_argument","toolArgument","state_key","stateKey","copilotKitExit","config","dispatchCustomEvent","copilotKitEmitState","copilotKitEmitMessage","message","message_id","randomId","role","copilotKitEmitToolCall","name","args","id"]}
@@ -9,7 +9,7 @@ var CopilotKitPropertiesAnnotation = Annotation.Root({
9
9
  actions: Annotation
10
10
  });
11
11
  var CopilotKitStateAnnotation = Annotation.Root({
12
- copilotKit: Annotation,
12
+ copilotkit: Annotation,
13
13
  ...MessagesAnnotation.spec
14
14
  });
15
15
  function copilotKitCustomizeConfig(baseConfig, options) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/langchain.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { dispatchCustomEvent } from \"@langchain/core/callbacks/dispatch\";\nimport { randomId } from \"@copilotkit/shared\";\nimport { Annotation, MessagesAnnotation } from \"@langchain/langgraph\";\n\ninterface IntermediateStateConfig {\n stateKey: string;\n tool: string;\n toolArgument?: string;\n}\n\ninterface OptionsConfig {\n emitToolCalls?: boolean | string | string[];\n emitMessages?: boolean;\n emitAll?: boolean;\n emitIntermediateState?: IntermediateStateConfig[];\n}\n\nexport const CopilotKitPropertiesAnnotation = Annotation.Root({\n actions: Annotation<any[]>,\n});\n\nexport const CopilotKitStateAnnotation = Annotation.Root({\n copilotKit: Annotation<typeof CopilotKitPropertiesAnnotation.State>,\n ...MessagesAnnotation.spec,\n});\n\nexport type CopilotKitState = typeof CopilotKitStateAnnotation.State;\nexport type CopilotKitProperties = typeof CopilotKitPropertiesAnnotation.State;\n\nexport function copilotKitCustomizeConfig(\n baseConfig: RunnableConfig,\n options?: OptionsConfig,\n): RunnableConfig {\n const metadata = baseConfig?.metadata || {};\n\n if (options?.emitAll) {\n metadata[\"copilotkit:emit-tool-calls\"] = true;\n metadata[\"copilotkit:emit-messages\"] = true;\n } else {\n if (options?.emitToolCalls !== undefined) {\n metadata[\"copilotkit:emit-tool-calls\"] = options.emitToolCalls;\n }\n if (options?.emitMessages !== undefined) {\n metadata[\"copilotkit:emit-messages\"] = options.emitMessages;\n }\n }\n\n if (options?.emitIntermediateState) {\n const snakeCaseIntermediateState = options.emitIntermediateState.map((state) => ({\n tool: state.tool,\n tool_argument: state.toolArgument,\n state_key: state.stateKey,\n }));\n\n metadata[\"copilotkit:emit-intermediate-state\"] = snakeCaseIntermediateState;\n }\n\n baseConfig = baseConfig || {};\n\n return {\n ...baseConfig,\n metadata: metadata,\n };\n}\n\nexport async function copilotKitExit(config: RunnableConfig) {\n await dispatchCustomEvent(\"copilotkit_exit\", {}, config);\n}\n\nexport async function copilotKitEmitState(config: RunnableConfig, state: any) {\n await dispatchCustomEvent(\"copilotkit_manually_emit_intermediate_state\", state, config);\n}\n\nexport async function copilotKitEmitMessage(config: RunnableConfig, message: string) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_message\",\n { message, message_id: randomId(), role: \"assistant\" },\n config,\n );\n}\n\nexport async function copilotKitEmitToolCall(config: RunnableConfig, name: string, args: any) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_tool_call\",\n { name, args, id: randomId() },\n config,\n );\n}\n"],"mappings":";;;;AACA,SAASA,2BAA2B;AACpC,SAASC,gBAAgB;AACzB,SAASC,YAAYC,0BAA0B;AAexC,IAAMC,iCAAiCC,WAAWC,KAAK;EAC5DC,SAASF;AACX,CAAA;AAEO,IAAMG,4BAA4BH,WAAWC,KAAK;EACvDG,YAAYJ;EACZ,GAAGK,mBAAmBC;AACxB,CAAA;AAKO,SAASC,0BACdC,YACAC,SAAuB;AAEvB,QAAMC,YAAWF,yCAAYE,aAAY,CAAC;AAE1C,MAAID,mCAASE,SAAS;AACpBD,aAAS,4BAAA,IAAgC;AACzCA,aAAS,0BAAA,IAA8B;EACzC,OAAO;AACL,SAAID,mCAASG,mBAAkBC,QAAW;AACxCH,eAAS,4BAAA,IAAgCD,QAAQG;IACnD;AACA,SAAIH,mCAASK,kBAAiBD,QAAW;AACvCH,eAAS,0BAAA,IAA8BD,QAAQK;IACjD;EACF;AAEA,MAAIL,mCAASM,uBAAuB;AAClC,UAAMC,6BAA6BP,QAAQM,sBAAsBE,IAAI,CAACC,WAAW;MAC/EC,MAAMD,MAAMC;MACZC,eAAeF,MAAMG;MACrBC,WAAWJ,MAAMK;IACnB,EAAA;AAEAb,aAAS,oCAAA,IAAwCM;EACnD;AAEAR,eAAaA,cAAc,CAAC;AAE5B,SAAO;IACL,GAAGA;IACHE;EACF;AACF;AAlCgBH;AAoChB,eAAsBiB,eAAeC,QAAsB;AACzD,QAAMC,oBAAoB,mBAAmB,CAAC,GAAGD,MAAAA;AACnD;AAFsBD;AAItB,eAAsBG,oBAAoBF,QAAwBP,OAAU;AAC1E,QAAMQ,oBAAoB,+CAA+CR,OAAOO,MAAAA;AAClF;AAFsBE;AAItB,eAAsBC,sBAAsBH,QAAwBI,SAAe;AACjF,QAAMH,oBACJ,oCACA;IAAEG;IAASC,YAAYC,SAAAA;IAAYC,MAAM;EAAY,GACrDP,MAAAA;AAEJ;AANsBG;AAQtB,eAAsBK,uBAAuBR,QAAwBS,MAAcC,MAAS;AAC1F,QAAMT,oBACJ,sCACA;IAAEQ;IAAMC;IAAMC,IAAIL,SAAAA;EAAW,GAC7BN,MAAAA;AAEJ;AANsBQ;","names":["dispatchCustomEvent","randomId","Annotation","MessagesAnnotation","CopilotKitPropertiesAnnotation","Annotation","Root","actions","CopilotKitStateAnnotation","copilotKit","MessagesAnnotation","spec","copilotKitCustomizeConfig","baseConfig","options","metadata","emitAll","emitToolCalls","undefined","emitMessages","emitIntermediateState","snakeCaseIntermediateState","map","state","tool","tool_argument","toolArgument","state_key","stateKey","copilotKitExit","config","dispatchCustomEvent","copilotKitEmitState","copilotKitEmitMessage","message","message_id","randomId","role","copilotKitEmitToolCall","name","args","id"]}
1
+ {"version":3,"sources":["../src/langchain.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { dispatchCustomEvent } from \"@langchain/core/callbacks/dispatch\";\nimport { randomId } from \"@copilotkit/shared\";\nimport { Annotation, MessagesAnnotation } from \"@langchain/langgraph\";\n\ninterface IntermediateStateConfig {\n stateKey: string;\n tool: string;\n toolArgument?: string;\n}\n\ninterface OptionsConfig {\n emitToolCalls?: boolean | string | string[];\n emitMessages?: boolean;\n emitAll?: boolean;\n emitIntermediateState?: IntermediateStateConfig[];\n}\n\nexport const CopilotKitPropertiesAnnotation = Annotation.Root({\n actions: Annotation<any[]>,\n});\n\nexport const CopilotKitStateAnnotation = Annotation.Root({\n copilotkit: Annotation<typeof CopilotKitPropertiesAnnotation.State>,\n ...MessagesAnnotation.spec,\n});\n\nexport type CopilotKitState = typeof CopilotKitStateAnnotation.State;\nexport type CopilotKitProperties = typeof CopilotKitPropertiesAnnotation.State;\n\nexport function copilotKitCustomizeConfig(\n baseConfig: RunnableConfig,\n options?: OptionsConfig,\n): RunnableConfig {\n const metadata = baseConfig?.metadata || {};\n\n if (options?.emitAll) {\n metadata[\"copilotkit:emit-tool-calls\"] = true;\n metadata[\"copilotkit:emit-messages\"] = true;\n } else {\n if (options?.emitToolCalls !== undefined) {\n metadata[\"copilotkit:emit-tool-calls\"] = options.emitToolCalls;\n }\n if (options?.emitMessages !== undefined) {\n metadata[\"copilotkit:emit-messages\"] = options.emitMessages;\n }\n }\n\n if (options?.emitIntermediateState) {\n const snakeCaseIntermediateState = options.emitIntermediateState.map((state) => ({\n tool: state.tool,\n tool_argument: state.toolArgument,\n state_key: state.stateKey,\n }));\n\n metadata[\"copilotkit:emit-intermediate-state\"] = snakeCaseIntermediateState;\n }\n\n baseConfig = baseConfig || {};\n\n return {\n ...baseConfig,\n metadata: metadata,\n };\n}\n\nexport async function copilotKitExit(config: RunnableConfig) {\n await dispatchCustomEvent(\"copilotkit_exit\", {}, config);\n}\n\nexport async function copilotKitEmitState(config: RunnableConfig, state: any) {\n await dispatchCustomEvent(\"copilotkit_manually_emit_intermediate_state\", state, config);\n}\n\nexport async function copilotKitEmitMessage(config: RunnableConfig, message: string) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_message\",\n { message, message_id: randomId(), role: \"assistant\" },\n config,\n );\n}\n\nexport async function copilotKitEmitToolCall(config: RunnableConfig, name: string, args: any) {\n await dispatchCustomEvent(\n \"copilotkit_manually_emit_tool_call\",\n { name, args, id: randomId() },\n config,\n );\n}\n"],"mappings":";;;;AACA,SAASA,2BAA2B;AACpC,SAASC,gBAAgB;AACzB,SAASC,YAAYC,0BAA0B;AAexC,IAAMC,iCAAiCC,WAAWC,KAAK;EAC5DC,SAASF;AACX,CAAA;AAEO,IAAMG,4BAA4BH,WAAWC,KAAK;EACvDG,YAAYJ;EACZ,GAAGK,mBAAmBC;AACxB,CAAA;AAKO,SAASC,0BACdC,YACAC,SAAuB;AAEvB,QAAMC,YAAWF,yCAAYE,aAAY,CAAC;AAE1C,MAAID,mCAASE,SAAS;AACpBD,aAAS,4BAAA,IAAgC;AACzCA,aAAS,0BAAA,IAA8B;EACzC,OAAO;AACL,SAAID,mCAASG,mBAAkBC,QAAW;AACxCH,eAAS,4BAAA,IAAgCD,QAAQG;IACnD;AACA,SAAIH,mCAASK,kBAAiBD,QAAW;AACvCH,eAAS,0BAAA,IAA8BD,QAAQK;IACjD;EACF;AAEA,MAAIL,mCAASM,uBAAuB;AAClC,UAAMC,6BAA6BP,QAAQM,sBAAsBE,IAAI,CAACC,WAAW;MAC/EC,MAAMD,MAAMC;MACZC,eAAeF,MAAMG;MACrBC,WAAWJ,MAAMK;IACnB,EAAA;AAEAb,aAAS,oCAAA,IAAwCM;EACnD;AAEAR,eAAaA,cAAc,CAAC;AAE5B,SAAO;IACL,GAAGA;IACHE;EACF;AACF;AAlCgBH;AAoChB,eAAsBiB,eAAeC,QAAsB;AACzD,QAAMC,oBAAoB,mBAAmB,CAAC,GAAGD,MAAAA;AACnD;AAFsBD;AAItB,eAAsBG,oBAAoBF,QAAwBP,OAAU;AAC1E,QAAMQ,oBAAoB,+CAA+CR,OAAOO,MAAAA;AAClF;AAFsBE;AAItB,eAAsBC,sBAAsBH,QAAwBI,SAAe;AACjF,QAAMH,oBACJ,oCACA;IAAEG;IAASC,YAAYC,SAAAA;IAAYC,MAAM;EAAY,GACrDP,MAAAA;AAEJ;AANsBG;AAQtB,eAAsBK,uBAAuBR,QAAwBS,MAAcC,MAAS;AAC1F,QAAMT,oBACJ,sCACA;IAAEQ;IAAMC;IAAMC,IAAIL,SAAAA;EAAW,GAC7BN,MAAAA;AAEJ;AANsBQ;","names":["dispatchCustomEvent","randomId","Annotation","MessagesAnnotation","CopilotKitPropertiesAnnotation","Annotation","Root","actions","CopilotKitStateAnnotation","copilotkit","MessagesAnnotation","spec","copilotKitCustomizeConfig","baseConfig","options","metadata","emitAll","emitToolCalls","undefined","emitMessages","emitIntermediateState","snakeCaseIntermediateState","map","state","tool","tool_argument","toolArgument","state_key","stateKey","copilotKitExit","config","dispatchCustomEvent","copilotKitEmitState","copilotKitEmitMessage","message","message_id","randomId","role","copilotKitEmitToolCall","name","args","id"]}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.4.0-pre.16",
12
+ "version": "1.4.1-pre.0",
13
13
  "sideEffects": false,
14
14
  "main": "./dist/index.js",
15
15
  "module": "./dist/index.mjs",
@@ -49,8 +49,8 @@
49
49
  "tsup": "^6.7.0",
50
50
  "typescript": "^5.2.3",
51
51
  "zod-to-json-schema": "^3.23.5",
52
- "eslint-config-custom": "1.4.0-pre.16",
53
- "tsconfig": "1.4.0-pre.16"
52
+ "eslint-config-custom": "1.4.1-pre.0",
53
+ "tsconfig": "1.4.1-pre.0"
54
54
  },
55
55
  "dependencies": {
56
56
  "@langchain/community": "^0.0.53",
@@ -59,7 +59,7 @@
59
59
  "@langchain/langgraph-sdk": "^0.0.16",
60
60
  "langchain": "^0.3.3",
61
61
  "zod": "^3.23.3",
62
- "@copilotkit/shared": "1.4.0-pre.16"
62
+ "@copilotkit/shared": "1.4.1-pre.0"
63
63
  },
64
64
  "keywords": [
65
65
  "copilotkit",
package/src/langchain.ts CHANGED
@@ -21,7 +21,7 @@ export const CopilotKitPropertiesAnnotation = Annotation.Root({
21
21
  });
22
22
 
23
23
  export const CopilotKitStateAnnotation = Annotation.Root({
24
- copilotKit: Annotation<typeof CopilotKitPropertiesAnnotation.State>,
24
+ copilotkit: Annotation<typeof CopilotKitPropertiesAnnotation.State>,
25
25
  ...MessagesAnnotation.spec,
26
26
  });
27
27