@rcrsr/rill-agent-foundry 0.18.4

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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/dist/conversations.d.ts +23 -0
  4. package/dist/conversations.d.ts.map +1 -0
  5. package/dist/conversations.js +91 -0
  6. package/dist/conversations.js.map +1 -0
  7. package/dist/errors.d.ts +26 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +40 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/extract.d.ts +19 -0
  12. package/dist/extract.d.ts.map +1 -0
  13. package/dist/extract.js +109 -0
  14. package/dist/extract.js.map +1 -0
  15. package/dist/harness.d.ts +21 -0
  16. package/dist/harness.d.ts.map +1 -0
  17. package/dist/harness.js +481 -0
  18. package/dist/harness.js.map +1 -0
  19. package/dist/id.d.ts +26 -0
  20. package/dist/id.d.ts.map +1 -0
  21. package/dist/id.js +83 -0
  22. package/dist/id.js.map +1 -0
  23. package/dist/index.d.ts +17 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +22 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/response.d.ts +25 -0
  28. package/dist/response.d.ts.map +1 -0
  29. package/dist/response.js +154 -0
  30. package/dist/response.js.map +1 -0
  31. package/dist/session.d.ts +24 -0
  32. package/dist/session.d.ts.map +1 -0
  33. package/dist/session.js +34 -0
  34. package/dist/session.js.map +1 -0
  35. package/dist/stream.d.ts +47 -0
  36. package/dist/stream.d.ts.map +1 -0
  37. package/dist/stream.js +189 -0
  38. package/dist/stream.js.map +1 -0
  39. package/dist/telemetry.d.ts +21 -0
  40. package/dist/telemetry.d.ts.map +1 -0
  41. package/dist/telemetry.js +53 -0
  42. package/dist/telemetry.js.map +1 -0
  43. package/dist/types.d.ts +161 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +5 -0
  46. package/dist/types.js.map +1 -0
  47. package/package.json +56 -0
