@outputai/core 0.15.1-dev.46e7530.0 → 0.15.1-dev.de5fa8c.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 (101) hide show
  1. package/dist/credentials/index.d.ts +1 -1
  2. package/dist/credentials/types.d.ts +4 -4
  3. package/dist/evals/aggregate.d.ts +2 -0
  4. package/dist/evals/aggregate.js +11 -0
  5. package/dist/evals/eval_workflow.d.ts +20 -0
  6. package/dist/evals/eval_workflow.js +98 -0
  7. package/dist/evals/index.d.ts +7 -0
  8. package/dist/evals/index.js +4 -0
  9. package/dist/evals/interpret.d.ts +3 -0
  10. package/dist/evals/interpret.js +40 -0
  11. package/dist/evals/schemas.d.ts +96 -0
  12. package/dist/evals/schemas.js +60 -0
  13. package/dist/evals/verdict.d.ts +27 -0
  14. package/dist/evals/verdict.js +109 -0
  15. package/dist/evals/verify.d.ts +42 -0
  16. package/dist/evals/verify.js +19 -0
  17. package/package.json +64 -14
  18. package/src/consts.d.ts +2 -0
  19. package/src/helpers/fetch.js +21 -9
  20. package/src/helpers/path.js +34 -0
  21. package/src/helpers/redact.js +2 -1
  22. package/src/http/config.js +10 -0
  23. package/src/http/cost.d.ts +20 -0
  24. package/src/http/cost.js +41 -0
  25. package/src/http/fetch/events.js +10 -0
  26. package/src/http/fetch/index.d.ts +24 -0
  27. package/src/http/fetch/index.js +78 -0
  28. package/src/http/fetch/logger.d.ts +10 -0
  29. package/src/http/fetch/logger.js +56 -0
  30. package/src/http/index.d.ts +28 -0
  31. package/src/http/index.js +9 -0
  32. package/src/http/ky/index.d.ts +25 -0
  33. package/src/http/ky/index.js +10 -0
  34. package/src/http/request_tag.js +30 -0
  35. package/src/interface/index.d.ts +1 -0
  36. package/src/llm/agent.js +147 -0
  37. package/src/llm/ai_provider.js +131 -0
  38. package/src/llm/ai_sdk_options.js +126 -0
  39. package/src/llm/consts.js +6 -0
  40. package/src/llm/deprecated_provider_aliases.js +8 -0
  41. package/src/llm/generate.js +98 -0
  42. package/src/llm/index.d.ts +697 -0
  43. package/src/llm/index.js +6 -0
  44. package/src/llm/judge.js +48 -0
  45. package/src/llm/prompt/content.js +70 -0
  46. package/src/llm/prompt/interpolations.js +58 -0
  47. package/src/llm/prompt/loader.js +67 -0
  48. package/src/llm/prompt/markup/attributes.js +52 -0
  49. package/src/llm/prompt/markup/nodes.js +71 -0
  50. package/src/llm/prompt/markup/tokenizer.js +3 -0
  51. package/src/llm/prompt/markup/tokens.js +26 -0
  52. package/src/llm/prompt/validations.js +129 -0
  53. package/src/llm/utils/cost.js +267 -0
  54. package/src/llm/utils/error_handler.js +53 -0
  55. package/src/llm/utils/file.js +42 -0
  56. package/src/llm/utils/google_vertex_auth.js +31 -0
  57. package/src/llm/utils/image.js +37 -0
  58. package/src/llm/utils/legacy_cost_attribute.js +75 -0
  59. package/src/llm/utils/metering.js +139 -0
  60. package/src/llm/utils/models.js +15 -0
  61. package/src/llm/utils/models_pricing.js +96 -0
  62. package/src/llm/utils/models_pricing_snapshot.json +4711 -0
  63. package/src/llm/utils/skills.js +74 -0
  64. package/src/llm/utils/sources.js +73 -0
  65. package/src/llm/utils/stream.js +75 -0
  66. package/src/llm/utils/tools.js +62 -0
  67. package/src/llm/utils/usage.js +155 -0
  68. package/src/llm/utils/usage_tools.js +23 -0
  69. package/src/llm/utils/web_search.js +155 -0
  70. package/src/llm/utils/wrap.js +279 -0
  71. package/src/llm/validations.js +234 -0
  72. package/src/tracing/trace_attribute.d.ts +0 -17
  73. package/src/tracing/trace_attribute.js +1 -29
  74. package/src/worker/bundler_options.js +1 -9
  75. package/src/worker/configs.js +23 -4
  76. package/src/worker/index.js +16 -47
  77. package/src/worker/interceptors/activity.js +0 -1
  78. package/src/worker/interceptors/workflow.js +0 -1
  79. package/src/worker/loader/workflows.js +16 -2
  80. package/src/worker/telemetry.js +122 -2
  81. package/src/worker/webpack_loaders/workflow_rewriter/index.mjs +3 -7
  82. package/src/worker/webpack_loaders/workflow_rewriter/rewrite_activity_calls.js +27 -7
  83. package/src/worker/webpack_loaders/workflow_validator/npm_workflow_export_resolve.js +5 -6
  84. package/src/worker/worker_options.js +43 -0
  85. package/src/sdk/README.md +0 -47
  86. package/src/sdk/helpers/component_metadata.d.ts +0 -17
  87. package/src/sdk/helpers/component_metadata.js +0 -6
  88. package/src/sdk/helpers/index.d.ts +0 -12
  89. package/src/sdk/helpers/index.js +0 -3
  90. package/src/sdk/helpers/objects.d.ts +0 -56
  91. package/src/sdk/helpers/objects.js +0 -8
  92. package/src/sdk/helpers/path.d.ts +0 -11
  93. package/src/sdk/helpers/path.js +0 -32
  94. package/src/sdk/runtime/context.d.ts +0 -30
  95. package/src/sdk/runtime/context.js +0 -15
  96. package/src/sdk/runtime/events.d.ts +0 -13
  97. package/src/sdk/runtime/events.js +0 -5
  98. package/src/sdk/runtime/index.d.ts +0 -12
  99. package/src/sdk/runtime/index.js +0 -3
  100. package/src/sdk/runtime/tracing.d.ts +0 -48
  101. package/src/sdk/runtime/tracing.js +0 -11
