@novalabai/adk 2.13.0 → 2.15.1
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/README.md +76 -3
- package/dist/client.d.ts +9 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -5
- package/dist/client.js.map +1 -1
- package/dist/core/errors.d.ts +8 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +13 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/http.d.ts +2 -0
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +50 -7
- package/dist/core/http.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +20 -15
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +25 -30
- package/dist/models.js.map +1 -1
- package/dist/resources/agent.d.ts +35 -0
- package/dist/resources/agent.d.ts.map +1 -0
- package/dist/resources/agent.js +51 -0
- package/dist/resources/agent.js.map +1 -0
- package/dist/resources/agents.d.ts.map +1 -1
- package/dist/resources/agents.js +19 -2
- package/dist/resources/agents.js.map +1 -1
- package/dist/resources/chat.d.ts +19 -17
- package/dist/resources/chat.d.ts.map +1 -1
- package/dist/resources/chat.js +30 -18
- package/dist/resources/chat.js.map +1 -1
- package/dist/resources/conversations.d.ts +49 -0
- package/dist/resources/conversations.d.ts.map +1 -0
- package/dist/resources/conversations.js +77 -0
- package/dist/resources/conversations.js.map +1 -0
- package/dist/resources/creative.d.ts +3 -0
- package/dist/resources/creative.d.ts.map +1 -1
- package/dist/resources/creative.js +1 -0
- package/dist/resources/creative.js.map +1 -1
- package/dist/resources/rag.d.ts.map +1 -1
- package/dist/resources/rag.js +8 -1
- package/dist/resources/rag.js.map +1 -1
- package/dist/resources/subscription.d.ts +0 -2
- package/dist/resources/subscription.d.ts.map +1 -1
- package/dist/resources/subscription.js +0 -4
- package/dist/resources/subscription.js.map +1 -1
- package/dist/resources/team.d.ts +26 -0
- package/dist/resources/team.d.ts.map +1 -0
- package/dist/resources/team.js +39 -0
- package/dist/resources/team.js.map +1 -0
- package/dist/resources/usage.d.ts +8 -1
- package/dist/resources/usage.d.ts.map +1 -1
- package/dist/resources/usage.js +10 -0
- package/dist/resources/usage.js.map +1 -1
- package/dist/resources/websocket.d.ts +6 -1
- package/dist/resources/websocket.d.ts.map +1 -1
- package/dist/resources/websocket.js +8 -2
- package/dist/resources/websocket.js.map +1 -1
- package/dist/types/agents.d.ts +6 -0
- package/dist/types/agents.d.ts.map +1 -1
- package/dist/types/chat-stream.d.ts +133 -6
- package/dist/types/chat-stream.d.ts.map +1 -1
- package/dist/types/chat-stream.js +14 -30
- package/dist/types/chat-stream.js.map +1 -1
- package/dist/types/conversations.d.ts +98 -0
- package/dist/types/conversations.d.ts.map +1 -0
- package/dist/types/conversations.js +8 -0
- package/dist/types/conversations.js.map +1 -0
- package/dist/types/team.d.ts +55 -0
- package/dist/types/team.d.ts.map +1 -0
- package/dist/types/team.js +4 -0
- package/dist/types/team.js.map +1 -0
- package/dist/types/usage.d.ts +34 -0
- package/dist/types/usage.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/resources/terminal.d.ts +0 -74
- package/dist/resources/terminal.d.ts.map +0 -1
- package/dist/resources/terminal.js +0 -73
- package/dist/resources/terminal.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.OLLAMA_RECOMMENDED = exports.normalizeTrustResponse = exports.OrchestrationResource = exports.MemoryResource = exports.MarketingResource = exports.HealthResource = exports.AccountingResource = exports.IntegrationsResource = exports.BrowserResource = exports.ToolBuilderResource = exports.
|
|
3
|
+
exports.CostOptResource = exports.MultiModalResource = exports.JobsResource = exports.VersioningResource = exports.GuardrailsResource = exports.UsageResource = exports.PersistenceResource = exports.EvalResource = exports.A2AResource = exports.ToolsResource = exports.ByollmResource = exports.TrainingResource = exports.ServerOrchestrateResource = exports.RagResource = exports.LearningResource = exports.AgentResource = exports.TeamResource = exports.ConversationsResource = exports.parseChatEvent = exports.VoiceResource = exports.FilesResource = exports.PlannerResource = exports.RepairResource = exports.AutoAgentResource = exports.AgentsResource = exports.NovaStream = exports.verifyWebhookSignature = exports.signPayload = exports.HttpClient = exports.DEFAULT_FALLBACK_CHAIN = exports.withModelFallback = exports.ConfidenceGate = exports.evaluateConfidence = exports.ConfidenceLevel = exports.NovaConfidenceError = exports.NovaTimeoutError = exports.NovaValidationError = exports.NovaRateLimitError = exports.NovaPermissionError = exports.NovaInsufficientCreditsError = exports.NovaAuthError = exports.NovaAPIError = exports.NovaError = exports.modelsForTier = exports.isKnownModel = exports.isPremiumModel = exports.MODEL_CATALOG = exports.DEFAULT_MODEL = exports.NovaModel = exports.NovaClient = void 0;
|
|
4
|
+
exports.OLLAMA_RECOMMENDED = exports.normalizeTrustResponse = exports.OrchestrationResource = exports.MemoryResource = exports.MarketingResource = exports.HealthResource = exports.AccountingResource = exports.IntegrationsResource = exports.BrowserResource = exports.ToolBuilderResource = exports.CybersecurityResource = exports.DesignResource = exports.CreativeResource = exports.OilGasResource = exports.BillingResource = exports.OllamaResource = exports.ProvidersResource = exports.ChatResource = exports.SubscriptionResource = exports.PipelineResource = exports.ApprovalsResource = exports.SkillsResource = exports.DocumentsResource = exports.ObservabilityResource = exports.MarketplaceResource = exports.WebSocketResource = exports.TemplatesResource = exports.WebhooksResource = exports.TrustResource = exports.HistoryResource = exports.DataResource = exports.ConnectionsResource = exports.AutomationsResource = exports.SignalsResource = exports.WorkflowsResource = void 0;
|
|
5
5
|
var client_js_1 = require("./client.js");
|
|
6
6
|
Object.defineProperty(exports, "NovaClient", { enumerable: true, get: function () { return client_js_1.NovaClient; } });
|
|
7
7
|
var models_js_1 = require("./models.js");
|
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "NovaError", { enumerable: true, get: function ()
|
|
|
16
16
|
Object.defineProperty(exports, "NovaAPIError", { enumerable: true, get: function () { return errors_js_1.NovaAPIError; } });
|
|
17
17
|
Object.defineProperty(exports, "NovaAuthError", { enumerable: true, get: function () { return errors_js_1.NovaAuthError; } });
|
|
18
18
|
Object.defineProperty(exports, "NovaInsufficientCreditsError", { enumerable: true, get: function () { return errors_js_1.NovaInsufficientCreditsError; } });
|
|
19
|
+
Object.defineProperty(exports, "NovaPermissionError", { enumerable: true, get: function () { return errors_js_1.NovaPermissionError; } });
|
|
19
20
|
Object.defineProperty(exports, "NovaRateLimitError", { enumerable: true, get: function () { return errors_js_1.NovaRateLimitError; } });
|
|
20
21
|
Object.defineProperty(exports, "NovaValidationError", { enumerable: true, get: function () { return errors_js_1.NovaValidationError; } });
|
|
21
22
|
Object.defineProperty(exports, "NovaTimeoutError", { enumerable: true, get: function () { return errors_js_1.NovaTimeoutError; } });
|
|
@@ -48,6 +49,12 @@ var voice_js_1 = require("./resources/voice.js");
|
|
|
48
49
|
Object.defineProperty(exports, "VoiceResource", { enumerable: true, get: function () { return voice_js_1.VoiceResource; } });
|
|
49
50
|
var chat_stream_js_1 = require("./types/chat-stream.js");
|
|
50
51
|
Object.defineProperty(exports, "parseChatEvent", { enumerable: true, get: function () { return chat_stream_js_1.parseChatEvent; } });
|
|
52
|
+
var conversations_js_1 = require("./resources/conversations.js");
|
|
53
|
+
Object.defineProperty(exports, "ConversationsResource", { enumerable: true, get: function () { return conversations_js_1.ConversationsResource; } });
|
|
54
|
+
var team_js_1 = require("./resources/team.js");
|
|
55
|
+
Object.defineProperty(exports, "TeamResource", { enumerable: true, get: function () { return team_js_1.TeamResource; } });
|
|
56
|
+
var agent_js_1 = require("./resources/agent.js");
|
|
57
|
+
Object.defineProperty(exports, "AgentResource", { enumerable: true, get: function () { return agent_js_1.AgentResource; } });
|
|
51
58
|
var learning_js_1 = require("./resources/learning.js");
|
|
52
59
|
Object.defineProperty(exports, "LearningResource", { enumerable: true, get: function () { return learning_js_1.LearningResource; } });
|
|
53
60
|
var rag_js_1 = require("./resources/rag.js");
|
|
@@ -128,8 +135,6 @@ var design_js_1 = require("./resources/design.js");
|
|
|
128
135
|
Object.defineProperty(exports, "DesignResource", { enumerable: true, get: function () { return design_js_1.DesignResource; } });
|
|
129
136
|
var cybersecurity_js_1 = require("./resources/cybersecurity.js");
|
|
130
137
|
Object.defineProperty(exports, "CybersecurityResource", { enumerable: true, get: function () { return cybersecurity_js_1.CybersecurityResource; } });
|
|
131
|
-
var terminal_js_1 = require("./resources/terminal.js");
|
|
132
|
-
Object.defineProperty(exports, "TerminalResource", { enumerable: true, get: function () { return terminal_js_1.TerminalResource; } });
|
|
133
138
|
var toolbuilder_js_1 = require("./resources/toolbuilder.js");
|
|
134
139
|
Object.defineProperty(exports, "ToolBuilderResource", { enumerable: true, get: function () { return toolbuilder_js_1.ToolBuilderResource; } });
|
|
135
140
|
var browser_js_1 = require("./resources/browser.js");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,yCAAyC;AAAhC,uGAAA,UAAU,OAAA;AAGnB,yCAOqB;AANnB,sGAAA,SAAS,OAAA;AACT,0GAAA,aAAa,OAAA;AACb,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AACZ,0GAAA,aAAa,OAAA;AAIf,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,yCAAyC;AAAhC,uGAAA,UAAU,OAAA;AAGnB,yCAOqB;AANnB,sGAAA,SAAS,OAAA;AACT,0GAAA,aAAa,OAAA;AACb,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AACZ,0GAAA,aAAa,OAAA;AAIf,8CAU0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AAc,OAAA;AACvB,qDAAyD;AAAhD,6GAAA,eAAe,OAAA;AACxB,mDAAuD;AAA9C,2GAAA,cAAc,OAAA;AACvB,uDAA2D;AAAlD,+GAAA,gBAAgB,OAAA;AAWzB,mDAAuD;AAA9C,2GAAA,cAAc,OAAA;AAMvB,iEAAqE;AAA5D,yHAAA,qBAAqB,OAAA;AAU9B,6DAAiE;AAAxD,qHAAA,mBAAmB,OAAA;AAiB5B,qDAAyD;AAAhD,6GAAA,eAAe,OAAA;AAQxB,+DAAmE;AAA1D,uHAAA,oBAAoB,OAAA;AAO7B,2DAA+D;AAAtD,mHAAA,kBAAkB,OAAA;AAO3B,mDAAuD;AAA9C,2GAAA,cAAc,OAAA;AAQvB,yDAA6D;AAApD,iHAAA,iBAAiB,OAAA;AAO1B,mDAAuD;AAA9C,2GAAA,cAAc,OAAA;AAUvB,qDAAiE;AAAxD,iHAAA,qBAAqB,OAAA;AAwI9B,6CAA0D;AAAjD,kHAAA,sBAAsB,OAAA;AAoK/B,+CAAuD;AAA9C,+GAAA,kBAAkB,OAAA"}
|
package/dist/models.d.ts
CHANGED
|
@@ -20,23 +20,28 @@
|
|
|
20
20
|
* - python/novalab_adk/models.py
|
|
21
21
|
* - dashboard/src/lib/models.ts
|
|
22
22
|
*/
|
|
23
|
-
export type ModelTier = '
|
|
23
|
+
export type ModelTier = 'quality' | 'fast';
|
|
24
24
|
/** The default. Nova's smart router picks the best model per request. */
|
|
25
25
|
export declare const DEFAULT_MODEL = "auto";
|
|
26
|
-
/** Model id constants for the `model` parameter. `NovaModel.Auto` is default.
|
|
26
|
+
/** Model id constants for the `model` parameter. `NovaModel.Auto` is default.
|
|
27
|
+
* Nova tiers are vendor-agnostic; all run on Nova's premium EU engine. */
|
|
27
28
|
export declare const NovaModel: {
|
|
28
29
|
readonly Auto: "auto";
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
30
|
+
readonly Max: "nova-max";
|
|
31
|
+
readonly Flagship: "nova-flagship";
|
|
32
|
+
readonly Reasoning: "nova-reasoning";
|
|
33
|
+
readonly Fast: "nova-fast";
|
|
34
|
+
readonly Qwen3_30B: "nova-flagship";
|
|
35
|
+
readonly Devstral: "nova-flagship";
|
|
36
|
+
readonly Codestral: "nova-flagship";
|
|
37
|
+
readonly Qwen3: "nova-fast";
|
|
38
|
+
readonly DeepSeekR1: "nova-reasoning";
|
|
39
|
+
readonly DeepSeekCoderV2: "nova-flagship";
|
|
40
|
+
readonly Qwen2_5_14B: "nova-fast";
|
|
41
|
+
readonly GLM4: "nova-fast";
|
|
42
|
+
readonly Claude: "nova-flagship";
|
|
43
|
+
readonly GPT4o: "nova-flagship";
|
|
44
|
+
readonly Gemini: "nova-reasoning";
|
|
40
45
|
};
|
|
41
46
|
export type NovaModelId = (typeof NovaModel)[keyof typeof NovaModel];
|
|
42
47
|
export interface NovaModelInfo {
|
|
@@ -46,8 +51,8 @@ export interface NovaModelInfo {
|
|
|
46
51
|
}
|
|
47
52
|
/** Full catalog in display order (excludes Auto, the implicit default). */
|
|
48
53
|
export declare const MODEL_CATALOG: readonly NovaModelInfo[];
|
|
49
|
-
/**
|
|
50
|
-
export declare function isPremiumModel(
|
|
54
|
+
/** Nova tiers aren't plan-gated client-side; the server enforces limits. */
|
|
55
|
+
export declare function isPremiumModel(_value: string): boolean;
|
|
51
56
|
/** True if `value` is `"auto"` or a model in the catalog. */
|
|
52
57
|
export declare function isKnownModel(value: string): boolean;
|
|
53
58
|
/** All catalog models in a tier. */
|
package/dist/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3C,yEAAyE;AACzE,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC;2EAC2E;AAC3E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAqBZ,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,2EAA2E;AAC3E,eAAO,MAAM,aAAa,EAAE,SAAS,aAAa,EAIjD,CAAC;AAIF,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,oCAAoC;AACpC,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,EAAE,CAE9D"}
|
package/dist/models.js
CHANGED
|
@@ -28,43 +28,38 @@ exports.isKnownModel = isKnownModel;
|
|
|
28
28
|
exports.modelsForTier = modelsForTier;
|
|
29
29
|
/** The default. Nova's smart router picks the best model per request. */
|
|
30
30
|
exports.DEFAULT_MODEL = 'auto';
|
|
31
|
-
/** Model id constants for the `model` parameter. `NovaModel.Auto` is default.
|
|
31
|
+
/** Model id constants for the `model` parameter. `NovaModel.Auto` is default.
|
|
32
|
+
* Nova tiers are vendor-agnostic; all run on Nova's premium EU engine. */
|
|
32
33
|
exports.NovaModel = {
|
|
33
34
|
Auto: exports.DEFAULT_MODEL,
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
// Nova capability tiers.
|
|
36
|
+
Max: 'nova-max', // highest quality (top model) — costs more
|
|
37
|
+
Flagship: 'nova-flagship',
|
|
38
|
+
Reasoning: 'nova-reasoning',
|
|
39
|
+
Fast: 'nova-fast',
|
|
40
|
+
// Deprecated aliases — kept for back-compat, resolve to Nova tiers.
|
|
41
|
+
Qwen3_30B: 'nova-flagship',
|
|
42
|
+
Devstral: 'nova-flagship',
|
|
43
|
+
Codestral: 'nova-flagship',
|
|
44
|
+
Qwen3: 'nova-fast',
|
|
45
|
+
DeepSeekR1: 'nova-reasoning',
|
|
46
|
+
DeepSeekCoderV2: 'nova-flagship',
|
|
47
|
+
Qwen2_5_14B: 'nova-fast',
|
|
48
|
+
GLM4: 'nova-fast',
|
|
49
|
+
Claude: 'nova-flagship',
|
|
50
|
+
GPT4o: 'nova-flagship',
|
|
51
|
+
Gemini: 'nova-reasoning',
|
|
48
52
|
};
|
|
49
53
|
/** Full catalog in display order (excludes Auto, the implicit default). */
|
|
50
54
|
exports.MODEL_CATALOG = [
|
|
51
|
-
{ value: exports.NovaModel.
|
|
52
|
-
{ value: exports.NovaModel.
|
|
53
|
-
{ value: exports.NovaModel.
|
|
54
|
-
{ value: exports.NovaModel.Qwen3, label: 'Qwen 3 (Fast + Smart)', tier: 'strong' },
|
|
55
|
-
{ value: exports.NovaModel.DeepSeekR1, label: 'DeepSeek R1 (Reasoning)', tier: 'strong' },
|
|
56
|
-
{ value: exports.NovaModel.DeepSeekCoderV2, label: 'DeepSeek Coder V2', tier: 'strong' },
|
|
57
|
-
{ value: exports.NovaModel.Qwen2_5_14B, label: 'Qwen 2.5 14B', tier: 'strong' },
|
|
58
|
-
{ value: exports.NovaModel.GLM4, label: 'GLM-4 (Fast)', tier: 'strong' },
|
|
59
|
-
{ value: exports.NovaModel.Claude, label: 'Claude (Anthropic)', tier: 'premium' },
|
|
60
|
-
{ value: exports.NovaModel.GPT4o, label: 'GPT-4o (OpenAI)', tier: 'premium' },
|
|
61
|
-
{ value: exports.NovaModel.Gemini, label: 'Gemini (Google)', tier: 'premium' },
|
|
55
|
+
{ value: exports.NovaModel.Flagship, label: 'Nova Flagship — highest quality', tier: 'quality' },
|
|
56
|
+
{ value: exports.NovaModel.Reasoning, label: 'Nova Reasoning — deep analysis', tier: 'quality' },
|
|
57
|
+
{ value: exports.NovaModel.Fast, label: 'Nova Fast — quick & efficient', tier: 'fast' },
|
|
62
58
|
];
|
|
63
|
-
const PREMIUM = new Set(exports.MODEL_CATALOG.filter((m) => m.tier === 'premium').map((m) => m.value));
|
|
64
59
|
const KNOWN = new Set([...exports.MODEL_CATALOG.map((m) => m.value), exports.DEFAULT_MODEL]);
|
|
65
|
-
/**
|
|
66
|
-
function isPremiumModel(
|
|
67
|
-
return
|
|
60
|
+
/** Nova tiers aren't plan-gated client-side; the server enforces limits. */
|
|
61
|
+
function isPremiumModel(_value) {
|
|
62
|
+
return false;
|
|
68
63
|
}
|
|
69
64
|
/** True if `value` is `"auto"` or a model in the catalog. */
|
|
70
65
|
function isKnownModel(value) {
|
package/dist/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAkDH,wCAEC;AAGD,oCAEC;AAGD,sCAEC;AA1DD,yEAAyE;AAC5D,QAAA,aAAa,GAAG,MAAM,CAAC;AAEpC;2EAC2E;AAC9D,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,qBAA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,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HttpClient } from '../core/http.js';
|
|
2
|
+
import type { AgentApproval, AgentSettings, AgentSettingsResponse } from '../types/team.js';
|
|
3
|
+
/**
|
|
4
|
+
* Chat-agent settings and tool-call approvals (/v1/agent/*).
|
|
5
|
+
*
|
|
6
|
+
* In agent mode Nova runs a tool loop inside `nova.chat.stream()`. Tools with
|
|
7
|
+
* side effects pause the loop and emit an `approval_request` event; decide it
|
|
8
|
+
* here and the stream continues. Not to be confused with `nova.agents`
|
|
9
|
+
* (custom agents) or `nova.approvals` (governed-pipeline queue).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* await nova.agent.updateSettings({ agent_mode: true });
|
|
14
|
+
* for await (const ev of nova.chat.stream({ message: 'email Kari the summary' })) {
|
|
15
|
+
* if (ev.type === 'approval_request') await nova.agent.approve(ev.id);
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class AgentResource {
|
|
20
|
+
private readonly http;
|
|
21
|
+
constructor(http: HttpClient);
|
|
22
|
+
/** Your account's agent settings, plus the defaults. */
|
|
23
|
+
getSettings(): Promise<AgentSettingsResponse>;
|
|
24
|
+
/** Change settings, e.g. `{ agent_mode: true, company_name: 'Acme' }`. Invalid values throw (code `invalid_setting`). */
|
|
25
|
+
updateSettings(changes: Partial<AgentSettings>): Promise<AgentSettingsResponse>;
|
|
26
|
+
/** One approval request and its status. */
|
|
27
|
+
getApproval(approvalId: string): Promise<AgentApproval>;
|
|
28
|
+
/** Decide a paused tool call. A second decision throws (409 `already_decided`). */
|
|
29
|
+
decide(approvalId: string, decision: 'approve' | 'reject'): Promise<AgentApproval>;
|
|
30
|
+
/** Let the paused tool call run. */
|
|
31
|
+
approve(approvalId: string): Promise<AgentApproval>;
|
|
32
|
+
/** Skip the paused tool call; the agent is told it was declined. */
|
|
33
|
+
reject(approvalId: string): Promise<AgentApproval>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/resources/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE5F;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B,wDAAwD;IAClD,WAAW,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAInD,yHAAyH;IACnH,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIrF,2CAA2C;IACrC,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAI7D,mFAAmF;IAC7E,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC;IAIxF,oCAAoC;IAC9B,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIzD,oEAAoE;IAC9D,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAGzD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentResource = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Chat-agent settings and tool-call approvals (/v1/agent/*).
|
|
6
|
+
*
|
|
7
|
+
* In agent mode Nova runs a tool loop inside `nova.chat.stream()`. Tools with
|
|
8
|
+
* side effects pause the loop and emit an `approval_request` event; decide it
|
|
9
|
+
* here and the stream continues. Not to be confused with `nova.agents`
|
|
10
|
+
* (custom agents) or `nova.approvals` (governed-pipeline queue).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* await nova.agent.updateSettings({ agent_mode: true });
|
|
15
|
+
* for await (const ev of nova.chat.stream({ message: 'email Kari the summary' })) {
|
|
16
|
+
* if (ev.type === 'approval_request') await nova.agent.approve(ev.id);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
class AgentResource {
|
|
21
|
+
http;
|
|
22
|
+
constructor(http) {
|
|
23
|
+
this.http = http;
|
|
24
|
+
}
|
|
25
|
+
/** Your account's agent settings, plus the defaults. */
|
|
26
|
+
async getSettings() {
|
|
27
|
+
return this.http.get('/agent/settings');
|
|
28
|
+
}
|
|
29
|
+
/** Change settings, e.g. `{ agent_mode: true, company_name: 'Acme' }`. Invalid values throw (code `invalid_setting`). */
|
|
30
|
+
async updateSettings(changes) {
|
|
31
|
+
return this.http.put('/agent/settings', { settings: changes });
|
|
32
|
+
}
|
|
33
|
+
/** One approval request and its status. */
|
|
34
|
+
async getApproval(approvalId) {
|
|
35
|
+
return this.http.get(`/agent/approvals/${encodeURIComponent(approvalId)}`);
|
|
36
|
+
}
|
|
37
|
+
/** Decide a paused tool call. A second decision throws (409 `already_decided`). */
|
|
38
|
+
async decide(approvalId, decision) {
|
|
39
|
+
return this.http.post(`/agent/approvals/${encodeURIComponent(approvalId)}`, { decision });
|
|
40
|
+
}
|
|
41
|
+
/** Let the paused tool call run. */
|
|
42
|
+
async approve(approvalId) {
|
|
43
|
+
return this.decide(approvalId, 'approve');
|
|
44
|
+
}
|
|
45
|
+
/** Skip the paused tool call; the agent is told it was declined. */
|
|
46
|
+
async reject(approvalId) {
|
|
47
|
+
return this.decide(approvalId, 'reject');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.AgentResource = AgentResource;
|
|
51
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/resources/agent.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;GAeG;AACH,MAAa,aAAa;IACP,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC1C,CAAC;IAED,yHAAyH;IACzH,KAAK,CAAC,cAAc,CAAC,OAA+B;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,2CAA2C;IAC3C,KAAK,CAAC,WAAW,CAAC,UAAkB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,mFAAmF;IACnF,KAAK,CAAC,MAAM,CAAC,UAAkB,EAAE,QAA8B;QAC7D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,kBAAkB,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,oCAAoC;IACpC,KAAK,CAAC,OAAO,CAAC,UAAkB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED,oEAAoE;IACpE,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF;AApCD,sCAoCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAoBnD,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B,uBAAuB;IACjB,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAI3F,gCAAgC;IAC1B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAIrC,0BAA0B;IACpB,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAIvD,gCAAgC;IAC1B,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAInE,uBAAuB;IACjB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC,+CAA+C;IACzC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAIpE,kCAAkC;IAC5B,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAItE,0CAA0C;IACpC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAKrF,qCAAqC;IAC/B,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAIjD,uCAAuC;IACjC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C,kDAAkD;IAC5C,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAG5F"}
|
package/dist/resources/agents.js
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentsResource = void 0;
|
|
4
4
|
const streaming_js_1 = require("../utils/streaming.js");
|
|
5
|
+
/** The API reads snake_case; camelCase run options were silently ignored. */
|
|
6
|
+
function runBody(params) {
|
|
7
|
+
return {
|
|
8
|
+
input: params.input,
|
|
9
|
+
context: params.context,
|
|
10
|
+
memory: params.memory,
|
|
11
|
+
session_id: params.sessionId,
|
|
12
|
+
learning: params.learning,
|
|
13
|
+
rag: params.rag,
|
|
14
|
+
rag_document_ids: params.ragDocumentIds,
|
|
15
|
+
rag_top_k: params.ragTopK,
|
|
16
|
+
rag_threshold: params.ragThreshold,
|
|
17
|
+
allow_training: params.allowTraining,
|
|
18
|
+
tools: params.tools,
|
|
19
|
+
allowed_agents: params.allowedAgents,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
5
22
|
class AgentsResource {
|
|
6
23
|
http;
|
|
7
24
|
constructor(http) {
|
|
@@ -33,11 +50,11 @@ class AgentsResource {
|
|
|
33
50
|
}
|
|
34
51
|
/** Run an agent synchronously. */
|
|
35
52
|
async run(id, params) {
|
|
36
|
-
return this.http.post(`/agents/${id}/run`, { ...params, stream: false });
|
|
53
|
+
return this.http.post(`/agents/${id}/run`, { ...runBody(params), stream: false });
|
|
37
54
|
}
|
|
38
55
|
/** Run an agent with streaming output. */
|
|
39
56
|
async stream(id, params) {
|
|
40
|
-
const response = await this.http.stream(`/agents/${id}/run`, { ...params, stream: true });
|
|
57
|
+
const response = await this.http.stream(`/agents/${id}/run`, { ...runBody(params), stream: true });
|
|
41
58
|
return new streaming_js_1.NovaStream(response);
|
|
42
59
|
}
|
|
43
60
|
/** Get agent conversation memory. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":";;;AAYA,wDAAmD;AAEnD,MAAa,cAAc;IACR,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,uBAAuB;IACvB,KAAK,CAAC,IAAI,CAAC,MAA6D;QACtE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAU,SAAS,EAAE,MAA+D,CAAC,CAAC;IAC5G,CAAC;IAED,gCAAgC;IAChC,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAQ,WAAW,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,0BA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,GAAG,CAAC,EAAU,EAAE,MAAsB;QAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAiB,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,0CAA0C;IAC1C,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAAsB;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACnG,OAAO,IAAI,yBAAU,CAAiB,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED,qCAAqC;IACrC,KAAK,CAAC,SAAS,CAAC,EAAU;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,WAAW,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED,uCAAuC;IACvC,KAAK,CAAC,WAAW,CAAC,EAAU;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAClD,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,UAAU,CAAC,OAAe,EAAE,MAA2B;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAqB,WAAW,OAAO,UAAU,EAAE,MAA+D,CAAC,CAAC;IAC1I,CAAC;CACF;AA9DD,wCA8DC"}
|
package/dist/resources/chat.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { ChatStreamEvent, ChatStreamParams } from '../types/chat-stream.js'
|
|
|
5
5
|
* Conversational chat powered by Nova's full AI pipeline.
|
|
6
6
|
*
|
|
7
7
|
* Features:
|
|
8
|
-
* - Automatic model fallback (if
|
|
8
|
+
* - Automatic model fallback (if the primary model fails, the next one in the chain is tried)
|
|
9
9
|
* - Conversation memory maintained server-side
|
|
10
10
|
* - Smart model routing based on intent
|
|
11
11
|
* - Trust evaluation and guardrails
|
|
@@ -20,9 +20,9 @@ import type { ChatStreamEvent, ChatStreamParams } from '../types/chat-stream.js'
|
|
|
20
20
|
* // Chat with auto-fallback if primary model fails
|
|
21
21
|
* const reply = await nova.chat.sendWithFallback({
|
|
22
22
|
* message: 'Write a REST API',
|
|
23
|
-
* model: '
|
|
23
|
+
* model: 'nova-flagship',
|
|
24
24
|
* });
|
|
25
|
-
* //
|
|
25
|
+
* // On 429 / 5xx / timeout, the next model in the backup chain is tried
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
export declare class ChatResource {
|
|
@@ -40,7 +40,7 @@ export declare class ChatResource {
|
|
|
40
40
|
*
|
|
41
41
|
* If the primary model fails (429 rate limit, 500 error, timeout),
|
|
42
42
|
* automatically retries with the next model in the chain:
|
|
43
|
-
*
|
|
43
|
+
* (the built-in backup chain, or `fallbackModels`)
|
|
44
44
|
*
|
|
45
45
|
* @param params - Chat message parameters
|
|
46
46
|
* @param fallbackModels - Custom fallback chain (optional)
|
|
@@ -57,23 +57,25 @@ export declare class ChatResource {
|
|
|
57
57
|
* Stream chat events from /v1/chat/stream as they arrive.
|
|
58
58
|
*
|
|
59
59
|
* Yields a discriminated-union of events: `token` (per-token text),
|
|
60
|
-
* `pipeline` (per-step status), `
|
|
61
|
-
* `
|
|
62
|
-
* `
|
|
60
|
+
* `pipeline` (per-step status), `meta` (session / conversation ids),
|
|
61
|
+
* `artifact` (versioned doc / sheet / slides), `design` / `document` /
|
|
62
|
+
* `pdf` / `pptx` / `image` / `audio` (legacy artifacts), agent-mode
|
|
63
|
+
* events (`tool_start`, `tool_result`, `approval_request`,
|
|
64
|
+
* `approval_resolved`, `task_list`, `usage`, `model_fallback`), `plan`,
|
|
65
|
+
* and a final `done`. Unknown types arrive as `{ type: 'unknown', event_type, raw }`.
|
|
66
|
+
*
|
|
67
|
+
* Throws `NovaInsufficientCreditsError` when the account is out of
|
|
68
|
+
* credits — as an HTTP 402 or as a `done` event with `quota_exceeded`.
|
|
63
69
|
*
|
|
64
70
|
* @example
|
|
65
71
|
* ```typescript
|
|
66
|
-
*
|
|
67
|
-
* for await (const ev of nova.chat.stream({ message: 'create a 10-slide deck for Acme AI' })) {
|
|
72
|
+
* for await (const ev of nova.chat.stream({ message: 'write a project brief', agent_mode: true })) {
|
|
68
73
|
* switch (ev.type) {
|
|
69
|
-
* case 'token':
|
|
70
|
-
* case '
|
|
71
|
-
* case '
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* case 'pptx_visual':
|
|
75
|
-
* await fs.writeFile(ev.filename, Buffer.from(ev.pptx_base64, 'base64')); break;
|
|
76
|
-
* case 'done': console.log(`\\nDone — ${ev.model_used}, ${ev.agents_used} agents`); break;
|
|
74
|
+
* case 'token': process.stdout.write(ev.content); break;
|
|
75
|
+
* case 'task_list': console.log(ev.tasks); break;
|
|
76
|
+
* case 'approval_request': await nova.agent.approve(ev.id); break;
|
|
77
|
+
* case 'artifact': console.log(ev.artifact.title, ev.artifact.formats); break;
|
|
78
|
+
* case 'done': console.log(`\\nconfidence ${ev.confidence}`); break;
|
|
77
79
|
* }
|
|
78
80
|
* }
|
|
79
81
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/resources/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EAEZ,eAAe,EACf,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/resources/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EAEZ,eAAe,EACf,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKjF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B;;;;;OAKG;IACG,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAI5D;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,MAAM,EAAE,iBAAiB,EACzB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,YAAY,CAAC;IAYxB,qCAAqC;IAC/B,QAAQ,IAAI,OAAO,CAAC,eAAe,CAAC;IAI1C,8CAA8C;IACxC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAItD,0DAA0D;IACpD,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACI,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,qBAAqB,CAAC,eAAe,CAAC;CAchF"}
|
package/dist/resources/chat.js
CHANGED
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ChatResource = void 0;
|
|
4
4
|
const chat_stream_js_1 = require("../types/chat-stream.js");
|
|
5
5
|
const fallback_js_1 = require("../core/fallback.js");
|
|
6
|
+
const errors_js_1 = require("../core/errors.js");
|
|
6
7
|
/**
|
|
7
8
|
* Conversational chat powered by Nova's full AI pipeline.
|
|
8
9
|
*
|
|
9
10
|
* Features:
|
|
10
|
-
* - Automatic model fallback (if
|
|
11
|
+
* - Automatic model fallback (if the primary model fails, the next one in the chain is tried)
|
|
11
12
|
* - Conversation memory maintained server-side
|
|
12
13
|
* - Smart model routing based on intent
|
|
13
14
|
* - Trust evaluation and guardrails
|
|
@@ -22,9 +23,9 @@ const fallback_js_1 = require("../core/fallback.js");
|
|
|
22
23
|
* // Chat with auto-fallback if primary model fails
|
|
23
24
|
* const reply = await nova.chat.sendWithFallback({
|
|
24
25
|
* message: 'Write a REST API',
|
|
25
|
-
* model: '
|
|
26
|
+
* model: 'nova-flagship',
|
|
26
27
|
* });
|
|
27
|
-
* //
|
|
28
|
+
* // On 429 / 5xx / timeout, the next model in the backup chain is tried
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
class ChatResource {
|
|
@@ -46,7 +47,7 @@ class ChatResource {
|
|
|
46
47
|
*
|
|
47
48
|
* If the primary model fails (429 rate limit, 500 error, timeout),
|
|
48
49
|
* automatically retries with the next model in the chain:
|
|
49
|
-
*
|
|
50
|
+
* (the built-in backup chain, or `fallbackModels`)
|
|
50
51
|
*
|
|
51
52
|
* @param params - Chat message parameters
|
|
52
53
|
* @param fallbackModels - Custom fallback chain (optional)
|
|
@@ -73,30 +74,41 @@ class ChatResource {
|
|
|
73
74
|
* Stream chat events from /v1/chat/stream as they arrive.
|
|
74
75
|
*
|
|
75
76
|
* Yields a discriminated-union of events: `token` (per-token text),
|
|
76
|
-
* `pipeline` (per-step status), `
|
|
77
|
-
* `
|
|
78
|
-
* `
|
|
77
|
+
* `pipeline` (per-step status), `meta` (session / conversation ids),
|
|
78
|
+
* `artifact` (versioned doc / sheet / slides), `design` / `document` /
|
|
79
|
+
* `pdf` / `pptx` / `image` / `audio` (legacy artifacts), agent-mode
|
|
80
|
+
* events (`tool_start`, `tool_result`, `approval_request`,
|
|
81
|
+
* `approval_resolved`, `task_list`, `usage`, `model_fallback`), `plan`,
|
|
82
|
+
* and a final `done`. Unknown types arrive as `{ type: 'unknown', event_type, raw }`.
|
|
83
|
+
*
|
|
84
|
+
* Throws `NovaInsufficientCreditsError` when the account is out of
|
|
85
|
+
* credits — as an HTTP 402 or as a `done` event with `quota_exceeded`.
|
|
79
86
|
*
|
|
80
87
|
* @example
|
|
81
88
|
* ```typescript
|
|
82
|
-
*
|
|
83
|
-
* for await (const ev of nova.chat.stream({ message: 'create a 10-slide deck for Acme AI' })) {
|
|
89
|
+
* for await (const ev of nova.chat.stream({ message: 'write a project brief', agent_mode: true })) {
|
|
84
90
|
* switch (ev.type) {
|
|
85
|
-
* case 'token':
|
|
86
|
-
* case '
|
|
87
|
-
* case '
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* case 'pptx_visual':
|
|
91
|
-
* await fs.writeFile(ev.filename, Buffer.from(ev.pptx_base64, 'base64')); break;
|
|
92
|
-
* case 'done': console.log(`\\nDone — ${ev.model_used}, ${ev.agents_used} agents`); break;
|
|
91
|
+
* case 'token': process.stdout.write(ev.content); break;
|
|
92
|
+
* case 'task_list': console.log(ev.tasks); break;
|
|
93
|
+
* case 'approval_request': await nova.agent.approve(ev.id); break;
|
|
94
|
+
* case 'artifact': console.log(ev.artifact.title, ev.artifact.formats); break;
|
|
95
|
+
* case 'done': console.log(`\\nconfidence ${ev.confidence}`); break;
|
|
93
96
|
* }
|
|
94
97
|
* }
|
|
95
98
|
* ```
|
|
96
99
|
*/
|
|
97
100
|
async *stream(params) {
|
|
98
101
|
for await (const raw of this.http.postStream('/chat/stream', params)) {
|
|
99
|
-
|
|
102
|
+
const event = (0, chat_stream_js_1.parseChatEvent)(raw);
|
|
103
|
+
if (event.type === 'done' && event.quota_exceeded) {
|
|
104
|
+
throw new errors_js_1.NovaInsufficientCreditsError({
|
|
105
|
+
operation: 'chat',
|
|
106
|
+
balance: 0,
|
|
107
|
+
cost: 0,
|
|
108
|
+
message: event.full_response || 'Not enough credits to run this chat turn.',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
yield event;
|
|
100
112
|
}
|
|
101
113
|
}
|
|
102
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/resources/chat.ts"],"names":[],"mappings":";;;AASA,4DAAyD;AACzD,qDAAgF;
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/resources/chat.ts"],"names":[],"mappings":";;;AASA,4DAAyD;AACzD,qDAAgF;AAChF,iDAAiE;AAEjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,YAAY;IACN,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,MAAyB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAe,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,gBAAgB,CACpB,MAAyB,EACzB,cAAyB;QAEzB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC;QACvC,MAAM,KAAK,GAAG,cAAc,IAAI,CAAC,GAAG,oCAAsB,CAAC,CAAC;QAE5D,OAAO,IAAA,+BAAiB,EACtB,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAe,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EACtE,OAAO,EACP,KAAK,EACL,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAC9B,CAAC;IACJ,CAAC;IAED,qCAAqC;IACrC,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,gBAAgB,CAAC,CAAC;IAC1D,CAAC;IAED,8CAA8C;IAC9C,KAAK,CAAC,OAAO,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,kBAAkB,SAAS,UAAU,CAAC,CAAC;IAC3E,CAAC;IAED,0DAA0D;IAC1D,KAAK,CAAC,aAAa,CAAC,SAAiB;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK,CAAC,CAAC,MAAM,CAAC,MAAwB;QACpC,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC;YACrE,MAAM,KAAK,GAAG,IAAA,+BAAc,EAAC,GAAG,CAAC,CAAC;YAClC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;gBAClD,MAAM,IAAI,wCAA4B,CAAC;oBACrC,SAAS,EAAE,MAAM;oBACjB,OAAO,EAAE,CAAC;oBACV,IAAI,EAAE,CAAC;oBACP,OAAO,EAAE,KAAK,CAAC,aAAa,IAAI,2CAA2C;iBAC5E,CAAC,CAAC;YACL,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAnGD,oCAmGC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { HttpClient } from '../core/http.js';
|
|
2
|
+
import type { Artifact, ArtifactListItem, ArtifactVersionParams, Conversation, ConversationCreateParams, ConversationDetail, ConversationList, ConversationSettings, ConversationSummary, ConversationUpdateParams } from '../types/conversations.js';
|
|
3
|
+
/**
|
|
4
|
+
* Server-side conversations and their artifacts (documents, sheets, decks).
|
|
5
|
+
* Every call only sees the caller's own conversations (another account's
|
|
6
|
+
* id answers 404).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const { conversations } = await nova.conversations.list({ limit: 20 });
|
|
11
|
+
* const conv = await nova.conversations.get(conversations[0].id);
|
|
12
|
+
* const [first] = await nova.conversations.artifacts(conv.id);
|
|
13
|
+
* const pdf = await nova.conversations.exportArtifact(conv.id, first.artifact_id, 'pdf');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class ConversationsResource {
|
|
17
|
+
private readonly http;
|
|
18
|
+
constructor(http: HttpClient);
|
|
19
|
+
/** Newest first. Pass `next` from the previous page as `before`. */
|
|
20
|
+
list(params?: {
|
|
21
|
+
limit?: number;
|
|
22
|
+
before?: string;
|
|
23
|
+
}): Promise<ConversationList>;
|
|
24
|
+
/** Create a conversation; `messages` imports an existing chat. */
|
|
25
|
+
create(params?: ConversationCreateParams): Promise<Conversation>;
|
|
26
|
+
/** The conversation with all its messages. */
|
|
27
|
+
get(conversationId: string): Promise<ConversationDetail>;
|
|
28
|
+
/** Rename and/or change `memory_mode`. */
|
|
29
|
+
update(conversationId: string, params: ConversationUpdateParams): Promise<Conversation>;
|
|
30
|
+
/** Delete the conversation, its messages, files and artifacts. */
|
|
31
|
+
delete(conversationId: string): Promise<void>;
|
|
32
|
+
/** The rolling summary Nova keeps for long conversations. */
|
|
33
|
+
summary(conversationId: string): Promise<ConversationSummary>;
|
|
34
|
+
/** Account-wide conversation settings. */
|
|
35
|
+
getSettings(): Promise<ConversationSettings>;
|
|
36
|
+
/** `'session_only'` turns long-term memory off for the whole account. */
|
|
37
|
+
updateSettings(memoryModeDefault: string): Promise<ConversationSettings>;
|
|
38
|
+
/** Bytes of a file Nova generated in this conversation. */
|
|
39
|
+
downloadFile(conversationId: string, fileId: string): Promise<ArrayBuffer>;
|
|
40
|
+
/** Documents, sheets and decks of this conversation, with their versions. */
|
|
41
|
+
artifacts(conversationId: string): Promise<ArtifactListItem[]>;
|
|
42
|
+
/** One version (default: the latest) with its content and formats. */
|
|
43
|
+
getArtifact(conversationId: string, artifactId: string, version?: number): Promise<Artifact>;
|
|
44
|
+
/** Save edited `content` as a new version, or restore an old one. Earlier versions are kept. */
|
|
45
|
+
addArtifactVersion(conversationId: string, artifactId: string, params: ArtifactVersionParams): Promise<Artifact>;
|
|
46
|
+
/** The artifact as a file: docx / pdf / html (doc), xlsx / csv (sheet), pdf / pptx (slides). */
|
|
47
|
+
exportArtifact(conversationId: string, artifactId: string, format: string, version?: number): Promise<ArrayBuffer>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/resources/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B,oEAAoE;IAC9D,IAAI,CAAC,MAAM,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIvF,kEAAkE;IAC5D,MAAM,CAAC,MAAM,GAAE,wBAA6B,GAAG,OAAO,CAAC,YAAY,CAAC;IAI1E,8CAA8C;IACxC,GAAG,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI9D,0CAA0C;IACpC,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC;IAI7F,kEAAkE;IAC5D,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,6DAA6D;IACvD,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG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