agentfootprint 9.26.0 → 9.28.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 (115) hide show
  1. package/dist/adapters/google/aiPlatform.js +438 -0
  2. package/dist/adapters/google/aiPlatform.js.map +1 -0
  3. package/dist/adapters/hosting/googleAgentEngine.js +372 -0
  4. package/dist/adapters/hosting/googleAgentEngine.js.map +1 -0
  5. package/dist/adapters/identity/google.js +275 -0
  6. package/dist/adapters/identity/google.js.map +1 -0
  7. package/dist/adapters/memory/agentcore.js +19 -0
  8. package/dist/adapters/memory/agentcore.js.map +1 -1
  9. package/dist/adapters/memory/memoryBank.js +823 -0
  10. package/dist/adapters/memory/memoryBank.js.map +1 -0
  11. package/dist/core/agent/stages/routeTurn.js +13 -1
  12. package/dist/core/agent/stages/routeTurn.js.map +1 -1
  13. package/dist/esm/adapters/google/aiPlatform.d.ts +453 -0
  14. package/dist/esm/adapters/google/aiPlatform.js +424 -0
  15. package/dist/esm/adapters/google/aiPlatform.js.map +1 -0
  16. package/dist/esm/adapters/hosting/googleAgentEngine.d.ts +156 -0
  17. package/dist/esm/adapters/hosting/googleAgentEngine.js +368 -0
  18. package/dist/esm/adapters/hosting/googleAgentEngine.js.map +1 -0
  19. package/dist/esm/adapters/identity/google.d.ts +179 -0
  20. package/dist/esm/adapters/identity/google.js +271 -0
  21. package/dist/esm/adapters/identity/google.js.map +1 -0
  22. package/dist/esm/adapters/memory/agentcore.d.ts +19 -0
  23. package/dist/esm/adapters/memory/agentcore.js +19 -0
  24. package/dist/esm/adapters/memory/agentcore.js.map +1 -1
  25. package/dist/esm/adapters/memory/memoryBank.d.ts +390 -0
  26. package/dist/esm/adapters/memory/memoryBank.js +817 -0
  27. package/dist/esm/adapters/memory/memoryBank.js.map +1 -0
  28. package/dist/esm/core/agent/stages/routeTurn.js +13 -1
  29. package/dist/esm/core/agent/stages/routeTurn.js.map +1 -1
  30. package/dist/esm/events/payloads.d.ts +23 -0
  31. package/dist/esm/hosting-providers.d.ts +7 -0
  32. package/dist/esm/hosting-providers.js +6 -0
  33. package/dist/esm/hosting-providers.js.map +1 -1
  34. package/dist/esm/identity.d.ts +1 -0
  35. package/dist/esm/identity.js +5 -0
  36. package/dist/esm/identity.js.map +1 -1
  37. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js +9 -0
  38. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  39. package/dist/esm/lib/injection-engine/routingPolicy.d.ts +8 -0
  40. package/dist/esm/lib/injection-engine/routingPolicy.js.map +1 -1
  41. package/dist/esm/lib/injection-engine/skillGraph.d.ts +11 -2
  42. package/dist/esm/lib/injection-engine/skillGraph.js +25 -1
  43. package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
  44. package/dist/esm/lib/injection-engine/skillIntent.d.ts +13 -5
  45. package/dist/esm/lib/injection-engine/skillIntent.js +12 -2
  46. package/dist/esm/lib/injection-engine/skillIntent.js.map +1 -1
  47. package/dist/esm/lib/injection-engine/skillMatch.d.ts +40 -0
  48. package/dist/esm/lib/injection-engine/skillMatch.js +60 -0
  49. package/dist/esm/lib/injection-engine/skillMatch.js.map +1 -1
  50. package/dist/esm/memory-providers.d.ts +1 -0
  51. package/dist/esm/memory-providers.js +7 -0
  52. package/dist/esm/memory-providers.js.map +1 -1
  53. package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.d.ts +4 -0
  54. package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.js +4 -1
  55. package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.js.map +1 -1
  56. package/dist/esm/recorders/observability/commentary/artifactPhrases.d.ts +50 -0
  57. package/dist/esm/recorders/observability/commentary/artifactPhrases.js +88 -0
  58. package/dist/esm/recorders/observability/commentary/artifactPhrases.js.map +1 -0
  59. package/dist/esm/recorders/observability/commentary/commentaryTemplates.js +233 -9
  60. package/dist/esm/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
  61. package/dist/hosting-providers.js +10 -1
  62. package/dist/hosting-providers.js.map +1 -1
  63. package/dist/identity.js +8 -1
  64. package/dist/identity.js.map +1 -1
  65. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js +9 -0
  66. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  67. package/dist/lib/injection-engine/routingPolicy.js.map +1 -1
  68. package/dist/lib/injection-engine/skillGraph.js +25 -1
  69. package/dist/lib/injection-engine/skillGraph.js.map +1 -1
  70. package/dist/lib/injection-engine/skillIntent.js +12 -2
  71. package/dist/lib/injection-engine/skillIntent.js.map +1 -1
  72. package/dist/lib/injection-engine/skillMatch.js +61 -1
  73. package/dist/lib/injection-engine/skillMatch.js.map +1 -1
  74. package/dist/memory-providers.js +12 -1
  75. package/dist/memory-providers.js.map +1 -1
  76. package/dist/recorders/observability/AgentThinkingTraceRecorder.js +4 -1
  77. package/dist/recorders/observability/AgentThinkingTraceRecorder.js.map +1 -1
  78. package/dist/recorders/observability/commentary/artifactPhrases.js +94 -0
  79. package/dist/recorders/observability/commentary/artifactPhrases.js.map +1 -0
  80. package/dist/recorders/observability/commentary/commentaryTemplates.js +233 -9
  81. package/dist/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
  82. package/dist/types/adapters/google/aiPlatform.d.ts +454 -0
  83. package/dist/types/adapters/google/aiPlatform.d.ts.map +1 -0
  84. package/dist/types/adapters/hosting/googleAgentEngine.d.ts +157 -0
  85. package/dist/types/adapters/hosting/googleAgentEngine.d.ts.map +1 -0
  86. package/dist/types/adapters/identity/google.d.ts +180 -0
  87. package/dist/types/adapters/identity/google.d.ts.map +1 -0
  88. package/dist/types/adapters/memory/agentcore.d.ts +19 -0
  89. package/dist/types/adapters/memory/agentcore.d.ts.map +1 -1
  90. package/dist/types/adapters/memory/memoryBank.d.ts +391 -0
  91. package/dist/types/adapters/memory/memoryBank.d.ts.map +1 -0
  92. package/dist/types/core/agent/stages/routeTurn.d.ts.map +1 -1
  93. package/dist/types/events/payloads.d.ts +23 -0
  94. package/dist/types/events/payloads.d.ts.map +1 -1
  95. package/dist/types/hosting-providers.d.ts +7 -0
  96. package/dist/types/hosting-providers.d.ts.map +1 -1
  97. package/dist/types/identity.d.ts +1 -0
  98. package/dist/types/identity.d.ts.map +1 -1
  99. package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts.map +1 -1
  100. package/dist/types/lib/injection-engine/routingPolicy.d.ts +8 -0
  101. package/dist/types/lib/injection-engine/routingPolicy.d.ts.map +1 -1
  102. package/dist/types/lib/injection-engine/skillGraph.d.ts +11 -2
  103. package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
  104. package/dist/types/lib/injection-engine/skillIntent.d.ts +13 -5
  105. package/dist/types/lib/injection-engine/skillIntent.d.ts.map +1 -1
  106. package/dist/types/lib/injection-engine/skillMatch.d.ts +40 -0
  107. package/dist/types/lib/injection-engine/skillMatch.d.ts.map +1 -1
  108. package/dist/types/memory-providers.d.ts +1 -0
  109. package/dist/types/memory-providers.d.ts.map +1 -1
  110. package/dist/types/recorders/observability/AgentThinkingTraceRecorder.d.ts +4 -0
  111. package/dist/types/recorders/observability/AgentThinkingTraceRecorder.d.ts.map +1 -1
  112. package/dist/types/recorders/observability/commentary/artifactPhrases.d.ts +51 -0
  113. package/dist/types/recorders/observability/commentary/artifactPhrases.d.ts.map +1 -0
  114. package/dist/types/recorders/observability/commentary/commentaryTemplates.d.ts.map +1 -1
  115. package/package.json +24 -15
