veryfront 0.1.508 → 0.1.509

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 (53) hide show
  1. package/esm/deno.js +1 -1
  2. package/esm/src/agent/{hosted-service-auth.d.ts → agent-service-auth.d.ts} +18 -1
  3. package/esm/src/agent/agent-service-auth.d.ts.map +1 -0
  4. package/esm/src/agent/{hosted-service-auth.js → agent-service-auth.js} +4 -0
  5. package/esm/src/agent/{hosted-agent-service-config.d.ts → agent-service-config.d.ts} +8 -8
  6. package/esm/src/agent/agent-service-config.d.ts.map +1 -0
  7. package/esm/src/agent/{hosted-agent-service-config.js → agent-service-config.js} +6 -6
  8. package/esm/src/agent/agent-service-env-files.d.ts +13 -0
  9. package/esm/src/agent/agent-service-env-files.d.ts.map +1 -0
  10. package/esm/src/agent/{hosted-agent-service-env-files.js → agent-service-env-files.js} +4 -6
  11. package/esm/src/agent/{hosted-agent-service-routes.d.ts → agent-service-routes.d.ts} +11 -2
  12. package/esm/src/agent/agent-service-routes.d.ts.map +1 -0
  13. package/esm/src/agent/{hosted-agent-service-routes.js → agent-service-routes.js} +2 -1
  14. package/esm/src/agent/{hosted-agent-service-runtime.d.ts → agent-service-runtime.d.ts} +12 -12
  15. package/esm/src/agent/agent-service-runtime.d.ts.map +1 -0
  16. package/esm/src/agent/{hosted-agent-service-runtime.js → agent-service-runtime.js} +11 -11
  17. package/esm/src/agent/hosted-project-steering-adapter.js +1 -1
  18. package/esm/src/agent/index.d.ts +7 -7
  19. package/esm/src/agent/index.d.ts.map +1 -1
  20. package/esm/src/agent/index.js +7 -7
  21. package/esm/src/agent/node-agent-service-runtime-infrastructure.d.ts +26 -0
  22. package/esm/src/agent/node-agent-service-runtime-infrastructure.d.ts.map +1 -0
  23. package/esm/src/agent/{node-hosted-agent-service-runtime-infrastructure.js → node-agent-service-runtime-infrastructure.js} +7 -9
  24. package/esm/src/agent/{node-hosted-agent-service-telemetry.d.ts → node-agent-service-telemetry.d.ts} +1 -1
  25. package/esm/src/agent/node-agent-service-telemetry.d.ts.map +1 -0
  26. package/esm/src/agent/veryfront-cloud-agent-service.d.ts +2 -2
  27. package/esm/src/agent/veryfront-cloud-agent-service.d.ts.map +1 -1
  28. package/esm/src/agent/veryfront-cloud-agent-service.js +3 -3
  29. package/esm/src/utils/version-constant.d.ts +1 -1
  30. package/esm/src/utils/version-constant.js +1 -1
  31. package/package.json +1 -1
  32. package/src/deno.js +1 -1
  33. package/src/src/agent/{hosted-service-auth.ts → agent-service-auth.ts} +21 -0
  34. package/src/src/agent/{hosted-agent-service-config.ts → agent-service-config.ts} +12 -13
  35. package/src/src/agent/{hosted-agent-service-env-files.ts → agent-service-env-files.ts} +10 -14
  36. package/src/src/agent/{hosted-agent-service-routes.ts → agent-service-routes.ts} +25 -1
  37. package/src/src/agent/{hosted-agent-service-runtime.ts → agent-service-runtime.ts} +39 -39
  38. package/src/src/agent/hosted-project-steering-adapter.ts +1 -1
  39. package/src/src/agent/index.ts +7 -7
  40. package/src/src/agent/{node-hosted-agent-service-runtime-infrastructure.ts → node-agent-service-runtime-infrastructure.ts} +27 -30
  41. package/src/src/agent/veryfront-cloud-agent-service.ts +3 -3
  42. package/src/src/utils/version-constant.ts +1 -1
  43. package/esm/src/agent/hosted-agent-service-config.d.ts.map +0 -1
  44. package/esm/src/agent/hosted-agent-service-env-files.d.ts +0 -13
  45. package/esm/src/agent/hosted-agent-service-env-files.d.ts.map +0 -1
  46. package/esm/src/agent/hosted-agent-service-routes.d.ts.map +0 -1
  47. package/esm/src/agent/hosted-agent-service-runtime.d.ts.map +0 -1
  48. package/esm/src/agent/hosted-service-auth.d.ts.map +0 -1
  49. package/esm/src/agent/node-hosted-agent-service-runtime-infrastructure.d.ts +0 -26
  50. package/esm/src/agent/node-hosted-agent-service-runtime-infrastructure.d.ts.map +0 -1
  51. package/esm/src/agent/node-hosted-agent-service-telemetry.d.ts.map +0 -1
  52. /package/esm/src/agent/{node-hosted-agent-service-telemetry.js → node-agent-service-telemetry.js} +0 -0
  53. /package/src/src/agent/{node-hosted-agent-service-telemetry.ts → node-agent-service-telemetry.ts} +0 -0
@@ -99,12 +99,12 @@ export { defineAgentService, } from "./agent-service.js";
99
99
  export { createAgentServiceServerRuntime, startAgentServiceServer, startNodeAgentServiceServer, } from "./agent-service-server.js";
100
100
  export { createDefaultHostedChatRuntime, createDefaultHostedChatRuntime as createDefaultAgentServiceChatRuntime, } from "./default-hosted-chat-runtime.js";
101
101
  export { createDefaultHostedProjectSteeringRefresh, createDefaultHostedProjectSteeringRefresh as createDefaultAgentServiceProjectSteeringRefresh, fetchDefaultHostedProjectSteering, fetchDefaultHostedProjectSteering as fetchDefaultAgentServiceProjectSteering, } from "./default-hosted-project-steering-refresh.js";