@@ -0,0 +1,161 @@
1
+ /**
2
+ * A single text part within a user message content array.
3
+ */
4
+ export interface ContentPart {
5
+ readonly type: 'input_text';
6
+ readonly text: string;
7
+ }
8
+ /**
9
+ * A user message input item.
10
+ */
11
+ export interface UserMessageItem {
12
+ readonly type: 'message';
13
+ readonly role: 'user';
14
+ readonly content: string | ContentPart[];
15
+ }
16
+ /**
17
+ * A function call output input item (tool result).
18
+ */
19
+ export interface FunctionCallOutputItem {
20
+ readonly type: 'function_call_output';
21
+ readonly call_id: string;
22
+ readonly output: string;
23
+ }
24
+ /**
25
+ * A function call item (paired with function_call_output).
26
+ */
27
+ export interface FunctionCallItem {
28
+ readonly type: 'function_call';
29
+ readonly call_id: string;
30
+ readonly name: string;
31
+ readonly arguments: string;
32
+ }
33
+ /**
34
+ * Discriminated union of all input item variants.
35
+ */
36
+ export type InputItem = UserMessageItem | FunctionCallOutputItem | FunctionCallItem;
37
+ /**
38
+ * Tool definition included in a CreateResponse request.
39
+ */
40
+ export interface ToolDefinition {
41
+ readonly type: 'function';
42
+ readonly name: string;
43
+ readonly description?: string | undefined;
44
+ }
45
+ /**
46
+ * Inbound request body for the Foundry Responses endpoint.
47
+ * Maps to the Azure AI Foundry CreateResponse API.
48
+ */
49
+ export interface CreateResponse {
50
+ readonly input: string | InputItem[];
51
+ readonly stream?: boolean | undefined;
52
+ readonly conversation?: string | {
53
+ id: string;
54
+ } | undefined;
55
+ readonly store?: boolean | undefined;
56
+ readonly model?: string | undefined;
57
+ readonly instructions?: string | undefined;
58
+ readonly temperature?: number | undefined;
59
+ readonly user?: string | undefined;
60
+ readonly metadata?: Record<string, string> | undefined;
61
+ readonly tools?: ToolDefinition[] | undefined;
62
+ }
63
+ /**
64
+ * A single text part in an output message content array.
65
+ */
66
+ export interface OutputContentPart {
67
+ readonly type: 'text';
68
+ readonly text: string;
69
+ readonly annotations: [];
70
+ }
71
+ /**
72
+ * A single output message item in a FoundryResponse.
73
+ */
74
+ export interface OutputItem {
75
+ readonly id: string;
76
+ readonly type: 'message';
77
+ readonly role: 'assistant';
78
+ readonly status: 'completed';
79
+ readonly content: OutputContentPart[];
80
+ }
81
+ /**
82
+ * Synchronous response body returned by the Foundry Responses endpoint.
83
+ */
84
+ export interface FoundryResponse {
85
+ readonly id: string;
86
+ readonly object: 'response';
87
+ readonly created_at: number;
88
+ readonly status: 'completed' | 'failed';
89
+ readonly output: OutputItem[];
90
+ readonly error: {
91
+ readonly code: string;
92
+ readonly message: string;
93
+ } | null;
94
+ readonly metadata: Record<string, string>;
95
+ readonly temperature: number;
96
+ readonly top_p: number;
97
+ readonly user: string;
98
+ }
99
+ /**
100
+ * Non-streaming error response body.
101
+ */
102
+ export interface ErrorResponse {
103
+ readonly error: {
104
+ readonly code: string;
105
+ readonly message: string;
106
+ };
107
+ }
108
+ /**
109
+ * Streaming error event payload.
110
+ */
111
+ export interface StreamErrorEvent {
112
+ readonly type: 'error';
113
+ readonly message: string;
114
+ }
115
+ /**
116
+ * JSON Schema object used in tool parameter definitions.
117
+ */
118
+ export interface JSONSchemaObject {
119
+ readonly type: 'object';
120
+ readonly properties: Record<string, JSONSchemaProperty>;
121
+ readonly required?: string[] | undefined;
122
+ }
123
+ /**
124
+ * A single property in a JSON Schema object.
125
+ */
126
+ export interface JSONSchemaProperty {
127
+ readonly type: string;
128
+ readonly description?: string | undefined;
129
+ readonly default?: unknown;
130
+ }
131
+ /**
132
+ * A tool definition generated from an agent handler for the Foundry API.
133
+ */
134
+ export interface FoundryToolDefinition {
135
+ readonly type: 'function';
136
+ readonly name: string;
137
+ readonly description: string;
138
+ readonly parameters: JSONSchemaObject;
139
+ readonly strict: boolean;
140
+ }
141
+ /**
142
+ * Runtime metrics for the Foundry harness.
143
+ */
144
+ export interface FoundryMetrics {
145
+ readonly activeSessions: number;
146
+ readonly totalRequests: number;
147
+ readonly errorCount: number;
148
+ }
149
+ /**
150
+ * Options accepted by createFoundryHarness.
151
+ * All values default from environment variables.
152
+ */
153
+ export interface FoundryHarnessOptions {
154
+ readonly port?: number | undefined;
155
+ readonly maxConcurrentSessions?: number | undefined;
156
+ readonly agentName?: string | undefined;
157
+ readonly agentVersion?: string | undefined;
158
+ readonly debugErrors?: boolean | undefined;
159
+ readonly forceSync?: boolean | undefined;
160
+ }
161
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,eAAe,GACf,sBAAsB,GACtB,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ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CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAMD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ // ============================================================
2
+ // INBOUND REQUEST TYPES
3
+ // ============================================================
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wBAAwB;AACxB,+DAA+D"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@rcrsr/rill-agent-foundry",
3
+ "version": "0.18.4",
4
+ "description": "rill agent foundry — Azure-hosted harness factory",
5
+ "license": "MIT",
6
+ "author": "Andre Bremer",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "keywords": [
11
+ "rill",
12
+ "agent",
13
+ "foundry",
14
+ "azure",
15
+ "ai",
16
+ "scripting"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc --build",
20
+ "test": "vitest run",
21
+ "typecheck": "tsc --noEmit",
22
+ "lint": "eslint --config ../../../eslint.config.js src/",
23
+ "check": "pnpm run build && pnpm run test && pnpm run lint"
24
+ },
25
+ "peerDependencies": {
26
+ "@opentelemetry/api": "^1.9.0",
27
+ "@rcrsr/rill-agent": "workspace:^"
28
+ },
29
+ "dependencies": {
30
+ "@azure/identity": "^4.10.0",
31
+ "@hono/node-server": "^1.19.12",
32
+ "@opentelemetry/exporter-trace-otlp-http": "^0.57.0",
33
+ "@opentelemetry/resources": "^1.30.0",
34
+ "@opentelemetry/sdk-node": "^0.57.0",
35
+ "hono": "^4.12.10"
36
+ },
37
+ "devDependencies": {
38
+ "@opentelemetry/api": "^1.9.0",
39
+ "@rcrsr/rill-agent": "workspace:^"
40
+ },
41
+ "files": [
42
+ "dist"
43
+ ],
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/rcrsr/rill-agent.git",
47
+ "directory": "packages/agent/foundry"
48
+ },
49
+ "homepage": "https://rill.run/docs/foundry/",
50
+ "bugs": {
51
+ "url": "https://github.com/rcrsr/rill-agent/issues"
52
+ },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ }
56
+ }