@@ -0,0 +1,438 @@
1
+ "use strict";
2
+ /**
3
+ * adapters/google/aiPlatform — the one place this package builds a Vertex AI
4
+ * REST client, names a Vertex resource, waits on a Vertex operation, or
5
+ * describes a Vertex failure.
6
+ *
7
+ * Three adapters sit on top of it — `agentEngineSessions`, `memoryBankStore`
8
+ * and (for its auth half only) `googleIdentity` — and none of them repeats any
9
+ * of the four things above. That is the whole reason this file exists: the AWS
10
+ * column learned, expensively, that a shim duplicated across three adapters is
11
+ * three places for the same wire fact to go stale, and only one of them gets
12
+ * fixed.
13
+ *
14
+ * ── Which client, and why THIS one ──────────────────────────────────────────
15
+ * `@googleapis/aiplatform` — the **split, per-API** discovery package (31.0.0,
16
+ * 27 MB) rather than the `googleapis` mega-package (174.0.1, 209 MB) that
17
+ * carries every Google API at once for the same generated code. Both were
18
+ * installed and measured before this was written.
19
+ *
20
+ * The gax/proto client (`@google-cloud/aiplatform`, 78 MB) was rejected on a
21
+ * fact rather than on size: its Memory Bank surface is **v1beta1 only**, while
22
+ * the REST **v1** surface is complete — `memories.purge` and `memories.rollback`
23
+ * exist at v1 and do not exist at v1beta1. One client, at the version that has
24
+ * everything, beats two clients at two versions.
25
+ *
26
+ * `@google-cloud/vertexai` is past its own announced removal date and is not
27
+ * loaded anywhere in this package, ever.
28
+ *
29
+ * ── The endpoint fact that is not in anybody's design doc ───────────────────
30
+ * The generated client defaults to `https://aiplatform.googleapis.com/` — the
31
+ * GLOBAL host. Reasoning engines, their sessions and their memories are
32
+ * **regional** resources. An adapter that accepts the default calls the wrong
33
+ * host and gets a 404 that reads exactly like "your resource does not exist".
34
+ * So {@link buildAiPlatformClient} always sets a regional `rootUrl`, derived
35
+ * from the same `location` that composes the resource name, and the surface pin
36
+ * asserts the default really is the global one so this comment cannot go stale
37
+ * quietly.
38
+ *
39
+ * ── Secrets ─────────────────────────────────────────────────────────────────
40
+ * {@link googleSdkFailure} is the `sdkFailure` law from the AWS identity
41
+ * adapter, re-aimed at a Gaxios error: the SDK's own message never comes
42
+ * through. It is not that a Vertex error always contains a secret — it is that
43
+ * a REST client echoes the request into failure text, our requests carry
44
+ * conversation state and access tokens, and an error message here reaches the
45
+ * model as a tool result AND rides the event stream to every sink attached.
46
+ * One echo publishes it to both at once.
47
+ */
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.fingerprint = exports.safeResourceId = exports.LEGAL_RESOURCE_ID = exports.MAX_RESOURCE_ID_LENGTH = exports.isAlreadyExists = exports.isNotFound = exports.httpStatusOf = exports.googleSdkFailure = exports.isSanitizedGoogleError = exports.OPERATION_ERROR_NAME = exports.awaitOperation = exports.DEFAULT_OPERATION_TIMEOUT_MS = exports.buildAiPlatformClient = exports.regionalRootUrl = exports.resolveEngine = exports.CLOUD_PLATFORM_SCOPE = exports.AI_PLATFORM_API_VERSION = void 0;
50
+ const lazyRequire_js_1 = require("../../lib/lazyRequire.js");
51
+ // ─── Connection ──────────────────────────────────────────────────────
52
+ /**
53
+ * The API version every adapter in this column dials, **stated rather than
54
+ * defaulted**.
55
+ *
56
+ * v1, not v1beta1, and that is a decision with evidence behind it: at v1 the
57
+ * memories collection carries `purge` and `rollback`; at v1beta1 it does not.
58
+ * The Google column's pin asserts this against the installed package on every
59
+ * test run, because "which version does this really call" is the question that
60
+ * made the pin exist.
61
+ */
62
+ exports.AI_PLATFORM_API_VERSION = 'v1';
63
+ /** The OAuth scope every Vertex data-plane call needs. */
64
+ exports.CLOUD_PLATFORM_SCOPE = 'https://www.googleapis.com/auth/cloud-platform';
65
+ const ENGINE_NAME = /^projects\/([^/]+)\/locations\/([^/]+)\/reasoningEngines\/([^/]+)$/;
66
+ /**
67
+ * Work out which reasoning engine this adapter talks to, from either spelling
68
+ * of `reasoningEngine`.
69
+ *
70
+ * A full resource name wins over `project` / `location` and is CHECKED against
71
+ * them rather than silently overriding: two spellings of one fact that could
72
+ * disagree is the same law the builder refuses `agent` beside `agentFactory`
73
+ * under, and a name that says `us-central1` under a config that says
74
+ * `europe-west4` is a bug somebody should be told about, not arbitrated.
75
+ */
76
+ function resolveEngine(adapter, connection) {
77
+ const { reasoningEngine, location } = connection;
78
+ if (typeof reasoningEngine !== 'string' || reasoningEngine.trim() === '') {
79
+ throw new TypeError(`${adapter} requires 'reasoningEngine' — the id of the Agent Runtime resource these ` +
80
+ `live under, or its full resource name.\n` +
81
+ ` Sessions and memories are CHILDREN of a reasoning engine; there is nowhere else ` +
82
+ `to put them, so one has to exist even if you deploy no code to it.\n` +
83
+ ` Creating it is a control-plane job (gcloud / Terraform / the console) that this ` +
84
+ `library deliberately does not do.`);
85
+ }
86
+ const match = ENGINE_NAME.exec(reasoningEngine.trim());
87
+ if (match) {
88
+ const [, project, engineLocation, engineId] = match;
89
+ if (connection.project !== undefined && connection.project !== project) {
90
+ throw new TypeError(`${adapter}: 'reasoningEngine' names project '${project}' but 'project' says ` +
91
+ `'${connection.project}'. Two spellings of one fact that disagree are refused rather ` +
92
+ `than arbitrated — drop one of them.`);
93
+ }
94
+ if (location !== undefined && location !== engineLocation) {
95
+ throw new TypeError(`${adapter}: 'reasoningEngine' names location '${engineLocation}' but 'location' says ` +
96
+ `'${location}'. The location picks the regional host as well as the resource name, ` +
97
+ `so a mismatch would call one region for a resource that lives in another. Drop one.`);
98
+ }
99
+ return { project, location: engineLocation, engineId, parent: reasoningEngine.trim() };
100
+ }
101
+ const project = connection.project ?? readEnv('GOOGLE_CLOUD_PROJECT');
102
+ if (project === undefined || project === '') {
103
+ throw new TypeError(`${adapter} requires 'project' — no project was configured and GOOGLE_CLOUD_PROJECT is ` +
104
+ `not set.\n` +
105
+ ` Pass it, set the environment variable, or give 'reasoningEngine' as a full resource ` +
106
+ `name ('projects/…/locations/…/reasoningEngines/…'), which carries the project with it.`);
107
+ }
108
+ if (typeof location !== 'string' || location.trim() === '') {
109
+ throw new TypeError(`${adapter} requires 'location' (e.g. 'us-central1'). There is no default, on purpose: ` +
110
+ `it selects the REGIONAL API host as well as composing the resource name, so a guess ` +
111
+ `does not fail — it calls a different region and answers "not found".`);
112
+ }
113
+ const engineId = reasoningEngine.trim();
114
+ return {
115
+ project,
116
+ location: location.trim(),
117
+ engineId,
118
+ parent: `projects/${project}/locations/${location.trim()}/reasoningEngines/${engineId}`,
119
+ };
120
+ }
121
+ exports.resolveEngine = resolveEngine;
122
+ /** `process.env` without assuming `process` exists (browser bundles do not have one). */
123
+ function readEnv(name) {
124
+ return typeof process !== 'undefined' && process.env ? process.env[name] : undefined;
125
+ }
126
+ /**
127
+ * The regional host for a location.
128
+ *
129
+ * See the module header: the client's own default is the global host, and
130
+ * these resources are regional. This is the fix, in one line, applied at every
131
+ * construction.
132
+ */
133
+ function regionalRootUrl(location) {
134
+ return `https://${location}-aiplatform.googleapis.com/`;
135
+ }
136
+ exports.regionalRootUrl = regionalRootUrl;
137
+ /**
138
+ * Build the REST client, or refuse by name.
139
+ *
140
+ * An injected `_client` short-circuits everything below it, which is how every
141
+ * test in this column runs with no package installed and no credential.
142
+ */
143
+ function buildAiPlatformClient(adapter, connection, scope) {
144
+ if (connection._client)
145
+ return connection._client;
146
+ let mod;
147
+ if (connection._sdk) {
148
+ mod = connection._sdk;
149
+ }
150
+ else {
151
+ try {
152
+ mod = (0, lazyRequire_js_1.lazyRequire)('@googleapis/aiplatform');
153
+ }
154
+ catch {
155
+ throw new Error(`${adapter} requires the \`@googleapis/aiplatform\` peer dependency.\n` +
156
+ ` Install: npm install @googleapis/aiplatform\n` +
157
+ ` It is the SPLIT per-API package (~27 MB), not the \`googleapis\` mega-package ` +
158
+ `(~209 MB) that carries every Google API for the same generated code.\n` +
159
+ ` It is optional and loaded only when you construct this adapter, so nothing else ` +
160
+ `in this library pays for it.`);
161
+ }
162
+ }
163
+ if (typeof mod.aiplatform !== 'function') {
164
+ throw new Error(`${adapter}: \`@googleapis/aiplatform\` is installed but exports no \`aiplatform\` ` +
165
+ `factory. This adapter is built against the 31.x package — update it, or pass a ` +
166
+ `pre-built client.`);
167
+ }
168
+ const auth = connection.auth ?? defaultAuth(adapter, mod);
169
+ return mod.aiplatform({
170
+ version: exports.AI_PLATFORM_API_VERSION,
171
+ // Never the client's global default — see the module header.
172
+ rootUrl: regionalRootUrl(scope.location),
173
+ auth,
174
+ });
175
+ }
176
+ exports.buildAiPlatformClient = buildAiPlatformClient;
177
+ /**
178
+ * Application Default Credentials, from the SDK's own re-exported auth surface.
179
+ *
180
+ * Taken from `@googleapis/aiplatform` rather than by loading
181
+ * `google-auth-library` separately: the package already carries it, and one
182
+ * load is one version to reason about instead of two that can drift apart.
183
+ */
184
+ function defaultAuth(adapter, mod) {
185
+ const GoogleAuth = mod.auth?.GoogleAuth;
186
+ if (typeof GoogleAuth !== 'function') {
187
+ throw new Error(`${adapter}: \`@googleapis/aiplatform\` exposes no \`auth.GoogleAuth\`, so Application ` +
188
+ `Default Credentials cannot be resolved.\n` +
189
+ ` Pass 'auth' with your own GoogleAuth / OAuth2Client, or update the package.`);
190
+ }
191
+ return new GoogleAuth({ scopes: [exports.CLOUD_PLATFORM_SCOPE] });
192
+ }
193
+ // ─── Long-running operations ─────────────────────────────────────────
194
+ /** How long {@link awaitOperation} keeps waiting before it refuses, by default. */
195
+ exports.DEFAULT_OPERATION_TIMEOUT_MS = 30_000;
196
+ /** One server-side wait, in the duration spelling the API takes. */
197
+ const WAIT_SLICE = '10s';
198
+ /**
199
+ * Wait for a long-running operation to finish, or refuse by name.
200
+ *
201
+ * ── Why any of this exists ──────────────────────────────────────────────────
202
+ * `sessions.create`, `sessions.delete`, `memories.create`, `memories.patch`
203
+ * and `memories.delete` **all answer with an Operation, not with the resource**
204
+ * — verified against the installed package's own return types before a line of
205
+ * either adapter was written. `get`, `list`, `patch`-on-a-session and
206
+ * `retrieve` are the synchronous ones.
207
+ *
208
+ * That asymmetry is the trap: a `put` that returns as soon as the service
209
+ * accepts the request, followed by a `get`, is a race that passes on a warm
210
+ * day and fails under load — and fails by answering "no data", which is
211
+ * indistinguishable from the truth. So every write in this column goes through
212
+ * here and does not return until the service says `done`.
213
+ *
214
+ * An operation that finished with an error is raised as one. The operation's
215
+ * own message is a Google-side description of OUR request, so it is subject to
216
+ * the same secrecy law as everything else here: the code comes through, the
217
+ * text does not.
218
+ */
219
+ async function awaitOperation(adapter, operations, operation, what, timeoutMs = exports.DEFAULT_OPERATION_TIMEOUT_MS) {
220
+ if (operation === undefined)
221
+ return;
222
+ // Some services answer an already-finished operation on the first call. That
223
+ // is the common case for a small write, and it costs no round trip.
224
+ if (operation.done === true) {
225
+ throwIfOperationFailed(adapter, operation, what);
226
+ return;
227
+ }
228
+ const name = operation.name;
229
+ if (typeof name !== 'string' || name === '') {
230
+ // Nothing to wait ON. Answering as though the write had landed would be
231
+ // exactly the silent success this whole function exists to prevent.
232
+ throw operationError(`${adapter}: ${what} was accepted but the service returned an operation with no name, ` +
233
+ `so there is nothing to wait on and no way to confirm the write landed.\n` +
234
+ ` Refusing rather than reporting a success this adapter cannot verify.`);
235
+ }
236
+ const deadline = Date.now() + Math.max(0, timeoutMs);
237
+ let current = operation;
238
+ while (current.done !== true) {
239
+ if (Date.now() >= deadline) {
240
+ throw operationError(`${adapter}: ${what} did not finish within ${timeoutMs}ms.\n` +
241
+ ` The operation is still running on Google's side — it may yet succeed — but this ` +
242
+ `call will not report a write it has not seen land.\n` +
243
+ ` Raise the adapter's 'operationTimeoutMs' if your engine is routinely slower.`);
244
+ }
245
+ const answer = await operations.wait({ name, timeout: WAIT_SLICE });
246
+ current = answer?.data ?? {};
247
+ }
248
+ throwIfOperationFailed(adapter, current, what);
249
+ }
250
+ exports.awaitOperation = awaitOperation;
251
+ function throwIfOperationFailed(adapter, operation, what) {
252
+ const error = operation.error;
253
+ if (error === null || error === undefined)
254
+ return;
255
+ const code = typeof error.code === 'number' ? ` (code ${error.code})` : '';
256
+ throw operationError(`${adapter}: ${what} failed${code}.\n` +
257
+ ` The operation's own message is withheld: it is Google's description of OUR request, ` +
258
+ `and this request carried conversation state. Check Cloud Logging for the full text.`);
259
+ }
260
+ /**
261
+ * The name every refusal from this function carries.
262
+ *
263
+ * It exists so a caller's `catch` can tell "the operation went wrong" — which
264
+ * is already sanitized and already says what to do — apart from "the transport
265
+ * went wrong", which still needs {@link googleSdkFailure} run over it. Without
266
+ * the distinction an adapter re-wraps its own refusal and replaces a precise
267
+ * diagnosis ("did not finish within 30000ms") with a generic one.
268
+ */
269
+ exports.OPERATION_ERROR_NAME = 'GoogleOperationError';
270
+ function operationError(message) {
271
+ const err = new Error(message);
272
+ err.name = exports.OPERATION_ERROR_NAME;
273
+ return err;
274
+ }
275
+ /**
276
+ * Has this error already been sanitized by this module? Used by every adapter's
277
+ * `catch` so a refusal is reported once rather than wrapped twice.
278
+ */
279
+ function isSanitizedGoogleError(err) {
280
+ return (err instanceof Error && (err.name === exports.OPERATION_ERROR_NAME || err.name === 'GoogleApiError'));
281
+ }
282
+ exports.isSanitizedGoogleError = isSanitizedGoogleError;
283
+ // ─── Failures ────────────────────────────────────────────────────────
284
+ /**
285
+ * Re-raise a failed REST call **without its text** — the `sdkFailure` law from
286
+ * the AWS identity adapter, re-aimed at a Gaxios error.
287
+ *
288
+ * What comes through is the part that is both safe and actionable: which
289
+ * operation failed and the HTTP status. What does not is the message, because
290
+ * a REST client echoes the request into its failure text and these requests
291
+ * carry a whole conversation's state, a user id, and an access token in the
292
+ * headers. A thrown message here reaches the LLM as a tool result AND rides the
293
+ * event stream to every sink attached to the agent.
294
+ *
295
+ * **The original is deliberately not attached as `cause`** — a cause travels
296
+ * with the error into every serializer that walks own properties, which would
297
+ * undo all of this in one `JSON.stringify`.
298
+ */
299
+ function googleSdkFailure(adapter, operation, err) {
300
+ const status = httpStatusOf(err);
301
+ const failure = new Error(`${adapter}: ${operation} failed` +
302
+ (status === undefined ? '' : ` (HTTP ${status})`) +
303
+ `.\n The SDK's own message is withheld: this request carried session state and an ` +
304
+ `access token, and REST clients echo request detail into failure text. Check Cloud ` +
305
+ `Logging for the full error.`);
306
+ failure.name = 'GoogleApiError';
307
+ return failure;
308
+ }
309
+ exports.googleSdkFailure = googleSdkFailure;
310
+ /**
311
+ * The HTTP status of a failed call, wherever this client happened to put it.
312
+ *
313
+ * Three places rather than one because the client reports a transport failure,
314
+ * an API error and a thrown `GaxiosError` slightly differently, and a
315
+ * classification that only reads one of them silently stops classifying the
316
+ * day the client is upgraded.
317
+ */
318
+ function httpStatusOf(err) {
319
+ const e = err;
320
+ if (e === null || typeof e !== 'object')
321
+ return undefined;
322
+ for (const candidate of [e.status, e.code, e.response?.status]) {
323
+ if (typeof candidate === 'number' && Number.isFinite(candidate))
324
+ return candidate;
325
+ // Gaxios sometimes reports the status as a numeric STRING.
326
+ if (typeof candidate === 'string' && /^\d{3}$/.test(candidate))
327
+ return Number(candidate);
328
+ }
329
+ return undefined;
330
+ }
331
+ exports.httpStatusOf = httpStatusOf;
332
+ /** Is this the service's "no such resource"? */
333
+ function isNotFound(err) {
334
+ return httpStatusOf(err) === 404;
335
+ }
336
+ exports.isNotFound = isNotFound;
337
+ /** Is this "a resource by that name already exists"? */
338
+ function isAlreadyExists(err) {
339
+ return httpStatusOf(err) === 409;
340
+ }
341
+ exports.isAlreadyExists = isAlreadyExists;
342
+ // ─── Ids ─────────────────────────────────────────────────────────────
343
+ /** The longest a resource id may be in both collections this column writes to. */
344
+ exports.MAX_RESOURCE_ID_LENGTH = 63;
345
+ /**
346
+ * The id grammar this column really has to satisfy — the INTERSECTION of the
347
+ * two documented rules, so one function is right for both callers and neither
348
+ * has to remember which is stricter: `[a-z0-9-]`, first character a letter,
349
+ * last character a letter or a digit.
350
+ *
351
+ * Exported so the surface pin can hold it against the installed package's own
352
+ * words rather than against this file's memory of them.
353
+ */
354
+ exports.LEGAL_RESOURCE_ID = /^[a-z]$|^[a-z][a-z0-9-]*[a-z0-9]$/;
355
+ /**
356
+ * Turn caller data into a resource id the service will accept — and never into
357
+ * a DIFFERENT caller's id.
358
+ *
359
+ * ── The grammar, quoted rather than guessed ─────────────────────────────────
360
+ * This function used to state that "Vertex resource ids accept `[A-Za-z0-9_-]`".
361
+ * That is a Google-wide habit and it is not what either collection this column
362
+ * writes to documents. From the installed package (`@googleapis/aiplatform`
363
+ * 31.0.0, `build/v1.d.ts`), verbatim:
364
+ *
365
+ * `memoryId` — "This value may be up to 63 characters, and valid characters
366
+ * are `[a-z0-9-]`. The first character must be a letter, and
367
+ * the last character must be a letter or number."
368
+ * `sessionId` — "This value may be up to 63 characters, and valid characters
369
+ * are `[a-z0-9-]`. The first and last characters must be a
370
+ * letter or number."
371
+ *
372
+ * So UPPERCASE and `_` are illegal in both, and a leading digit is illegal for
373
+ * a memory. Under the old grammar a UUID entry id (leading digit) and a ULID
374
+ * session id (uppercase Crockford base32) — two of the most ordinary id shapes
375
+ * there are — went to the wire unchanged, to be refused by Google with a 400
376
+ * whose text {@link googleSdkFailure} then withholds. A grammar error the
377
+ * adapter could have caught locally, delivered as a censored 400, is the one
378
+ * place the secrecy law and the teaching-refusal law collide; the fix is to not
379
+ * send it. The surface pin reads those two sentences out of the installed
380
+ * `.d.ts` and checks them against {@link LEGAL_RESOURCE_ID}, so this cannot
381
+ * drift back to a guess.
382
+ *
383
+ * ── Why a hash and not just a fold ──────────────────────────────────────────
384
+ * Lowercasing and substituting are LOSSY: `Alice` folds onto `alice`, `a_b`
385
+ * onto `a-b`. Two ids that folded together would be ONE row, which is the same
386
+ * silent overwrite this column's addressing law exists to prevent. So the
387
+ * readable fast path is taken only when the caller's id already is a legal id
388
+ * byte for byte; anything the fold touched — or that overruns 63 characters —
389
+ * is carried by a {@link fingerprint} of the ORIGINAL, which keeps distinct
390
+ * inputs distinct.
391
+ */
392
+ function safeResourceId(raw, max = exports.MAX_RESOURCE_ID_LENGTH) {
393
+ const slug = raw.toLowerCase().replace(/[^a-z0-9-]/g, '-');
394
+ if (slug === raw && slug.length <= max && exports.LEGAL_RESOURCE_ID.test(slug))
395
+ return slug;
396
+ const suffix = fingerprint(raw);
397
+ const room = max - suffix.length - 1;
398
+ if (room < 2) {
399
+ // Returning something longer than `max` would be a silently invalid id —
400
+ // refused rather than sent, since only a caller of this function can fix it.
401
+ throw new RangeError(`safeResourceId: max of ${max} leaves no room for the fingerprint that keeps two ` +
402
+ `folded ids apart. The smallest workable bound is ${suffix.length + 3}.`);
403
+ }
404
+ // `id-` rather than the bare slug: the first character must be a LETTER, and
405
+ // the fold cannot promise one. The fingerprint is base36, so the last
406
+ // character is a letter or a digit by construction — which also makes this
407
+ // function IDEMPOTENT: its own output is a legal id and comes back unchanged.
408
+ // `agentEngineSessions.listByUser` relies on that, since it hands composed
409
+ // resource ids back to callers who feed them to `hydrate`.
410
+ const head = `id-${slug}`.slice(0, room).replace(/-+$/, '');
411
+ return `${head}-${suffix}`;
412
+ }
413
+ exports.safeResourceId = safeResourceId;
414
+ /**
415
+ * A stable fingerprint of a string, in `[0-9a-z-]`.
416
+ *
417
+ * TWO FNV-1a lanes rather than one, because of what this hash is now asked to
418
+ * carry: it is the only thing keeping two ids apart once the fold has run them
419
+ * together, and it is half of how `memoryBankStore` addresses one identity's
420
+ * memories apart from another's. A single 32-bit lane collides at around one
421
+ * chance in a hundred across ten thousand ids, which is too often for either
422
+ * job; two lanes cost one more multiply per character and make it negligible.
423
+ *
424
+ * It is a fingerprint, not a security boundary — a colliding address is still
425
+ * refused by the scope check that runs before every read and every overwrite.
426
+ */
427
+ function fingerprint(value) {
428
+ let a = 0x811c9dc5;
429
+ let b = 0x01000193;
430
+ for (let i = 0; i < value.length; i++) {
431
+ const code = value.charCodeAt(i);
432
+ a = Math.imul(a ^ code, 0x01000193);
433
+ b = Math.imul(b ^ code, 0x85ebca6b);
434
+ }
435
+ return `${(a >>> 0).toString(36)}-${(b >>> 0).toString(36)}`;
436
+ }
437
+ exports.fingerprint = fingerprint;
438
+ //# sourceMappingURL=aiPlatform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiPlatform.js","sourceRoot":"","sources":["../../../src/adapters/google/aiPlatform.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;;;AAEH,6DAAuD;AAwLvD,wEAAwE;AAExE;;;;;;;;;GASG;AACU,QAAA,uBAAuB,GAAG,IAAa,CAAC;AAErD,0DAA0D;AAC7C,QAAA,oBAAoB,GAAG,gDAAgD,CAAC;AAqDrF,MAAM,WAAW,GAAG,oEAAoE,CAAC;AAEzF;;;;;;;;;GASG;AACH,SAAgB,aAAa,CAAC,OAAe,EAAE,UAAgC;IAC7E,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,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