@cuylabs/agent-core 0.5.0 → 0.7.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.
Files changed (57) hide show
  1. package/README.md +85 -372
  2. package/dist/{builder-RcTZuYnO.d.ts → builder-BRvqCcIk.d.ts} +2 -2
  3. package/dist/{resolver-DOfZ-xuk.d.ts → capability-resolver-CgRGsWVX.d.ts} +1 -1
  4. package/dist/{chunk-IMGQOTU2.js → chunk-3HNO5SVI.js} +286 -690
  5. package/dist/chunk-5K7AQVOU.js +619 -0
  6. package/dist/{chunk-QAQADS4X.js → chunk-BNSHUWCV.js} +1 -0
  7. package/dist/{chunk-OTUGSCED.js → chunk-CDTV2UYU.js} +159 -1
  8. package/dist/chunk-IEFIQENH.js +73 -0
  9. package/dist/chunk-N7P4PN3O.js +84 -0
  10. package/dist/{chunk-QWFMX226.js → chunk-QGOGIP7T.js} +148 -15
  11. package/dist/chunk-VNQBHPCT.js +398 -0
  12. package/dist/{chunk-X635CM2F.js → chunk-ZPMACVZK.js} +1 -1
  13. package/dist/context/index.js +1 -1
  14. package/dist/host/index.d.ts +45 -0
  15. package/dist/host/index.js +8 -0
  16. package/dist/{index-p0kOsVsE.d.ts → index-C33hlD6H.d.ts} +12 -7
  17. package/dist/{index-tmhaADz5.d.ts → index-CfBGYrpd.d.ts} +121 -2
  18. package/dist/index.d.ts +107 -126
  19. package/dist/index.js +322 -597
  20. package/dist/inference/index.d.ts +59 -0
  21. package/dist/inference/index.js +25 -0
  22. package/dist/middleware/index.d.ts +8 -4
  23. package/dist/middleware/index.js +5 -3
  24. package/dist/models/index.d.ts +104 -2
  25. package/dist/models/index.js +40 -6
  26. package/dist/prompt/index.d.ts +10 -6
  27. package/dist/reasoning/index.d.ts +54 -8
  28. package/dist/reasoning/index.js +2 -3
  29. package/dist/{registry-CuRWWtcT.d.ts → registry-BDLIHOQB.d.ts} +1 -1
  30. package/dist/{runner-C7aMP_x3.d.ts → runner-DSKaEz3z.d.ts} +290 -7
  31. package/dist/runtime/index.d.ts +41 -7
  32. package/dist/runtime/index.js +15 -6
  33. package/dist/scope/index.d.ts +10 -0
  34. package/dist/scope/index.js +14 -0
  35. package/dist/{session-manager-Uawm2Le7.d.ts → session-manager-B_CWGTsl.d.ts} +1 -1
  36. package/dist/skill/index.d.ts +7 -5
  37. package/dist/storage/index.d.ts +2 -2
  38. package/dist/sub-agent/index.d.ts +12 -8
  39. package/dist/tool/index.d.ts +8 -4
  40. package/dist/tool/index.js +4 -3
  41. package/dist/{tool-pFAnJc5Y.d.ts → tool-Db1Ue-1U.d.ts} +1 -1
  42. package/dist/{tool-DYp6-cC3.d.ts → tool-HUtkiVBx.d.ts} +5 -99
  43. package/dist/tracking/index.d.ts +3 -1
  44. package/dist/types-9jGQUjqW.d.ts +29 -0
  45. package/dist/types-CHiPh8U2.d.ts +100 -0
  46. package/dist/types-CqDZTh4d.d.ts +335 -0
  47. package/dist/types-FRpzzg_9.d.ts +355 -0
  48. package/package.json +19 -8
  49. package/dist/capabilities/index.d.ts +0 -97
  50. package/dist/capabilities/index.js +0 -46
  51. package/dist/chunk-6TDTQJ4P.js +0 -116
  52. package/dist/chunk-DWYX7ASF.js +0 -26
  53. package/dist/chunk-FG4MD5MU.js +0 -54
  54. package/dist/config-D2xeGEHK.d.ts +0 -52
  55. package/dist/identifiers-BLUxFqV_.d.ts +0 -12
  56. package/dist/network-D76DS5ot.d.ts +0 -5
  57. package/dist/types-MM1JoX5T.d.ts +0 -810
