negotium 0.1.19 → 0.1.21
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/dist/agent-helpers.js +146 -23
- package/dist/agent-helpers.js.map +14 -12
- package/dist/cron.js +137 -52
- package/dist/cron.js.map +20 -19
- package/dist/hosted-agent.js +29 -17
- package/dist/hosted-agent.js.map +7 -7
- package/dist/main.js +145 -55
- package/dist/main.js.map +20 -19
- package/dist/mcp-factories.js +23 -22
- package/dist/mcp-factories.js.map +3 -3
- package/dist/prompts.js +98 -9
- package/dist/prompts.js.map +6 -5
- package/dist/runtime/scripts/browser-passkey-policy.mjs +36 -0
- package/dist/runtime/scripts/browser-vault-transform.mjs +33 -0
- package/dist/runtime/scripts/mcp-patchright-http.mjs +22 -4
- package/dist/runtime/src/agents/archiver.ts +0 -14
- package/dist/runtime/src/agents/claude-provider.ts +11 -7
- package/dist/runtime/src/agents/execution-host.ts +10 -1
- package/dist/runtime/src/agents/idle-archiver.ts +21 -0
- package/dist/runtime/src/agents/maestro-provider.ts +9 -14
- package/dist/runtime/src/agents/mcp-tools/self-config.ts +1 -1
- package/dist/runtime/src/agents/mcp-tools/spawn-subagent.ts +6 -1
- package/dist/runtime/src/agents/memory-archive-policy.ts +34 -0
- package/dist/runtime/src/agents/model-catalog.ts +84 -18
- package/dist/runtime/src/mcp/factories/vault.ts +36 -34
- package/dist/runtime/src/mcp/vault-server.ts +1 -0
- package/dist/runtime/src/platform/mcp-config.ts +4 -8
- package/dist/runtime/src/platform/playwright/manager.ts +5 -2
- package/dist/runtime/src/prompts/builders.ts +36 -7
- package/dist/runtime/src/runtime/turn-runner.ts +2 -0
- package/dist/runtime/src/storage/topic-archive.ts +5 -2
- package/dist/runtime/src/topics/lifecycle.ts +2 -1
- package/dist/runtime/src/topics/session.ts +2 -0
- package/dist/runtime/src/version.ts +1 -1
- package/dist/storage.js +23 -3
- package/dist/storage.js.map +5 -4
- package/dist/types/packages/core/src/agents/claude-provider.d.ts +1 -0
- package/dist/types/packages/core/src/agents/execution-host.d.ts +2 -0
- package/dist/types/packages/core/src/agents/idle-archiver.d.ts +2 -0
- package/dist/types/packages/core/src/agents/memory-archive-policy.d.ts +14 -0
- package/dist/types/packages/core/src/agents/model-catalog.d.ts +77 -0
- package/dist/types/packages/core/src/mcp/factories/vault.d.ts +1 -0
- package/dist/types/packages/core/src/prompts/builders.d.ts +5 -1
- package/dist/types/packages/core/src/storage/topic-archive.d.ts +1 -0
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { AgentKind } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Models/prefixes that belong exclusively to one agent backend. When the
|
|
4
|
+
* resolved agent differs from a model's owner, the model is cross-agent stale
|
|
5
|
+
* and must be dropped in favor of the new agent's default — otherwise the value
|
|
6
|
+
* is passed straight into a provider that can't run it and crashes the turn
|
|
7
|
+
* (bug B: `/codex` leaves the topic's "sonnet" behind → Codex 400
|
|
8
|
+
* "The 'sonnet' model is not supported when using Codex").
|
|
9
|
+
*
|
|
10
|
+
* Codex's own `validateModel` accepts ANY non-empty string (OpenAI ships new
|
|
11
|
+
* IDs frequently), so it can't reject "sonnet" on its own — this ownership
|
|
12
|
+
* owner check is the cross-agent guard the per-registry validator can't provide.
|
|
13
|
+
* Unknown/new model IDs are intentionally absent here so they still pass
|
|
14
|
+
* through to whichever agent is active.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MODEL_OWNER: Record<string, AgentKind>;
|
|
17
|
+
export interface SelectableModel {
|
|
18
|
+
/** Canonical token accepted by user-facing `/model` commands. */
|
|
19
|
+
model: string;
|
|
20
|
+
/** Runtime owner kept internal so channel UIs only need to show `model`. */
|
|
21
|
+
agent: AgentKind;
|
|
22
|
+
/** Short comparison copy shown alongside the model in picker UIs. */
|
|
23
|
+
description: string;
|
|
24
|
+
/** User-defined relative intelligence band used for routing across providers. */
|
|
25
|
+
intelligenceTier: "sonnet" | "opus" | "fable";
|
|
26
|
+
/** Compact capability/cost hint safe to inject into every turn and tool schema. */
|
|
27
|
+
routingSummary: string;
|
|
28
|
+
/** Subscription or API basis used when comparing operating cost. */
|
|
29
|
+
accessCost: string;
|
|
30
|
+
/** Marginal per-token rate after included subscription usage, or the API rate. */
|
|
31
|
+
marginalTokenCost: string;
|
|
32
|
+
/** Best available quota estimate; never presented as a provider-guaranteed token cap. */
|
|
33
|
+
estimatedUsage: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Pricing and quota observations were checked on 2026-07-19.
|
|
37
|
+
* Official references:
|
|
38
|
+
* - https://learn.chatgpt.com/docs/pricing
|
|
39
|
+
* - https://help.openai.com/en/articles/20001106
|
|
40
|
+
* - https://support.claude.com/en/articles/11049741-what-is-the-max-plan
|
|
41
|
+
* - https://api-docs.deepseek.com/quick_start/pricing
|
|
42
|
+
* Community token counts are deliberately labelled estimates because providers
|
|
43
|
+
* meter cached input, fresh input, output, reasoning, speed, and model choice
|
|
44
|
+
* differently and may change server-side weights without publishing a token cap.
|
|
45
|
+
*/
|
|
46
|
+
export declare const MODEL_COST_RESEARCHED_AT = "2026-07-19";
|
|
47
|
+
export declare const MODEL_COST_ROUTING_SUMMARY = "Cost basis (2026-07-19): Codex Pro 20x and Claude Max 20x are each $200/month; DeepSeek Pro is pay-per-token. Relative marginal token cost: DeepSeek Pro << Codex < Claude.";
|
|
48
|
+
/**
|
|
49
|
+
* Canonical model picker shared by every channel. Keep this deliberately
|
|
50
|
+
* finite even though the Codex backend accepts arbitrary future model ids:
|
|
51
|
+
* user-facing completion should only promise models we intentionally support.
|
|
52
|
+
*/
|
|
53
|
+
export declare const SELECTABLE_MODELS: readonly SelectableModel[];
|
|
54
|
+
export declare function formatSelectableModel(candidate: SelectableModel): string;
|
|
55
|
+
export declare function selectableModel(value: string): SelectableModel | undefined;
|
|
56
|
+
export declare function modelOwner(model: string): AgentKind | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Resolve the model to run for `agent`, given the requested value from the
|
|
59
|
+
* priority chain (per-message slash > topic-config override > topic default).
|
|
60
|
+
* Drops a model owned by a different agent, then falls back to the agent's
|
|
61
|
+
* registry default if the value is empty/invalid for this agent.
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveModelForAgent(agent: AgentKind, requested: string | undefined, registry: {
|
|
64
|
+
validateModel(s: string): boolean;
|
|
65
|
+
defaultModel: string;
|
|
66
|
+
}): string;
|
|
67
|
+
/**
|
|
68
|
+
* Circular fallback order per agent. Each entry lists candidates to try in
|
|
69
|
+
* priority order when the current agent errors out. The actual switch is
|
|
70
|
+
* guarded by `checkAgentAuth` — only candidates whose backend is reachable
|
|
71
|
+
* (API key present / auth file exists) will be selected.
|
|
72
|
+
*/
|
|
73
|
+
export declare const FALLBACK_ORDER: Record<AgentKind, {
|
|
74
|
+
agent: AgentKind;
|
|
75
|
+
model: string;
|
|
76
|
+
}[]>;
|
|
77
|
+
export declare const AGENT_DISPLAY_NAME: Record<AgentKind, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentKind } from "../types";
|
|
1
|
+
import type { AgentKind, EffortLevel } from "../types";
|
|
2
2
|
export interface AgentDef {
|
|
3
3
|
name: string;
|
|
4
4
|
type: "autonomous" | "programmatic";
|
|
@@ -13,6 +13,10 @@ export interface SessionSystemPromptOpts {
|
|
|
13
13
|
topicTitle: string;
|
|
14
14
|
workspaceCwd: string;
|
|
15
15
|
agentKind: AgentKind;
|
|
16
|
+
/** Resolved model actually used for this turn. */
|
|
17
|
+
currentModel?: string;
|
|
18
|
+
/** Resolved effort actually used for this turn; absent means provider default/off. */
|
|
19
|
+
currentEffort?: EffortLevel;
|
|
16
20
|
description?: string | null;
|
|
17
21
|
/** True only for top-level agent rooms — the runtime spawn_subagent tool is registered there. */
|
|
18
22
|
canSpawnSubagents?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NEGOTIUM_VERSION = "0.1.
|
|
1
|
+
export declare const NEGOTIUM_VERSION = "0.1.21";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "negotium",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Install the Negotium multi-agent runtime and CLI with one package",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
132
132
|
"@openai/codex-sdk": "0.144.4",
|
|
133
133
|
"maestro-agent-sdk": "0.1.45",
|
|
134
|
-
"mcp-patchright": "0.1.
|
|
134
|
+
"mcp-patchright": "0.1.11",
|
|
135
135
|
"node-telegram-bot-api": "^1.1.2",
|
|
136
136
|
"pino": "^10.3.1",
|
|
137
137
|
"pino-pretty": "^13.1.3",
|