102
- export { createAgentServiceRuntime, createHostedAgentServiceRuntime, startAgentServiceRuntime, startNodeAgentService, startNodeHostedAgentService, } from "./hosted-agent-service-runtime.js";
102
+ export { createAgentServiceRuntime, createHostedAgentServiceRuntime, startAgentServiceRuntime, startNodeAgentService, startNodeHostedAgentService, } from "./agent-service-runtime.js";
103
103
  export { createNodeVeryfrontCloudAgentServiceRuntime, startAgentService, startNodeVeryfrontCloudAgentService, } from "./veryfront-cloud-agent-service.js";
104
- export { agentServiceConfigSchema, hostedAgentServiceConfigSchema, parseAgentServiceConfig, parseHostedAgentServiceConfig, } from "./hosted-agent-service-config.js";
105
- export { loadAgentServiceEnvFiles, loadHostedAgentServiceEnvFiles, } from "./hosted-agent-service-env-files.js";
106
- export { initializeNodeAgentServiceOpenTelemetry, initializeNodeHostedAgentServiceOpenTelemetry, resolveNodeAgentServiceTelemetryConfig, resolveNodeHostedAgentServiceTelemetryConfig, } from "./node-hosted-agent-service-telemetry.js";
107
- export { createNodeAgentServiceRuntimeInfrastructure, createNodeHostedAgentServiceRuntimeInfrastructure, } from "./node-hosted-agent-service-runtime-infrastructure.js";
104
+ export { agentServiceConfigSchema, hostedAgentServiceConfigSchema, parseAgentServiceConfig, parseHostedAgentServiceConfig, } from "./agent-service-config.js";
105
+ export { loadAgentServiceEnvFiles, loadHostedAgentServiceEnvFiles, } from "./agent-service-env-files.js";
106
+ export { initializeNodeAgentServiceOpenTelemetry, initializeNodeHostedAgentServiceOpenTelemetry, resolveNodeAgentServiceTelemetryConfig, resolveNodeHostedAgentServiceTelemetryConfig, } from "./node-agent-service-telemetry.js";
107
+ export { createNodeAgentServiceRuntimeInfrastructure, createNodeHostedAgentServiceRuntimeInfrastructure, } from "./node-agent-service-runtime-infrastructure.js";
108
108
  export { bootstrapAgentService, runAgentServiceMain, } from "./agent-service-bootstrap.js";
109
109
  export { installAbortRejectionGuard, isAbortRejectionReason, } from "./abort-rejection-guard.js";
110
110
  export { createRequestAuthCache, } from "./request-auth-cache.js";