@@ -1,26 +0,0 @@
1
- // src/models/identifiers.ts
2
- function getModelId(model) {
3
- if (typeof model === "string") return model;
4
- if (typeof model === "object" && model !== null && "modelId" in model) {
5
- return String(model.modelId);
6
- }
7
- return String(model);
8
- }
9
- function getProviderId(model) {
10
- if (typeof model === "string") {
11
- if (model.includes("/")) {
12
- return model.split("/")[0];
13
- }
14
- return void 0;
15
- }
16
- if (typeof model === "object" && model !== null && "provider" in model) {
17
- const provider = String(model.provider);
18
- return provider.split(".")[0];
19
- }
20
- return void 0;
21
- }
22
-
23
- export {
24
- getModelId,
25
- getProviderId
26
- };
@@ -1,54 +0,0 @@
1
- import {
2
- extractFilePathsFromArgs,
3
- shouldCaptureBaseline
4
- } from "./chunk-VEKUXUVF.js";
5
-
6
- // src/tool/executor.ts
7
- async function executeAgentToolCall(options) {
8
- const initialized = await options.tool.init({ cwd: options.cwd });
9
- const ctx = {
10
- cwd: options.cwd,
11
- abort: options.abort,
12
- sessionID: options.sessionID,
13
- messageID: options.messageID,
14
- agent: options.agent ?? "default",
15
- ...options.host ? { host: options.host } : {},
16
- ...options.turnTracker ? { turnTracker: options.turnTracker } : {}
17
- };
18
- if (options.middleware?.hasMiddleware) {
19
- const decision = await options.middleware.runBeforeToolCall(
20
- options.toolName,
21
- options.params,
22
- ctx
23
- );
24
- if (decision.action === "deny") {
25
- return {
26
- output: decision.reason ?? `Tool call denied: ${options.toolName}`
27
- };
28
- }
29
- }
30
- if (options.turnTracker && initialized.fileOps && shouldCaptureBaseline(initialized.fileOps)) {
31
- const paths = extractFilePathsFromArgs(
32
- options.params,
33
- initialized.fileOps
34
- );
35
- for (const path of paths) {
36
- await options.turnTracker.beforeWrite(path);
37
- }
38
- }
39
- const result = await initialized.execute(options.params, ctx);
40
- if (options.middleware?.hasMiddleware) {
41
- const transformed = await options.middleware.runAfterToolCall(
42
- options.toolName,
43
- options.params,
44
- result,
45
- ctx
46
- );
47
- return { output: transformed.output };
48
- }
49
- return { output: result.output };
50
- }
51
-
52
- export {
53
- executeAgentToolCall
54
- };
@@ -1,52 +0,0 @@
1
- import { LanguageModel } from 'ai';
2
- import { ProviderOptions } from '@ai-sdk/provider-utils';
3
- import { R as ReasoningLevel, a as ReasoningConfig } from './types-CQaXbRsS.js';
4
-
5
- /**
6
- * Reasoning Configuration & Option Builders
7
- *
8
- * Orchestrates capability detection and provider-specific option
9
- * building to produce ready-to-use `providerOptions` for the
10
- * Vercel AI SDK.
11
- *
12
- * Two flavours of every function are provided:
13
- * - **Async** (`getReasoningConfig`, `buildReasoningOptions`) —
14
- * uses the full capability resolver (network + cache).
15
- * - **Sync** (`getReasoningConfigSync`, `buildReasoningOptionsSync`) —
16
- * uses fast pattern-matching only (no network).
17
- */
18
-
19
- /**
20
- * Get the reasoning configuration for a model.
21
- *
22
- * Uses the full capability resolver (including network lookups)
23
- * for the most accurate result.
24
- */
25
- declare function getReasoningConfig(model: LanguageModel): Promise<ReasoningConfig>;
26
- /**
27
- * Synchronous reasoning config using pattern-matching only.
28
- *
29
- * Faster but less accurate than {@link getReasoningConfig}.
30
- * Good for hot paths where async is impractical.
31
- */
32
- declare function getReasoningConfigSync(model: LanguageModel): ReasoningConfig;
33
- /**
34
- * Build `providerOptions` for a reasoning level (async).
35
- *
36
- * Returns `undefined` when reasoning is off or unsupported.
37
- */
38
- declare function buildReasoningOptions(model: LanguageModel, level: ReasoningLevel): Promise<ProviderOptions | undefined>;
39
- /**
40
- * Build `providerOptions` for a reasoning level (sync / pattern-only).
41
- */
42
- declare function buildReasoningOptionsSync(model: LanguageModel, level: ReasoningLevel): ProviderOptions | undefined;
43
- /**
44
- * Check whether a model supports reasoning (async, full resolver).
45
- */
46
- declare function supportsReasoning(model: LanguageModel): Promise<boolean>;
47
- /**
48
- * Synchronous check using pattern-matching only.
49
- */
50
- declare function supportsReasoningSync(model: LanguageModel): boolean;
51
-
52
- export { buildReasoningOptionsSync as a, buildReasoningOptions as b, getReasoningConfigSync as c, supportsReasoningSync as d, getReasoningConfig as g, supportsReasoning as s };
@@ -1,12 +0,0 @@
1
- import { LanguageModel } from 'ai';
2
-
3
- /**
4
- * Extract a model ID string from a LanguageModel instance.
5
- */
6
- declare function getModelId(model: LanguageModel): string;
7
- /**
8
- * Extract a provider identifier from a LanguageModel instance.
9
- */
10
- declare function getProviderId(model: LanguageModel): string | undefined;
11
-
12
- export { getProviderId as a, getModelId as g };
@@ -1,5 +0,0 @@
1
- import { N as NetworkStatus } from './resolver-DOfZ-xuk.js';
2
-
3
- declare function getNetworkStatus(): NetworkStatus;
4
-
5
- export { getNetworkStatus as g };