@copilotkitnext/agent 0.0.22-alpha.1 → 0.0.22-alpha.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.
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-IUYX4NFB.mjs';import {b,e}from'./chunk-35U6P3BS.mjs';var h=b((y,s)=>{var c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,u=(e,r)=>{for(var o in r)c(e,o,{get:r[o],enumerable:true});},v=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of O(r))!d.call(e,i)&&i!==o&&c(e,i,{get:()=>r[i],enumerable:!(n=f(r,i))||n.enumerable});return e},T=e=>v(c({},"__esModule",{value:true}),e),p={};u(p,{refreshToken:()=>w});s.exports=T(p);var a$1=e(),t=a();async function w(){let{projectId:e,teamId:r}=(0, t.findProjectInfo)(),o=(0, t.loadToken)(e);if(!o||(0, t.isExpired)((0, t.getTokenPayload)(o.token))){let n=(0, t.getVercelCliToken)();if(!n)throw new a$1.VercelOidcTokenError("Failed to refresh OIDC token: login to vercel cli");if(!e)throw new a$1.VercelOidcTokenError("Failed to refresh OIDC token: project id not found");if(o=await(0, t.getVercelOidcToken)(n,e,r),!o)throw new a$1.VercelOidcTokenError("Failed to refresh OIDC token");(0, t.saveToken)(o,e);}process.env.VERCEL_OIDC_TOKEN=o.token;}});var tokenYXNKRWYU = h();export{tokenYXNKRWYU as default};//# sourceMappingURL=token-YXNKRWYU.mjs.map
2
+ //# sourceMappingURL=token-YXNKRWYU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.0.3/node_modules/@vercel/oidc/dist/token.js"],"names":["require_token","__commonJSMin","exports","module","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","token_exports","refreshToken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tB,CAAC,EACDlB,CAAAA,CAAO,OAAA,CAAUe,EAAaE,CAAa,CAAA,CAC3C,IAAIE,GAAAA,CAAqBC,CAAA,EAAA,CACrBC,CAAAA,CAAoBC,CAAA,EAAA,CACxB,eAAeJ,CAAAA,EAAe,CAC5B,GAAM,CAAE,UAAAK,CAAAA,CAAW,MAAA,CAAAC,CAAO,CAAA,CAAA,IAAQH,CAAAA,CAAkB,eAAA,GAAiB,CACjEI,CAAAA,CAAAA,IAAiBJ,CAAAA,CAAkB,WAAWE,CAAS,CAAA,CAC3D,GAAI,CAACE,CAAAA,EAAAA,IAAkBJ,CAAAA,CAAkB,eAAeA,CAAAA,CAAkB,eAAA,EAAiBI,CAAAA,CAAW,KAAK,CAAC,CAAA,CAAG,CAC7G,IAAMC,CAAAA,CAAAA,IAAgBL,EAAkB,iBAAA,GAAmB,CAC3D,GAAI,CAACK,CAAAA,CACH,MAAM,IAAIP,GAAAA,CAAmB,oBAAA,CAC3B,mDACF,CAAA,CAEF,GAAI,CAACI,CAAAA,CACH,MAAM,IAAIJ,GAAAA,CAAmB,oBAAA,CAC3B,oDACF,CAAA,CAGF,GADAM,CAAAA,CAAa,SAAUJ,CAAAA,CAAkB,kBAAA,EAAoBK,EAAWH,CAAAA,CAAWC,CAAM,EACrF,CAACC,CAAAA,CACH,MAAM,IAAIN,GAAAA,CAAmB,oBAAA,CAAqB,8BAA8B,CAAA,CAAA,IAE9EE,CAAAA,CAAkB,SAAA,EAAWI,CAAAA,CAAYF,CAAS,EACxD,CACA,OAAA,CAAQ,GAAA,CAAI,iBAAA,CAAoBE,CAAAA,CAAW,MAE7C,CAAA,CAAA,CAAA,CAAA,oBAAA,CAAA,EAAA","file":"token-YXNKRWYU.mjs","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken() {\n const { projectId, teamId } = (0, import_token_util.findProjectInfo)();\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {\n const authToken = (0, import_token_util.getVercelCliToken)();\n if (!authToken) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: login to vercel cli\"\n );\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: project id not found\"\n );\n }\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-IUYX4NFB.mjs';import'./chunk-35U6P3BS.mjs';var tokenUtilLL7M37BF = a();export{tokenUtilLL7M37BF as default};//# sourceMappingURL=token-util-LL7M37BF.mjs.map
2
+ //# sourceMappingURL=token-util-LL7M37BF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"token-util-LL7M37BF.mjs"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkitnext/agent",
3
- "version": "0.0.22-alpha.1",
3
+ "version": "0.0.22-alpha.2",
4
4
  "description": "Basic Agent for CopilotKit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "tsup": "^8.5.0",
22
22
  "typescript": "5.8.2",
23
23
  "vitest": "^3.0.5",
24
- "@copilotkitnext/typescript-config": "0.0.0",
25
- "@copilotkitnext/eslint-config": "0.0.0"
24
+ "@copilotkitnext/eslint-config": "0.0.0",
25
+ "@copilotkitnext/typescript-config": "0.0.0"
26
26
  },
27
27
  "dependencies": {
28
28
  "@ag-ui/client": "0.0.41-alpha.0",
package/tsup.config.ts CHANGED
@@ -1,11 +1,31 @@
1
1
  import { defineConfig } from 'tsup';
2
2
 
3
+ const isWatch = process.argv.includes("--watch");
4
+
3
5
  export default defineConfig({
4
6
  entry: ['src/index.ts'],
5
7
  format: ['cjs', 'esm'],
6
- dts: true,
8
+ dts: isWatch ? false : true,
7
9
  sourcemap: true,
8
- clean: true,
10
+ clean: !isWatch,
9
11
  target: 'es2022',
10
12
  outDir: 'dist',
13
+
14
+ // Bundle everything INTO the dist files (no external imports)
15
+ // This makes the package self-contained - consumers don't need to install transitive deps
16
+ noExternal: [/.*/],
17
+
18
+ // No peer dependencies in this package, so nothing needs to be external
19
+ external: [],
20
+
21
+ // Remove unused code
22
+ treeshake: true,
23
+
24
+ // Minify to reduce bundle size
25
+ minify: !isWatch,
26
+
27
+ esbuildOptions(opts) {
28
+ // No peer dependencies to keep external, but adding for consistency
29
+ opts.external = [];
30
+ },
11
31
  });