@@ -115,7 +115,7 @@ export { getAgUiRuntimeContextItemSchema, getAgUiRuntimeInjectedToolSchema, getA
115
115
  export { buildAgentRunTraceAttributes, buildExecuteToolTraceAttributes, buildFinalizedAgentRunTraceAttributes, buildInvokeAgentTraceAttributes, filterAgentTraceAttributes, isAgentTraceAttributeValue, } from "./agent-trace-attributes.js";
116
116
  export { createHostedChatRuntimeAgentAdapter, } from "./hosted-chat-runtime-agent-adapter.js";
117
117
  export { createHostedAgentRunSpanController, createHostedRootRunLifecycleRuntimeAdapter, } from "./hosted-agent-run-lifecycle.js";
118
- export { createHostedAgentServiceRouteSet, createHostedAgentServiceRouteSet as createAgentServiceRouteSet, } from "./hosted-agent-service-routes.js";
118
+ export { createHostedAgentServiceRouteSet, createHostedAgentServiceRouteSet as createAgentServiceRouteSet, } from "./agent-service-routes.js";
119
119
  export { createHostedRuntimeStateResolver, } from "./hosted-runtime-state-resolver.js";
120
120
  export { executeHostedDurableChatRun, resolveHostedDurableRunSetupErrorResponse, } from "./hosted-durable-chat-run-start.js";
121
121
  export { buildParsedHostedChatRequest, buildParsedHostedChatRequest as buildParsedAgentServiceChatRequest, parseHostedChatRequestFromRequest, parseHostedChatRequestFromRequest as parseAgentServiceChatRequestFromRequest, parseRuntimeAgentRunInvocationHostedChatRequestFromRequest, parseRuntimeAgentRunInvocationHostedChatRequestFromRequest as parseRuntimeAgentRunInvocationAgentServiceChatRequestFromRequest, } from "./hosted-chat-request-parser.js";
@@ -220,4 +220,4 @@ export { buildInputRequestLifecycleDataEvent, createInputRequest, getCreateInput
220
220
  export { executeDurableHumanInputFlow, getHumanInputFieldSchema, getHumanInputOptionSchema, getHumanInputPendingRequestSchema, getHumanInputRequestSchema, getHumanInputResultSchema, HumanInputResumeError, InvalidHumanInputResultError, waitForDurableHumanInputResolution, waitForHumanInput, } from "./human-input.js";
221
221
  export { createChatHandler, } from "./chat-handler.js";
222
222
  export { AgentRuntime, getProviderToolProfile, RunAlreadyExistsError, RunCancelledError, RunNotActiveError, RunResumeSessionManager, sanitizeProviderToolSchema, selectProviderCompatibleToolNames, selectProviderCompatibleTools, WaitConflictError, WaitNotPendingError, } from "./runtime/index.js";
223
- export { createHostedServiceAuth, createHostedServiceAuth as createAgentServiceAuth, getHostedServiceTokenFromRequest, getHostedServiceTokenFromRequest as getAgentServiceTokenFromRequest, HostedServiceAuthError, HostedServiceAuthError as AgentServiceAuthError, isHostedServiceAuthError, isHostedServiceAuthError as isAgentServiceAuthError, } from "./hosted-service-auth.js";
223
+ export { createHostedServiceAuth, createHostedServiceAuth as createAgentServiceAuth, getHostedServiceTokenFromRequest, getHostedServiceTokenFromRequest as getAgentServiceTokenFromRequest, HostedServiceAuthError, HostedServiceAuthError as AgentServiceAuthError, isHostedServiceAuthError, isHostedServiceAuthError as isAgentServiceAuthError, } from "./agent-service-auth.js";
@@ -0,0 +1,26 @@
1
+ import { createOpenTelemetryServiceTracer, type ServiceTracerAttributes } from "../observability/tracing/service-tracer.js";
2
+ import { type Logger } from "../utils/logger/index.js";
3
+ import { type AgentServiceConfig, type AgentServiceConfigInput } from "./agent-service-config.js";
4
+ import { type NodeAgentServiceTelemetryEnv, type NodeAgentServiceTelemetryLogger, type NodeAgentServiceTelemetryProcessTarget } from "./node-agent-service-telemetry.js";
5
+ export type CreateNodeAgentServiceRuntimeInfrastructureOptions = {
6
+ serviceName: string;
7
+ env: AgentServiceConfigInput & NodeAgentServiceTelemetryEnv;
8
+ telemetryLogger?: NodeAgentServiceTelemetryLogger;
9
+ processTarget?: NodeAgentServiceTelemetryProcessTarget;
10
+ };
11
+ export type CreateNodeHostedAgentServiceRuntimeInfrastructureOptions = CreateNodeAgentServiceRuntimeInfrastructureOptions;
12
+ export type NodeAgentServiceRuntimeInfrastructure = {
13
+ getConfig(): AgentServiceConfig;
14
+ logger: Logger;
15
+ tracer: ReturnType<typeof createOpenTelemetryServiceTracer>["tracer"];
16
+ setActiveSpanAttributes(attributes: ServiceTracerAttributes): void;
17
+ getTraceContext(): {
18
+ traceId?: string;
19
+ spanId?: string;
20
+ };
21
+ initializeOpenTelemetry(): Promise<boolean>;
22
+ };
23
+ export type NodeHostedAgentServiceRuntimeInfrastructure = NodeAgentServiceRuntimeInfrastructure;
24
+ export declare function createNodeAgentServiceRuntimeInfrastructure(options: CreateNodeAgentServiceRuntimeInfrastructureOptions): NodeAgentServiceRuntimeInfrastructure;
25
+ export declare const createNodeHostedAgentServiceRuntimeInfrastructure: typeof createNodeAgentServiceRuntimeInfrastructure;
26
+ //# sourceMappingURL=node-agent-service-runtime-infrastructure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-agent-service-runtime-infrastructure.d.ts","sourceRoot":"","sources":["../../../src/src/agent/node-agent-service-runtime-infrastructure.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gCAAgC,EAChC,KAAK,uBAAuB,EAC7B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAE7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,sCAAsC,EAE5C,MAAM,mCAAmC,CAAC;AAE3C,MAAM,MAAM,kDAAkD,GAAG;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,uBAAuB,GAAG,4BAA4B,CAAC;IAC5D,eAAe,CAAC,EAAE,+BAA+B,CAAC;IAClD,aAAa,CAAC,EAAE,sCAAsC,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,wDAAwD,GAClE,kDAAkD,CAAC;AAErD,MAAM,MAAM,qCAAqC,GAAG;IAClD,SAAS,IAAI,kBAAkB,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACtE,uBAAuB,CAAC,UAAU,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACnE,eAAe,IAAI;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG,qCAAqC,CAAC;AAEhG,wBAAgB,2CAA2C,CACzD,OAAO,EAAE,kDAAkD,GAC1D,qCAAqC,CAyBvC;AAED,eAAO,MAAM,iDAAiD,oDACjB,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import * as api from "@opentelemetry/api";
2
2
  import { createOpenTelemetryServiceTracer, } from "../observability/tracing/service-tracer.js";
3
3
  import { agentLogger } from "../utils/logger/index.js";
4
- import { parseHostedAgentServiceConfig, } from "./hosted-agent-service-config.js";
5
- import { initializeNodeHostedAgentServiceOpenTelemetry, resolveNodeHostedAgentServiceTelemetryConfig, } from "./node-hosted-agent-service-telemetry.js";
6
- export function createNodeHostedAgentServiceRuntimeInfrastructure(options) {
7
- const telemetryConfig = resolveNodeHostedAgentServiceTelemetryConfig({
4
+ import { parseAgentServiceConfig, } from "./agent-service-config.js";
5
+ import { initializeNodeAgentServiceOpenTelemetry, resolveNodeAgentServiceTelemetryConfig, } from "./node-agent-service-telemetry.js";
6
+ export function createNodeAgentServiceRuntimeInfrastructure(options) {
7
+ const telemetryConfig = resolveNodeAgentServiceTelemetryConfig({
8
8
  env: options.env,
9
9
  defaultServiceName: options.serviceName,
10
10
  });
@@ -15,18 +15,16 @@ export function createNodeHostedAgentServiceRuntimeInfrastructure(options) {
15
15
  errorStatusCode: api.SpanStatusCode.ERROR,
16
16
  });
17
17
  return {
18
- getConfig: () => parseHostedAgentServiceConfig(options.env),
18
+ getConfig: () => parseAgentServiceConfig(options.env),
19
19
  logger: agentLogger.component(options.serviceName),
20
20
  tracer: serviceTracer.tracer,
21
21
  setActiveSpanAttributes: serviceTracer.setActiveSpanAttributes,
22
22
  getTraceContext: serviceTracer.getTraceContext,
23
- initializeOpenTelemetry: () => initializeNodeHostedAgentServiceOpenTelemetry({
23
+ initializeOpenTelemetry: () => initializeNodeAgentServiceOpenTelemetry({
24
24
  ...telemetryConfig,
25
25
  logger: options.telemetryLogger,
26
26
  processTarget: options.processTarget,
27
27
  }),
28
28
  };
29
29
  }
30
- export function createNodeAgentServiceRuntimeInfrastructure(options) {
31
- return createNodeHostedAgentServiceRuntimeInfrastructure(options);
32
- }
30
+ export const createNodeHostedAgentServiceRuntimeInfrastructure = createNodeAgentServiceRuntimeInfrastructure;
@@ -41,4 +41,4 @@ export declare function resolveNodeHostedAgentServiceTelemetryConfig(options: Re
41
41
  export declare function resolveNodeAgentServiceTelemetryConfig(options: ResolveNodeAgentServiceTelemetryConfigOptions): NodeAgentServiceTelemetryConfig;
42
42
  export declare function initializeNodeHostedAgentServiceOpenTelemetry(options: InitializeNodeHostedAgentServiceTelemetryOptions): Promise<boolean>;
43
43
  export declare function initializeNodeAgentServiceOpenTelemetry(options: InitializeNodeAgentServiceTelemetryOptions): Promise<boolean>;
44
- //# sourceMappingURL=node-hosted-agent-service-telemetry.d.ts.map
44
+ //# sourceMappingURL=node-agent-service-telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-agent-service-telemetry.d.ts","sourceRoot":"","sources":["../../../src/src/agent/node-agent-service-telemetry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpF,MAAM,MAAM,4BAA4B,GAAG,kCAAkC,CAAC;AAE9E,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,EAAE,OAAO,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG,2CAA2C,CAAC;AAEhG,MAAM,MAAM,qCAAqC,GAAG;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,eAAe,EAAE,2CAA2C,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,qCAAqC,CAAC;AAEpF,MAAM,MAAM,mDAAmD,GAAG;IAChE,GAAG,EAAE,kCAAkC,CAAC;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,6CAA6C,GACvD,mDAAmD,CAAC;AAEtD,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,qCAAqC,CAAC;AAEpF,MAAM,MAAM,4CAA4C,GAAG;IACzD,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG,4CAA4C,CAAC;AAElG,MAAM,MAAM,gDAAgD,GACxD,qCAAqC,GACrC;IACA,MAAM,CAAC,EAAE,qCAAqC,CAAC;IAC/C,aAAa,CAAC,EAAE,4CAA4C,CAAC;CAC9D,CAAC;AAEJ,MAAM,MAAM,0CAA0C,GACpD,gDAAgD,CAAC;AA6CnD,wBAAgB,4CAA4C,CAC1D,OAAO,EAAE,mDAAmD,GAC3D,qCAAqC,CAYvC;AAED,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,6CAA6C,GACrD,+BAA+B,CAEjC;AAgCD,wBAAsB,6CAA6C,CACjE,OAAO,EAAE,gDAAgD,GACxD,OAAO,CAAC,OAAO,CAAC,CA2DlB;AAED,wBAAsB,uCAAuC,CAC3D,OAAO,EAAE,0CAA0C,GAClD,OAAO,CAAC,OAAO,CAAC,CAElB"}
@@ -3,8 +3,8 @@ import { type RunAgentServiceMainOptions } from "./agent-service-bootstrap.js";
3
3
  import { type HostedChatRuntimeCreationResult } from "./hosted-chat-runtime-contract.js";
4
4
  import type { HostedConversationRootRunContext } from "./conversation-root-run-lifecycle.js";
5
5
  import { type AgentRuntimeMessage } from "./agent-runtime-message-adapter.js";
6
- import { type CreateNodeAgentServiceRuntimeInfrastructureOptions } from "./node-hosted-agent-service-runtime-infrastructure.js";
7
- import { type AgentServiceRuntimeBundle, type AgentServiceRuntimeConfig, type StartNodeAgentServiceResult } from "./hosted-agent-service-runtime.js";
6
+ import { type CreateNodeAgentServiceRuntimeInfrastructureOptions } from "./node-agent-service-runtime-infrastructure.js";
7
+ import { type AgentServiceRuntimeBundle, type AgentServiceRuntimeConfig, type StartNodeAgentServiceResult } from "./agent-service-runtime.js";
8
8
  import type { PreparedHostedChatExecution } from "./prepared-hosted-chat-execution.js";
9
9
  export type NodeVeryfrontCloudAgentServiceProcessTarget = NonNullable<RunAgentServiceMainOptions["processTarget"]> & NonNullable<CreateNodeAgentServiceRuntimeInfrastructureOptions["processTarget"]> & {
10
10
  env?: Record<string, string | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"veryfront-cloud-agent-service.d.ts","sourceRoot":"","sources":["../../../src/src/agent/veryfront-cloud-agent-service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AA+B3E,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AA6B9E,OAAO,EAEL,KAAK,kDAAkD,EACxD,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAK9B,KAAK,2BAA2B,EACjC,MAAM,mCAAmC,CAAC;AAI3C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAevF,MAAM,MAAM,2CAA2C,GACnD,WAAW,CAAC,0BAA0B,CAAC,eAAe,CAAC,CAAC,GACxD,WAAW,CAAC,kDAAkD,CAAC,eAAe,CAAC,CAAC,GAChF;IACA,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,GAAG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vD,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,2BAA2B,CAAC,+CAA+C,CAAC,CAAC,CAQvF;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,IAAI,CAAC,CAyCf"}
@@ -12,7 +12,7 @@ import { getVeryfrontCloudProviderFromModelId, resolveVeryfrontCloudModelId, res
12
12
  import { __registerTraceContextGetter } from "../utils/logger/logger.js";
13
13
  import { buildAgentRunTraceAttributes, buildExecuteToolTraceAttributes, filterAgentTraceAttributes, } from "./agent-trace-attributes.js";
14
14
  import { runAgentServiceMain, } from "./agent-service-bootstrap.js";
15
- import { loadAgentServiceEnvFiles } from "./hosted-agent-service-env-files.js";
15
+ import { loadAgentServiceEnvFiles } from "./agent-service-env-files.js";
16
16
  import { createHostedFormInputTool } from "./hosted-form-input-tool.js";
17
17
  import { createHostedAgentProjectSteering } from "./hosted-agent-project-steering.js";
18
18
  import { createLiveStudioMcpTools } from "./live-studio-mcp-tools.js";
@@ -21,8 +21,8 @@ import { createDefaultHostedInvokeAgentTool } from "./default-hosted-invoke-agen
21
21
  import { createDefaultHostedProjectSteeringRefresh, fetchDefaultHostedProjectSteering, } from "./default-hosted-project-steering-refresh.js";
22
22
  import { loadRuntimeAgentMarkdownDefinitionFromFile, resolveRuntimeAgentDefinitionsDir, } from "./runtime-agent-definition-files.js";
23
23
  import { buildVeryfrontCloudRuntimeInstructions, } from "./veryfront-cloud-runtime-system-messages.js";
24
- import { createNodeAgentServiceRuntimeInfrastructure, } from "./node-hosted-agent-service-runtime-infrastructure.js";
25
- import { createAgentServiceRuntime, startAgentServiceRuntime, startNodeAgentService, } from "./hosted-agent-service-runtime.js";
24
+ import { createNodeAgentServiceRuntimeInfrastructure, } from "./node-agent-service-runtime-infrastructure.js";
25
+ import { createAgentServiceRuntime, startAgentServiceRuntime, startNodeAgentService, } from "./agent-service-runtime.js";
26
26
  import { createDetachedRunTracker } from "./detached-run-tracker.js";
27
27
  import { runPreparedHostedChatExecutionDetached, streamPreparedHostedChatExecutionToAgUiResponse, } from "./prepared-hosted-chat-execution.js";
28
28
  import { createVeryfrontCloudPreparedHostedChatExecutionRuntimeOptions, } from "./veryfront-cloud-prepared-hosted-chat-execution-runtime.js";
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.508";
1
+ export declare const VERSION = "0.1.509";
2
2
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.508";
3
+ export const VERSION = "0.1.509";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.508",
3
+ "version": "0.1.509",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.508",
3
+ "version": "0.1.509",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -24,6 +24,10 @@ export function isHostedServiceAuthError(
24
24
  return error instanceof HostedServiceAuthError;
25
25
  }
26
26
 
27
+ export const AgentServiceAuthError = HostedServiceAuthError;
28
+ export type AgentServiceAuthError = HostedServiceAuthError;
29
+ export type AgentServiceAuthErrorCode = HostedServiceAuthErrorCode;
30
+
27
31
  export type HostedServiceAuthenticatedRequest = {
28
32
  authToken: string;
29
33
  userId: string;
@@ -90,6 +94,18 @@ export type HostedServiceAuth = {
90
94
  ) => Promise<HostedServiceProjectAccessResult>;
91
95
  };
92
96
 
97
+ export type AgentServiceAuthenticatedRequest = HostedServiceAuthenticatedRequest;
98
+ export type AgentServiceJwtError = HostedServiceJwtError;
99
+ export type AgentServiceJwtResult = HostedServiceJwtResult;
100
+ export type AgentServiceProjectAccessError = HostedServiceProjectAccessError;
101
+ export type AgentServiceProjectAccessResult = HostedServiceProjectAccessResult;
102
+ export type AgentServiceAuthConfig = HostedServiceAuthConfig;
103
+ export type AgentServiceAuthLogger = HostedServiceAuthLogger;
104
+ export type AgentServiceAuthTrace = HostedServiceAuthTrace;
105
+ export type AgentServiceAuthFetch = HostedServiceAuthFetch;
106
+ export type AgentServiceAuthOptions = HostedServiceAuthOptions;
107
+ export type AgentServiceAuth = HostedServiceAuth;
108
+
93
109
  let cachedPublicKeyInput: string | undefined;
94
110
  let cachedPublicKeyPromise: Promise<KeyLike> | undefined;
95
111
 
@@ -128,6 +144,8 @@ export function getHostedServiceTokenFromRequest(request: Request): string | nul
128
144
  return null;
129
145
  }
130
146
 
147
+ export const getAgentServiceTokenFromRequest = getHostedServiceTokenFromRequest;
148
+
131
149
  function makeUnauthenticatedError(message: string): HostedServiceJwtError {
132
150
  return {
133
151
  statusCode: 401,
@@ -395,3 +413,6 @@ export function createHostedServiceAuth(
395
413
  verifyProjectAccess,
396
414
  };
397
415
  }
416
+
417
+ export const createAgentServiceAuth = createHostedServiceAuth;
418
+ export const isAgentServiceAuthError = isHostedServiceAuthError;
@@ -10,7 +10,7 @@ function splitAllowedOrigins(value: string): string[] {
10
10
 
11
11
  const booleanFlagSchema = z.string().default("false").transform(parseBooleanFlag);
12
12
 
13
- export const hostedAgentServiceConfigSchema = z.object({
13
+ export const agentServiceConfigSchema = z.object({
14
14
  VERYFRONT_API_URL: z.string().url().default("https://api.veryfront.com"),
15
15
  NODE_ENV: z.enum(["development", "test", "production"]).default("development"),
16
16
  PORT: z.coerce.number().default(3001),
@@ -35,22 +35,21 @@ export const hostedAgentServiceConfigSchema = z.object({
35
35
  OTEL_EXPORTER_OTLP_ENDPOINT: env.OTEL_EXPORTER_OTLP_ENDPOINT,
36
36
  }));
37
37
 
38
- export type HostedAgentServiceConfig = z.infer<typeof hostedAgentServiceConfigSchema>;
39
- export type HostedAgentServiceConfigInput = z.input<typeof hostedAgentServiceConfigSchema>;
38
+ export type AgentServiceConfig = z.infer<typeof agentServiceConfigSchema>;
39
+ export type AgentServiceConfigInput = z.input<typeof agentServiceConfigSchema>;
40
40
 
41
- export const agentServiceConfigSchema = hostedAgentServiceConfigSchema;
41
+ export const hostedAgentServiceConfigSchema = agentServiceConfigSchema;
42
+ export type HostedAgentServiceConfig = AgentServiceConfig;
43
+ export type HostedAgentServiceConfigInput = AgentServiceConfigInput;
42
44
 
43
- export type AgentServiceConfig = HostedAgentServiceConfig;
44
- export type AgentServiceConfigInput = HostedAgentServiceConfigInput;
45
+ export function parseAgentServiceConfig(
46
+ input: AgentServiceConfigInput,
47
+ ): AgentServiceConfig {
48
+ return agentServiceConfigSchema.parse(input);
49
+ }
45
50
 
46
51
  export function parseHostedAgentServiceConfig(
47
52
  input: HostedAgentServiceConfigInput,
48
53
  ): HostedAgentServiceConfig {
49
- return hostedAgentServiceConfigSchema.parse(input);
50
- }
51
-
52
- export function parseAgentServiceConfig(
53
- input: AgentServiceConfigInput,
54
- ): AgentServiceConfig {
55
- return parseHostedAgentServiceConfig(input);
54
+ return parseAgentServiceConfig(input);
56
55
  }
@@ -1,20 +1,20 @@
1
1
  import { cwd as getCwd, env as getProcessEnv, setEnv } from "../platform/compat/process.js";
2
2
  import { load as loadDotenv } from "../platform/compat/std/dotenv.js";
3
3
 
4
- const DEFAULT_HOSTED_AGENT_SERVICE_ENV_FILES = [".env", ".env.local"] as const;
4
+ const DEFAULT_AGENT_SERVICE_ENV_FILES = [".env", ".env.local"] as const;
5
5
 
6
- export type HostedAgentServiceEnvFileLoadResult = {
6
+ export type AgentServiceEnvFileLoadResult = {
7
7
  loadedFiles: string[];
8
8
  loadedVariables: number;
9
9
  };
10
10
 
11
- export type HostedAgentServiceEnvFileLoadOptions = {
11
+ export type AgentServiceEnvFileLoadOptions = {
12
12
  cwd?: string;
13
13
  files?: readonly string[];
14
14
  };
15
15
 
16
- export type AgentServiceEnvFileLoadResult = HostedAgentServiceEnvFileLoadResult;
17
- export type AgentServiceEnvFileLoadOptions = HostedAgentServiceEnvFileLoadOptions;
16
+ export type HostedAgentServiceEnvFileLoadResult = AgentServiceEnvFileLoadResult;
17
+ export type HostedAgentServiceEnvFileLoadOptions = AgentServiceEnvFileLoadOptions;
18
18
 
19
19
  function joinEnvPath(cwd: string, file: string): string {
20
20
  if (file.startsWith("/") || file.startsWith("./") || file.startsWith("../")) {
@@ -24,11 +24,11 @@ function joinEnvPath(cwd: string, file: string): string {
24
24
  return `${cwd.replace(/\/$/, "")}/${file}`;
25
25
  }
26
26
 
27
- export async function loadHostedAgentServiceEnvFiles(
28
- options: HostedAgentServiceEnvFileLoadOptions = {},
29
- ): Promise<HostedAgentServiceEnvFileLoadResult> {
27
+ export async function loadAgentServiceEnvFiles(
28
+ options: AgentServiceEnvFileLoadOptions = {},
29
+ ): Promise<AgentServiceEnvFileLoadResult> {
30
30
  const cwd = options.cwd ?? getCwd();
31
- const files = options.files ?? DEFAULT_HOSTED_AGENT_SERVICE_ENV_FILES;
31
+ const files = options.files ?? DEFAULT_AGENT_SERVICE_ENV_FILES;
32
32
  const protectedKeys = new Set(Object.keys(getProcessEnv()));
33
33
  const loadedFiles: string[] = [];
34
34
  let loadedVariables = 0;
@@ -57,8 +57,4 @@ export async function loadHostedAgentServiceEnvFiles(
57
57
  return { loadedFiles, loadedVariables };
58
58
  }
59
59
 
60
- export async function loadAgentServiceEnvFiles(
61
- options: AgentServiceEnvFileLoadOptions = {},
62
- ): Promise<AgentServiceEnvFileLoadResult> {
63
- return loadHostedAgentServiceEnvFiles(options);
64
- }
60
+ export const loadHostedAgentServiceEnvFiles = loadAgentServiceEnvFiles;
@@ -20,7 +20,7 @@ import { executeHostedDurableChatRun } from "./hosted-durable-chat-run-start.js"
20
20
  import {
21
21
  type HostedServiceAuthenticatedRequest,
22
22
  HostedServiceAuthError,
23
- } from "./hosted-service-auth.js";
23
+ } from "./agent-service-auth.js";
24
24
  import { createRequestAuthCache } from "./request-auth-cache.js";
25
25
  import { isResponseLike } from "./response-like.js";
26
26
  import type { AgUiRuntimeRequest } from "./runtime-ag-ui-contract.js";
@@ -29,32 +29,47 @@ export type HostedAgentServiceRoutesLogger = {
29
29
  error(message: string, metadata?: Record<string, unknown>): void;
30
30
  };
31
31
 
32
+ export type AgentServiceRoutesLogger = HostedAgentServiceRoutesLogger;
33
+
32
34
  export type HostedAgentServiceRoutesTrace = <TResult>(
33
35
  operationName: string,
34
36
  operation: () => Promise<TResult>,
35
37
  ) => Promise<TResult>;
36
38
 
39
+ export type AgentServiceRoutesTrace = HostedAgentServiceRoutesTrace;
40
+
37
41
  export type HostedAgentServiceActiveSpanAttributes = Record<
38
42
  string,
39
43
  string | number | boolean | readonly (string | number | boolean)[] | null | undefined
40
44
  >;
41
45
 
46
+ export type AgentServiceActiveSpanAttributes = HostedAgentServiceActiveSpanAttributes;
47
+
42
48
  export type HostedAgentServiceStreamExecutionInput<TExecution extends object> = TExecution & {
43
49
  requestAbortSignal: AbortSignal;
44
50
  agUiInput: AgUiRuntimeRequest;
45
51
  };
46
52
 
53
+ export type AgentServiceStreamExecutionInput<TExecution extends object> =
54
+ HostedAgentServiceStreamExecutionInput<TExecution>;
55
+
47
56
  export type HostedAgentServiceDetachedExecutionInput<TExecution extends object> = {
48
57
  execution: TExecution;
49
58
  abortSignal: AbortSignal;
50
59
  };
51
60
 
61
+ export type AgentServiceDetachedExecutionInput<TExecution extends object> =
62
+ HostedAgentServiceDetachedExecutionInput<TExecution>;
63
+
52
64
  export type HostedAgentServiceDetachedCleanupInput<TExecution extends object> = {
53
65
  execution: TExecution;
54
66
  runId: string;
55
67
  conversationId: string;
56
68
  };
57
69
 
70
+ export type AgentServiceDetachedCleanupInput<TExecution extends object> =
71
+ HostedAgentServiceDetachedCleanupInput<TExecution>;
72
+
58
73
  export type HostedAgentServiceRouteSetOptions<TExecution extends object> = {
59
74
  forwardedConfigNamespace?: string;
60
75
  authenticateRequest: (
@@ -84,6 +99,9 @@ export type HostedAgentServiceRouteSetOptions<TExecution extends object> = {
84
99
  logger?: HostedAgentServiceRoutesLogger;
85
100
  };
86
101
 
102
+ export type AgentServiceRouteSetOptions<TExecution extends object> =
103
+ HostedAgentServiceRouteSetOptions<TExecution>;
104
+
87
105
  export type HostedAgentServiceRouteSet<TExecution extends object> = {
88
106
  routes: AgentServiceRoute[];
89
107
  authenticateAgUiRequest: (
@@ -110,6 +128,10 @@ export type HostedAgentServiceRouteSet<TExecution extends object> = {
110
128
  }) => Promise<Response>;
111
129
  };
112
130
 
131
+ export type AgentServiceRouteSet<TExecution extends object> = HostedAgentServiceRouteSet<
132
+ TExecution
133
+ >;
134
+
113
135
  function defaultTrace<TResult>(
114
136
  _operationName: string,
115
137
  operation: () => Promise<TResult>,
@@ -363,3 +385,5 @@ export function createHostedAgentServiceRouteSet<TExecution extends object>(
363
385
  handleDurableChatRunCancelRequest,
364
386
  };
365
387
  }
388
+
389
+ export const createAgentServiceRouteSet = createHostedAgentServiceRouteSet;
@@ -11,18 +11,18 @@ import {
11
11
  type DetachedRunTracker,
12
12
  } from "./detached-run-tracker.js";
13
13
  import {
14
- createHostedAgentServiceRouteSet,
15
- type HostedAgentServiceActiveSpanAttributes,
16
- type HostedAgentServiceDetachedCleanupInput,
17
- type HostedAgentServiceDetachedExecutionInput,
18
- type HostedAgentServiceRouteSet,
19
- type HostedAgentServiceStreamExecutionInput,
20
- } from "./hosted-agent-service-routes.js";
14
+ type AgentServiceActiveSpanAttributes,
15
+ type AgentServiceDetachedCleanupInput,
16
+ type AgentServiceDetachedExecutionInput,
17
+ type AgentServiceRouteSet,
18
+ type AgentServiceStreamExecutionInput,
19
+ createAgentServiceRouteSet,
20
+ } from "./agent-service-routes.js";
21
21
  import {
22
- createHostedServiceAuth,
23
- type HostedServiceAuth,
24
- type HostedServiceAuthConfig,
25
- } from "./hosted-service-auth.js";
22
+ type AgentServiceAuth,
23
+ type AgentServiceAuthConfig,
24
+ createAgentServiceAuth,
25
+ } from "./agent-service-auth.js";
26
26
  import type { ParsedHostedChatRequest } from "./hosted-chat-request-parser.js";
27
27
  import type { AgUiResumeValue } from "./ag-ui-tool-shared.js";
28
28
  import type { RuntimeAgentMarkdownDefinition } from "./runtime-agent-definition.js";
@@ -34,7 +34,7 @@ import {
34
34
  } from "./agent-service-server.js";
35
35
  import type { VeryfrontServiceServerLogger } from "../server/service-server.js";
36
36
 
37
- export type HostedAgentServiceRuntimeConfig = HostedServiceAuthConfig & {
37
+ export type HostedAgentServiceRuntimeConfig = AgentServiceAuthConfig & {
38
38
  PORT: number;
39
39
  ALLOWED_ORIGINS: string[];
40
40
  };
@@ -65,16 +65,16 @@ export type CreateHostedAgentServiceRuntimeOptions<
65
65
  forwardedConfigNamespace?: string;
66
66
  logger: HostedAgentServiceRuntimeLogger;
67
67
  trace?: HostedAgentServiceRuntimeTrace;
68
- setActiveSpanAttributes?: (attributes: HostedAgentServiceActiveSpanAttributes) => void;
68
+ setActiveSpanAttributes?: (attributes: AgentServiceActiveSpanAttributes) => void;
69
69
  prepareExecution: (req: ParsedHostedChatRequest) => Promise<TExecution>;
70
70
  streamExecutionToAgUiResponse: (
71
- input: HostedAgentServiceStreamExecutionInput<TExecution>,
71
+ input: AgentServiceStreamExecutionInput<TExecution>,
72
72
  ) => Promise<Response> | Response;
73
73
  startDetachedExecution: (
74
- input: HostedAgentServiceDetachedExecutionInput<TExecution>,
74
+ input: AgentServiceDetachedExecutionInput<TExecution>,
75
75
  ) => Promise<void>;
76
76
  cleanupExecution?: (
77
- input: HostedAgentServiceDetachedCleanupInput<TExecution>,
77
+ input: AgentServiceDetachedCleanupInput<TExecution>,
78
78
  ) => Promise<void>;
79
79
  tracker?: DetachedRunTracker<AgUiResumeValue>;
80
80
  drainTimeoutMs?: number;
@@ -91,8 +91,8 @@ export type HostedAgentServiceRuntimeBundle<
91
91
  > = {
92
92
  config: TConfig;
93
93
  tracker: DetachedRunTracker<AgUiResumeValue>;
94
- auth: HostedServiceAuth;
95
- routeSet: HostedAgentServiceRouteSet<TExecution>;
94
+ auth: AgentServiceAuth;
95
+ routeSet: AgentServiceRouteSet<TExecution>;
96
96
  routes: AgentServiceRoute[];
97
97
  lifecycle: DetachedRunShutdownLifecycle;
98
98
  runtime: AgentServiceRuntime;
@@ -152,21 +152,21 @@ function defaultTrace<TResult>(
152
152
  return operation();
153
153
  }
154
154
 
155
- export function createHostedAgentServiceRuntime<
155
+ export function createAgentServiceRuntime<
156
156
  TExecution extends object,
157
- TConfig extends HostedAgentServiceRuntimeConfig = HostedAgentServiceRuntimeConfig,
157
+ TConfig extends AgentServiceRuntimeConfig = AgentServiceRuntimeConfig,
158
158
  >(
159
- options: CreateHostedAgentServiceRuntimeOptions<TExecution, TConfig>,
160
- ): HostedAgentServiceRuntimeBundle<TExecution, TConfig> {
159
+ options: CreateAgentServiceRuntimeOptions<TExecution, TConfig>,
160
+ ): AgentServiceRuntimeBundle<TExecution, TConfig> {
161
161
  const config = options.getConfig();
162
162
  const tracker = options.tracker ?? createDetachedRunTracker<AgUiResumeValue>();
163
163
  const trace = options.trace ?? defaultTrace;
164
- const auth = createHostedServiceAuth({
164
+ const auth = createAgentServiceAuth({
165
165
  getConfig: options.getConfig,
166
166
  logger: options.logger,
167
167
  trace,
168
168
  });
169
- const routeSet = createHostedAgentServiceRouteSet({
169
+ const routeSet = createAgentServiceRouteSet({
170
170
  forwardedConfigNamespace: options.forwardedConfigNamespace,
171
171
  authenticateRequest: auth.authenticateRequest,
172
172
  verifyProjectAccess: (projectId, authToken) => auth.verifyProjectAccess(projectId, authToken),
@@ -213,22 +213,22 @@ export function createHostedAgentServiceRuntime<
213
213
  };
214
214
  }
215
215
 
216
- export function createAgentServiceRuntime<
216
+ export function createHostedAgentServiceRuntime<
217
217
  TExecution extends object,
218
- TConfig extends AgentServiceRuntimeConfig = AgentServiceRuntimeConfig,
218
+ TConfig extends HostedAgentServiceRuntimeConfig = HostedAgentServiceRuntimeConfig,
219
219
  >(
220
- options: CreateAgentServiceRuntimeOptions<TExecution, TConfig>,
221
- ): AgentServiceRuntimeBundle<TExecution, TConfig> {
222
- return createHostedAgentServiceRuntime(options);
220
+ options: CreateHostedAgentServiceRuntimeOptions<TExecution, TConfig>,
221
+ ): HostedAgentServiceRuntimeBundle<TExecution, TConfig> {
222
+ return createAgentServiceRuntime(options);
223
223
  }
224
224
 
225
- export async function startNodeHostedAgentService<
225
+ export async function startNodeAgentService<
226
226
  TExecution extends object,
227
- TConfig extends HostedAgentServiceRuntimeConfig = HostedAgentServiceRuntimeConfig,
227
+ TConfig extends AgentServiceRuntimeConfig = AgentServiceRuntimeConfig,
228
228
  >(
229
- options: StartNodeHostedAgentServiceOptions<TExecution, TConfig>,
230
- ): Promise<StartNodeHostedAgentServiceResult<TExecution, TConfig>> {
231
- const bundle = createHostedAgentServiceRuntime(options);
229
+ options: StartNodeAgentServiceOptions<TExecution, TConfig>,
230
+ ): Promise<StartNodeAgentServiceResult<TExecution, TConfig>> {
231
+ const bundle = createAgentServiceRuntime(options);
232
232
  const nodeServer = await startNodeAgentServiceServer({
233
233
  runtime: bundle.runtime,
234
234
  serviceName: options.serviceName,
@@ -246,13 +246,13 @@ export async function startNodeHostedAgentService<
246
246
  };
247
247
  }
248
248
 
249
- export async function startNodeAgentService<
249
+ export async function startNodeHostedAgentService<
250
250
  TExecution extends object,
251
- TConfig extends AgentServiceRuntimeConfig = AgentServiceRuntimeConfig,
251
+ TConfig extends HostedAgentServiceRuntimeConfig = HostedAgentServiceRuntimeConfig,
252
252
  >(
253
- options: StartNodeAgentServiceOptions<TExecution, TConfig>,
254
- ): Promise<StartNodeAgentServiceResult<TExecution, TConfig>> {
255
- return startNodeHostedAgentService(options);
253
+ options: StartNodeHostedAgentServiceOptions<TExecution, TConfig>,
254
+ ): Promise<StartNodeHostedAgentServiceResult<TExecution, TConfig>> {
255
+ return startNodeAgentService(options);
256
256
  }
257
257
 
258
258
  export async function startAgentServiceRuntime<
@@ -1,5 +1,5 @@
1
1
  import type { Tool } from "../tool/index.js";
2
- import { HostedServiceAuthError, isHostedServiceAuthError } from "./hosted-service-auth.js";
2
+ import { HostedServiceAuthError, isHostedServiceAuthError } from "./agent-service-auth.js";
3
3
  import {
4
4
  listRuntimeBuiltinSkillReferences,
5
5
  readRuntimeBuiltinSkill,