@narrative.io/data-collaboration-sdk-ts 3.6.0 → 3.8.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.
package/build/agents/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type RunId = string;
|
|
|
16
16
|
export type ClientOpId = string;
|
|
17
17
|
export type ConversationVersion = number;
|
|
18
18
|
export type ToolUseId = string;
|
|
19
|
-
export type AgentModel = "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-sonnet-4.6" | "anthropic.claude-sonnet-5.0" | "anthropic.claude-opus-4.5" | "anthropic.claude-opus-4.6" | "anthropic.claude-opus-4.7" | "anthropic.claude-opus-4.8" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini" | (string & {});
|
|
19
|
+
export type AgentModel = "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-sonnet-4.6" | "anthropic.claude-sonnet-5.0" | "anthropic.claude-opus-4.5" | "anthropic.claude-opus-4.6" | "anthropic.claude-opus-4.7" | "anthropic.claude-opus-4.8" | "anthropic.claude-opus-5.0" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini" | (string & {});
|
|
20
20
|
export type ExecutionCluster = "shared" | "dedicated";
|
|
21
21
|
/** Subset of JSON Schema Draft 2020-12 accepted by Bedrock structured output. */
|
|
22
22
|
export type JsonSchemaObject = Record<string, unknown>;
|
|
@@ -45,11 +45,17 @@ export interface ParticipantsAll {
|
|
|
45
45
|
export interface ParticipantsNone {
|
|
46
46
|
type: "none";
|
|
47
47
|
}
|
|
48
|
+
/** Only these companies. `company_ids` must be non-empty. */
|
|
48
49
|
export interface ParticipantsInclusion {
|
|
49
50
|
type: "inclusion";
|
|
50
51
|
company_ids: number[];
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
/** Every company except these. `company_ids` must be non-empty. */
|
|
54
|
+
export interface ParticipantsExclusion {
|
|
55
|
+
type: "exclusion";
|
|
56
|
+
company_ids: number[];
|
|
57
|
+
}
|
|
58
|
+
export type Participants = ParticipantsAll | ParticipantsNone | ParticipantsInclusion | ParticipantsExclusion;
|
|
53
59
|
export interface ComputePoolCollaborators {
|
|
54
60
|
use: Participants;
|
|
55
61
|
}
|
package/build/nql/AstParser.js
CHANGED
|
@@ -189,17 +189,40 @@ function parseFunction(n) {
|
|
|
189
189
|
if (n.type !== "function") {
|
|
190
190
|
return nqlOrFail(n);
|
|
191
191
|
}
|
|
192
|
+
// CAST is the one special-syntax call the server structures completely:
|
|
193
|
+
// its args arrive as [value, type_spec], and the only non-standard piece
|
|
194
|
+
// is the `AS` argument separator in the text. Parse it into a Func whose
|
|
195
|
+
// second argument is a string literal carrying the type keyword —
|
|
196
|
+
// compileFunction owns the matching `CAST(value AS TYPE)` serialization,
|
|
197
|
+
// so the pair round-trips without falling back to Raw.
|
|
198
|
+
if (n.name.toUpperCase() === "CAST" &&
|
|
199
|
+
n.args.length === 2 &&
|
|
200
|
+
n.args[1].type === "type_spec") {
|
|
201
|
+
return {
|
|
202
|
+
type: "function",
|
|
203
|
+
as: n.as,
|
|
204
|
+
name: n.name,
|
|
205
|
+
args: [
|
|
206
|
+
parseExpression(n.args[0]),
|
|
207
|
+
{
|
|
208
|
+
type: "lit",
|
|
209
|
+
value_type: { type: "string" },
|
|
210
|
+
value: n.args[1].nql,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
};
|
|
214
|
+
}
|
|
192
215
|
// Only structure functions whose original text is the standard call
|
|
193
216
|
// syntax `NAME(arg, arg, ...)`, optionally followed by an alias — the
|
|
194
217
|
// server serializes `expr AS alias` as the inner node with the alias
|
|
195
218
|
// wrapper's `as`/`nql` merged on top, so an aliased function's `nql`
|
|
196
219
|
// span reads `NAME(args) AS alias`. Functions with special syntax —
|
|
197
|
-
// EXTRACT(unit FROM x),
|
|
198
|
-
//
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
//
|
|
202
|
-
//
|
|
220
|
+
// EXTRACT(unit FROM x), TRIM(BOTH ' ' FROM x) — cannot be regenerated
|
|
221
|
+
// from name + args and must stay Raw passthroughs, or compiling would
|
|
222
|
+
// emit comma syntax and corrupt the query. The match tolerates
|
|
223
|
+
// whitespace differences (and a missing/implicit AS keyword) because
|
|
224
|
+
// compiling name + args back to `NAME(arg, arg, ...) AS "alias"` only
|
|
225
|
+
// ever normalizes those, never changes semantics.
|
|
203
226
|
const argTexts = n.args.map((a) => "nql" in a ? a.nql : undefined);
|
|
204
227
|
if (argTexts.some((t) => t === undefined)) {
|
|
205
228
|
return nqlOrFail(n);
|
package/build/nql/NqlBuilder.js
CHANGED
|
@@ -219,7 +219,10 @@ export function compileOutput(n, dsMap) {
|
|
|
219
219
|
case "raw_ref":
|
|
220
220
|
return compileRawRef(n.nql, n.as);
|
|
221
221
|
case "nql":
|
|
222
|
-
|
|
222
|
+
// like functions, aliased raw outputs compile bare — the server's
|
|
223
|
+
// parser rejects `(expr AS "alias")` (an alias isn't valid inside
|
|
224
|
+
// a parenthesized expression)
|
|
225
|
+
return aliased(n.nql, n.as, false);
|
|
223
226
|
case "placeholder":
|
|
224
227
|
return compilePlaceholder(n);
|
|
225
228
|
}
|
|
@@ -360,6 +363,16 @@ function compileRawRef(nql, as) {
|
|
|
360
363
|
return aliased(nql, as);
|
|
361
364
|
}
|
|
362
365
|
function compileFunction(n, dsMap, parens) {
|
|
366
|
+
// CAST uses `AS` as its argument separator, never a comma — the second
|
|
367
|
+
// argument is the type keyword AstParser lifted out of the server's
|
|
368
|
+
// type_spec node.
|
|
369
|
+
if (n.name.toUpperCase() === "CAST" &&
|
|
370
|
+
n.args.length === 2 &&
|
|
371
|
+
n.args[1].type === "lit" &&
|
|
372
|
+
typeof n.args[1].value === "string") {
|
|
373
|
+
const value = compileExpression(n.args[0], dsMap);
|
|
374
|
+
return aliased(`${n.name}(${value} AS ${n.args[1].value})`, n.as, parens);
|
|
375
|
+
}
|
|
363
376
|
const args = n.args.map((arg) => compileExpression(arg, dsMap)).join(", ");
|
|
364
377
|
return aliased(`${n.name}(${args})`, n.as, parens);
|
|
365
378
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@babel/core": "8.0.1",
|
|
31
31
|
"@babel/preset-env": "8.0.2",
|
|
32
32
|
"@babel/preset-typescript": "8.0.1",
|
|
33
|
-
"@biomejs/biome": "2.5.
|
|
34
|
-
"@commitlint/cli": "21.2.
|
|
33
|
+
"@biomejs/biome": "2.5.4",
|
|
34
|
+
"@commitlint/cli": "21.2.1",
|
|
35
35
|
"@commitlint/config-conventional": "21.2.0",
|
|
36
36
|
"@types/jest": "30.0.0",
|
|
37
37
|
"@types/json-schema": "7.0.15",
|
|
38
38
|
"babel-jest": "30.4.1",
|
|
39
39
|
"jest": "30.4.2",
|
|
40
|
-
"lefthook": "2.1.
|
|
40
|
+
"lefthook": "2.1.10",
|
|
41
41
|
"ts-jest": "29.4.11",
|
|
42
42
|
"typescript": "6.0.0-dev.20260416"
|
|
43
43
|
},
|