@@ -1,30 +0,0 @@
1
- import type { Info } from '@temporalio/activity';
2
-
3
- /**
4
- * Context object
5
- */
6
- export type Context = {
7
- /** Temporal info about the current activity */
8
- activityInfo: Info,
9
- /** Path of the workflow file */
10
- workflowFilename: string
11
- };
12
-
13
- /**
14
- * Tools to interact with Runtime context
15
- */
16
- export declare const Context: {
17
-
18
- /**
19
- * Returns information about the current Temporal execution.
20
- *
21
- * Only available when called from within a step or evaluator (Temporal Activities) running in the Temporal runtime.
22
- *
23
- * @remarks
24
- * - Returns `null` when not called inside a Temporal Activity (steps/evaluators);
25
- * - Returns `null` when not called from within a running Temporal worker, like in unit tests environment;
26
- *
27
- * @returns The workflow context, or `null` if unavailable or incomplete.
28
- */
29
- getActivityContext(): Context | null;
30
- };
@@ -1,15 +0,0 @@
1
- import { Storage } from '#async_storage';
2
-
3
- export const Context = {
4
- getActivityContext: () => {
5
- const ctx = Storage.load();
6
- if ( !ctx ) {
7
- return null;
8
- }
9
-
10
- return {
11
- workflowFilename: ctx.workflowFilename,
12
- activityInfo: ctx.activityInfo
13
- };
14
- }
15
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Tools to interact with Events
3
- */
4
- export declare const Event: {
5
-
6
- /**
7
- * Emits an event on step message bus.
8
- *
9
- * @param eventName - The name of the event to emit
10
- * @param payload - An optional payload to send to the event.
11
- */
12
- emit( eventName: string, payload?: object ): boolean;
13
- };
@@ -1,5 +0,0 @@
1
- import { stepEventBus } from '#bus';
2
-
3
- export const Event = {
4
- emit: ( eventName, payload ) => stepEventBus.emit( `sdk:${eventName}`, payload )
5
- };
@@ -1,12 +0,0 @@
1
- /**
2
- * > [!WARNING]
3
- * > **Internal use only.** Not part of the public API; may change without notice.
4
- *
5
- * These are helpers for other SDK modules integration.
6
- * These need Temporal activity runtime to work, as they access state, emit events and use node:* modules.
7
- *
8
- * @packageDocumentation
9
- */
10
- export * from './context.js';
11
- export * from './events.js';
12
- export * from './tracing.js';
@@ -1,3 +0,0 @@
1
- export * from './context.js';
2
- export * from './events.js';
3
- export * from './tracing.js';
@@ -1,48 +0,0 @@
1
- import { Attribute } from '#trace_attribute';
2
-
3
- export type BaseAttribute = InstanceType<typeof Attribute.BaseAttribute>;
4
-
5
- /**
6
- * Tools to interact with Tracing
7
- */
8
- export declare const Tracing: {
9
- Attribute: typeof Attribute;
10
-
11
- /**
12
- * Creates a new event.
13
- *
14
- * @param args
15
- * @param args.id - A unique id for the Event.
16
- * @param args.kind - The kind of Event, like HTTP, DiskWrite, DBOp, etc.
17
- * @param args.name - The human-friendly name of the Event: query, request, create.
18
- * @param args.details - Arbitrary data to add to this event, it will be used as the "input" field.
19
- */
20
- addEventStart( args: { id: string; kind: string; name: string; details: unknown } ): void;
21
-
22
- /**
23
- * Concludes an event.
24
- *
25
- * @param args
26
- * @param args.id - The id of the event to conclude.
27
- * @param args.details - Arbitrary data to add to this event, it will be used as the "output" field.
28
- */
29
- addEventEnd( args: { id: string; details: unknown } ): void;
30
-
31
- /**
32
- * Concludes an event with an error.
33
- *
34
- * @param args
35
- * @param args.id - The id of the event to conclude.
36
- * @param args.details - Arbitrary data to add to this event, it will be used as the "error" field.
37
- */
38
- addEventError( args: { id: string; details: unknown } ): void;
39
-
40
- /**
41
- * Adds an attribute to an event.
42
- *
43
- * @param args
44
- * @param args.eventId - The id of the event to attach the attribute to.
45
- * @param args.attribute - The attribute to attach to the event.
46
- */
47
- addEventAttribute( args: { eventId: string; attribute: Attribute.Instance } ): void;
48
- };
@@ -1,11 +0,0 @@
1
- import { addEventActionWithContext as send, EventAction } from '#tracing';
2
-
3
- import { Attribute } from '#trace_attribute';
4
-
5
- export const Tracing = {
6
- Attribute,
7
- addEventStart: ( { id, kind, name, details } ) => send( EventAction.START, { kind, name, details, id } ),
8
- addEventEnd: ( { id, details } ) => send( EventAction.END, { id, details } ),
9
- addEventError: ( { id, details } ) => send( EventAction.ERROR, { id, details } ),
10
- addEventAttribute: ( { eventId, attribute } ) => send( EventAction.ADD_ATTR, { id: eventId, details: attribute } )
11
- };