@coinrithm/mcp-trading 0.7.15 → 0.7.17

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 (76) hide show
  1. package/CHANGELOG.md +885 -692
  2. package/README.md +486 -400
  3. package/dist/agent/bench/bench.d.ts +59 -0
  4. package/dist/agent/bench/bench.js +319 -0
  5. package/dist/agent/bench/cassette.d.ts +97 -0
  6. package/dist/agent/bench/cassette.js +181 -0
  7. package/dist/agent/bench/costs.d.ts +28 -0
  8. package/dist/agent/bench/costs.js +60 -0
  9. package/dist/agent/bench/labelBuilder.d.ts +123 -0
  10. package/dist/agent/bench/labelBuilder.js +282 -0
  11. package/dist/agent/bench/labels.d.ts +75 -0
  12. package/dist/agent/bench/labels.js +259 -0
  13. package/dist/agent/bench/recordingClient.d.ts +51 -0
  14. package/dist/agent/bench/recordingClient.js +193 -0
  15. package/dist/agent/bench/replayClient.d.ts +41 -0
  16. package/dist/agent/bench/replayClient.js +262 -0
  17. package/dist/agent/bench/report.d.ts +115 -0
  18. package/dist/agent/bench/report.js +435 -0
  19. package/dist/agent/capitalSizing.d.ts +10 -1
  20. package/dist/agent/capitalSizing.js +28 -4
  21. package/dist/agent/cli.d.ts +25 -0
  22. package/dist/agent/cli.js +300 -2
  23. package/dist/agent/client.d.ts +14 -0
  24. package/dist/agent/client.js +23 -6
  25. package/dist/agent/configurationWarnings.js +11 -0
  26. package/dist/agent/decision.d.ts +24 -16
  27. package/dist/agent/decision.js +92 -3
  28. package/dist/agent/decisionValidator.d.ts +31 -0
  29. package/dist/agent/decisionValidator.js +148 -3
  30. package/dist/agent/engine.d.ts +5 -3
  31. package/dist/agent/engine.js +5 -3
  32. package/dist/agent/futuresCloseOutcome.d.ts +19 -0
  33. package/dist/agent/futuresCloseOutcome.js +54 -0
  34. package/dist/agent/futuresEligibility.d.ts +13 -0
  35. package/dist/agent/futuresEligibility.js +43 -5
  36. package/dist/agent/observe.d.ts +28 -2
  37. package/dist/agent/observe.js +530 -90
  38. package/dist/agent/pmPaperCandidates.d.ts +17 -0
  39. package/dist/agent/pmPaperCandidates.js +125 -0
  40. package/dist/agent/pmPaperCycle.d.ts +16 -0
  41. package/dist/agent/pmPaperCycle.js +372 -0
  42. package/dist/agent/pmPaperDecision.d.ts +187 -0
  43. package/dist/agent/pmPaperDecision.js +101 -0
  44. package/dist/agent/pmPaperPolicy.d.ts +71 -0
  45. package/dist/agent/pmPaperPolicy.js +46 -0
  46. package/dist/agent/prompt.d.ts +15 -1
  47. package/dist/agent/prompt.js +187 -9
  48. package/dist/agent/promptTables.d.ts +1 -0
  49. package/dist/agent/promptTables.js +33 -0
  50. package/dist/agent/providerCapabilities.d.ts +7 -0
  51. package/dist/agent/providerCapabilities.js +27 -1
  52. package/dist/agent/providers.d.ts +26 -7
  53. package/dist/agent/providers.js +193 -48
  54. package/dist/agent/resolve.js +3 -0
  55. package/dist/agent/runner.d.ts +17 -1
  56. package/dist/agent/runner.js +210 -38
  57. package/dist/agent/setups.d.ts +2 -1
  58. package/dist/agent/setups.js +17 -16
  59. package/dist/agent/signals.d.ts +33 -0
  60. package/dist/agent/signals.js +89 -0
  61. package/dist/agent/skill.js +46 -0
  62. package/dist/agent/skillValidator.js +56 -0
  63. package/dist/agent/strictLint.js +30 -0
  64. package/dist/agent/templates.js +30 -30
  65. package/dist/agent/types.d.ts +180 -12
  66. package/dist/agent/universe.d.ts +78 -0
  67. package/dist/agent/universe.js +215 -0
  68. package/dist/agent/version.d.ts +1 -1
  69. package/dist/agent/version.js +1 -1
  70. package/dist/client.d.ts +14 -0
  71. package/dist/client.js +31 -1
  72. package/dist/http.js +1 -1
  73. package/dist/pmPaperV2.d.ts +81 -0
  74. package/dist/pmPaperV2.js +53 -0
  75. package/dist/tools.js +84 -6
  76. package/package.json +100 -97
@@ -0,0 +1,187 @@
1
+ import { z } from "zod";
2
+ import type { ActionsStringDiagnostic } from "./decision.js";
3
+ export declare const pmV2OpenActionSchema: z.ZodObject<Omit<{
4
+ source: z.ZodEnum<["kalshi", "polymarket"]>;
5
+ slug: z.ZodString;
6
+ outcomeExternalMarketId: z.ZodString;
7
+ side: z.ZodEnum<["yes", "no"]>;
8
+ maxCashBudget: z.ZodEffects<z.ZodString, string, string>;
9
+ idempotencyKey: z.ZodString;
10
+ minEntryProbabilityPct: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
11
+ thesis: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
12
+ } & {
13
+ forecastProbability: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
14
+ }, "idempotencyKey" | "minEntryProbabilityPct"> & {
15
+ type: z.ZodLiteral<"pm_v2_open">;
16
+ }, "strict", z.ZodTypeAny, {
17
+ source: "kalshi" | "polymarket";
18
+ type: "pm_v2_open";
19
+ slug: string;
20
+ outcomeExternalMarketId: string;
21
+ side: "yes" | "no";
22
+ maxCashBudget: string;
23
+ forecastProbability: string;
24
+ thesis?: string | null | undefined;
25
+ }, {
26
+ source: "kalshi" | "polymarket";
27
+ type: "pm_v2_open";
28
+ slug: string;
29
+ outcomeExternalMarketId: string;
30
+ side: "yes" | "no";
31
+ maxCashBudget: string;
32
+ forecastProbability: string;
33
+ thesis?: string | null | undefined;
34
+ }>;
35
+ export declare const pmV2CloseActionSchema: z.ZodObject<Omit<{
36
+ positionId: z.ZodNumber;
37
+ idempotencyKey: z.ZodString;
38
+ detail: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
39
+ }, "idempotencyKey"> & {
40
+ type: z.ZodLiteral<"pm_v2_close">;
41
+ }, "strict", z.ZodTypeAny, {
42
+ type: "pm_v2_close";
43
+ positionId: number;
44
+ detail?: string | null | undefined;
45
+ }, {
46
+ type: "pm_v2_close";
47
+ positionId: number;
48
+ detail?: string | null | undefined;
49
+ }>;
50
+ export declare const pmPaperDecisionSchema: z.ZodEffects<z.ZodObject<{
51
+ decision: z.ZodEnum<["act", "skip"]>;
52
+ reason: z.ZodOptional<z.ZodString>;
53
+ rationale: z.ZodOptional<z.ZodString>;
54
+ confidence: z.ZodOptional<z.ZodNumber>;
55
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<Omit<{
56
+ source: z.ZodEnum<["kalshi", "polymarket"]>;
57
+ slug: z.ZodString;
58
+ outcomeExternalMarketId: z.ZodString;
59
+ side: z.ZodEnum<["yes", "no"]>;
60
+ maxCashBudget: z.ZodEffects<z.ZodString, string, string>;
61
+ idempotencyKey: z.ZodString;
62
+ minEntryProbabilityPct: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
63
+ thesis: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
64
+ } & {
65
+ forecastProbability: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
66
+ }, "idempotencyKey" | "minEntryProbabilityPct"> & {
67
+ type: z.ZodLiteral<"pm_v2_open">;
68
+ }, "strict", z.ZodTypeAny, {
69
+ source: "kalshi" | "polymarket";
70
+ type: "pm_v2_open";
71
+ slug: string;
72
+ outcomeExternalMarketId: string;
73
+ side: "yes" | "no";
74
+ maxCashBudget: string;
75
+ forecastProbability: string;
76
+ thesis?: string | null | undefined;
77
+ }, {
78
+ source: "kalshi" | "polymarket";
79
+ type: "pm_v2_open";
80
+ slug: string;
81
+ outcomeExternalMarketId: string;
82
+ side: "yes" | "no";
83
+ maxCashBudget: string;
84
+ forecastProbability: string;
85
+ thesis?: string | null | undefined;
86
+ }>, z.ZodObject<Omit<{
87
+ positionId: z.ZodNumber;
88
+ idempotencyKey: z.ZodString;
89
+ detail: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
90
+ }, "idempotencyKey"> & {
91
+ type: z.ZodLiteral<"pm_v2_close">;
92
+ }, "strict", z.ZodTypeAny, {
93
+ type: "pm_v2_close";
94
+ positionId: number;
95
+ detail?: string | null | undefined;
96
+ }, {
97
+ type: "pm_v2_close";
98
+ positionId: number;
99
+ detail?: string | null | undefined;
100
+ }>]>, "many">;
101
+ }, "strict", z.ZodTypeAny, {
102
+ decision: "skip" | "act";
103
+ actions: ({
104
+ source: "kalshi" | "polymarket";
105
+ type: "pm_v2_open";
106
+ slug: string;
107
+ outcomeExternalMarketId: string;
108
+ side: "yes" | "no";
109
+ maxCashBudget: string;
110
+ forecastProbability: string;
111
+ thesis?: string | null | undefined;
112
+ } | {
113
+ type: "pm_v2_close";
114
+ positionId: number;
115
+ detail?: string | null | undefined;
116
+ })[];
117
+ confidence?: number | undefined;
118
+ reason?: string | undefined;
119
+ rationale?: string | undefined;
120
+ }, {
121
+ decision: "skip" | "act";
122
+ actions: ({
123
+ source: "kalshi" | "polymarket";
124
+ type: "pm_v2_open";
125
+ slug: string;
126
+ outcomeExternalMarketId: string;
127
+ side: "yes" | "no";
128
+ maxCashBudget: string;
129
+ forecastProbability: string;
130
+ thesis?: string | null | undefined;
131
+ } | {
132
+ type: "pm_v2_close";
133
+ positionId: number;
134
+ detail?: string | null | undefined;
135
+ })[];
136
+ confidence?: number | undefined;
137
+ reason?: string | undefined;
138
+ rationale?: string | undefined;
139
+ }>, {
140
+ decision: "skip" | "act";
141
+ actions: ({
142
+ source: "kalshi" | "polymarket";
143
+ type: "pm_v2_open";
144
+ slug: string;
145
+ outcomeExternalMarketId: string;
146
+ side: "yes" | "no";
147
+ maxCashBudget: string;
148
+ forecastProbability: string;
149
+ thesis?: string | null | undefined;
150
+ } | {
151
+ type: "pm_v2_close";
152
+ positionId: number;
153
+ detail?: string | null | undefined;
154
+ })[];
155
+ confidence?: number | undefined;
156
+ reason?: string | undefined;
157
+ rationale?: string | undefined;
158
+ }, {
159
+ decision: "skip" | "act";
160
+ actions: ({
161
+ source: "kalshi" | "polymarket";
162
+ type: "pm_v2_open";
163
+ slug: string;
164
+ outcomeExternalMarketId: string;
165
+ side: "yes" | "no";
166
+ maxCashBudget: string;
167
+ forecastProbability: string;
168
+ thesis?: string | null | undefined;
169
+ } | {
170
+ type: "pm_v2_close";
171
+ positionId: number;
172
+ detail?: string | null | undefined;
173
+ })[];
174
+ confidence?: number | undefined;
175
+ reason?: string | undefined;
176
+ rationale?: string | undefined;
177
+ }>;
178
+ export type PmPaperAction = z.infer<typeof pmV2OpenActionSchema> | z.infer<typeof pmV2CloseActionSchema>;
179
+ export declare function parsePmPaperDecision(text: string): {
180
+ ok: true;
181
+ decision: z.infer<typeof pmPaperDecisionSchema>;
182
+ } | {
183
+ ok: false;
184
+ error: string;
185
+ actionsStringDiagnostic?: ActionsStringDiagnostic;
186
+ };
187
+ export declare const PM_PAPER_DECISION_JSON_SCHEMA: Record<string, unknown>;
@@ -0,0 +1,101 @@
1
+ import { z } from "zod";
2
+ import { pmPaperAgentOpenSchema, pmPaperCloseSchema } from "../pmPaperV2.js";
3
+ // forecastProbability is required: a house open without it fails locally
4
+ // instead of spending a write on the API's 422 forecast_required.
5
+ export const pmV2OpenActionSchema = pmPaperAgentOpenSchema
6
+ .omit({ idempotencyKey: true, minEntryProbabilityPct: true })
7
+ .extend({ type: z.literal("pm_v2_open") })
8
+ .strict();
9
+ export const pmV2CloseActionSchema = pmPaperCloseSchema
10
+ .omit({ idempotencyKey: true })
11
+ .extend({ type: z.literal("pm_v2_close") })
12
+ .strict();
13
+ export const pmPaperDecisionSchema = z
14
+ .object({
15
+ decision: z.enum(["act", "skip"]),
16
+ reason: z.string().max(280).optional(),
17
+ rationale: z.string().max(1000).optional(),
18
+ confidence: z.number().min(0).max(1).optional(),
19
+ actions: z
20
+ .array(z.discriminatedUnion("type", [
21
+ pmV2OpenActionSchema,
22
+ pmV2CloseActionSchema,
23
+ ]))
24
+ .max(1),
25
+ })
26
+ .strict()
27
+ .refine((value) => value.decision === "act"
28
+ ? value.actions.length === 1
29
+ : value.actions.length === 0);
30
+ export function parsePmPaperDecision(text) {
31
+ try {
32
+ const parsed = pmPaperDecisionSchema.safeParse(JSON.parse(text));
33
+ return parsed.success
34
+ ? { ok: true, decision: parsed.data }
35
+ : { ok: false, error: "invalid PM paper v2 decision" };
36
+ }
37
+ catch {
38
+ return { ok: false, error: "invalid PM paper v2 JSON" };
39
+ }
40
+ }
41
+ const decimal = {
42
+ type: "string",
43
+ pattern: "^(0|[1-9]\\d*)(\\.\\d{1,18})?$",
44
+ maxLength: 40,
45
+ };
46
+ export const PM_PAPER_DECISION_JSON_SCHEMA = {
47
+ type: "object",
48
+ additionalProperties: false,
49
+ required: ["decision", "actions"],
50
+ properties: {
51
+ decision: { type: "string", enum: ["act", "skip"] },
52
+ reason: { type: "string", maxLength: 280 },
53
+ rationale: { type: "string", maxLength: 1000 },
54
+ confidence: { type: "number", minimum: 0, maximum: 1 },
55
+ actions: {
56
+ type: "array",
57
+ maxItems: 1,
58
+ items: {
59
+ oneOf: [
60
+ {
61
+ type: "object",
62
+ additionalProperties: false,
63
+ required: [
64
+ "type",
65
+ "source",
66
+ "slug",
67
+ "outcomeExternalMarketId",
68
+ "side",
69
+ "maxCashBudget",
70
+ "forecastProbability",
71
+ ],
72
+ properties: {
73
+ type: { const: "pm_v2_open" },
74
+ source: { type: "string", enum: ["kalshi", "polymarket"] },
75
+ slug: { type: "string", minLength: 1, maxLength: 256 },
76
+ outcomeExternalMarketId: {
77
+ type: "string",
78
+ minLength: 1,
79
+ maxLength: 256,
80
+ },
81
+ side: { type: "string", enum: ["yes", "no"] },
82
+ maxCashBudget: decimal,
83
+ forecastProbability: decimal,
84
+ thesis: { type: ["string", "null"], maxLength: 280 },
85
+ },
86
+ },
87
+ {
88
+ type: "object",
89
+ additionalProperties: false,
90
+ required: ["type", "positionId"],
91
+ properties: {
92
+ type: { const: "pm_v2_close" },
93
+ positionId: { type: "integer", minimum: 1, maximum: 2147483647 },
94
+ detail: { type: ["string", "null"], maxLength: 1024 },
95
+ },
96
+ },
97
+ ],
98
+ },
99
+ },
100
+ },
101
+ };
@@ -0,0 +1,71 @@
1
+ import { z } from "zod";
2
+ export declare const pmHouseIdentitySchema: z.ZodObject<{
3
+ userId: z.ZodNumber;
4
+ apiKeyId: z.ZodNumber;
5
+ walletId: z.ZodNumber;
6
+ houseAgentId: z.ZodNumber;
7
+ }, "strict", z.ZodTypeAny, {
8
+ walletId: number;
9
+ userId: number;
10
+ apiKeyId: number;
11
+ houseAgentId: number;
12
+ }, {
13
+ walletId: number;
14
+ userId: number;
15
+ apiKeyId: number;
16
+ houseAgentId: number;
17
+ }>;
18
+ export declare const pmHousePolicySchema: z.ZodObject<{
19
+ userId: z.ZodNumber;
20
+ apiKeyId: z.ZodNumber;
21
+ walletId: z.ZodNumber;
22
+ houseAgentId: z.ZodNumber;
23
+ } & {
24
+ version: z.ZodLiteral<"pm_paper_house_v2">;
25
+ entryEnabled: z.ZodDefault<z.ZodBoolean>;
26
+ maxCashBudgetPerEntry: z.ZodEffects<z.ZodString, string, string>;
27
+ maxOpenPositions: z.ZodNumber;
28
+ maxEntriesPerDay: z.ZodNumber;
29
+ maxModelCallsPerHour: z.ZodDefault<z.ZodNumber>;
30
+ maxDailyLoss: z.ZodEffects<z.ZodString, string, string>;
31
+ discoveryQuery: z.ZodString;
32
+ maxEndDays: z.ZodOptional<z.ZodNumber>;
33
+ }, "strict", z.ZodTypeAny, {
34
+ version: "pm_paper_house_v2";
35
+ walletId: number;
36
+ userId: number;
37
+ apiKeyId: number;
38
+ houseAgentId: number;
39
+ entryEnabled: boolean;
40
+ maxCashBudgetPerEntry: string;
41
+ maxOpenPositions: number;
42
+ maxEntriesPerDay: number;
43
+ maxModelCallsPerHour: number;
44
+ maxDailyLoss: string;
45
+ discoveryQuery: string;
46
+ maxEndDays?: number | undefined;
47
+ }, {
48
+ version: "pm_paper_house_v2";
49
+ walletId: number;
50
+ userId: number;
51
+ apiKeyId: number;
52
+ houseAgentId: number;
53
+ maxCashBudgetPerEntry: string;
54
+ maxOpenPositions: number;
55
+ maxEntriesPerDay: number;
56
+ maxDailyLoss: string;
57
+ discoveryQuery: string;
58
+ entryEnabled?: boolean | undefined;
59
+ maxModelCallsPerHour?: number | undefined;
60
+ maxEndDays?: number | undefined;
61
+ }>;
62
+ export type PmHouseIdentity = z.infer<typeof pmHouseIdentitySchema>;
63
+ export type PmHousePolicy = z.infer<typeof pmHousePolicySchema>;
64
+ export declare const samePmHouse: (a: PmHouseIdentity, b: PmHouseIdentity) => boolean;
65
+ export declare function readPmHousePolicies(raw: string | undefined): readonly PmHousePolicy[];
66
+ export declare function selectPmHousePolicy(agent: {
67
+ id: number;
68
+ ownerUserId?: number | null;
69
+ isHouse?: boolean;
70
+ }, policies?: readonly PmHousePolicy[]): PmHousePolicy | undefined;
71
+ export declare function pmCashUnits(value: string): bigint;
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ import { pmPaperOpenSchema } from "../pmPaperV2.js";
3
+ const id = z.number().int().positive().max(2147483647);
4
+ export const pmHouseIdentitySchema = z
5
+ .object({ userId: id, apiKeyId: id, walletId: id, houseAgentId: id })
6
+ .strict();
7
+ export const pmHousePolicySchema = pmHouseIdentitySchema
8
+ .extend({
9
+ version: z.literal("pm_paper_house_v2"),
10
+ entryEnabled: z.boolean().default(false),
11
+ maxCashBudgetPerEntry: pmPaperOpenSchema.shape.maxCashBudget,
12
+ maxOpenPositions: z.number().int().min(1).max(20),
13
+ maxEntriesPerDay: z.number().int().min(1).max(100),
14
+ maxModelCallsPerHour: z.number().int().min(1).max(30).default(12),
15
+ maxDailyLoss: pmPaperOpenSchema.shape.maxCashBudget,
16
+ discoveryQuery: z.string().min(1).max(100),
17
+ maxEndDays: z.number().int().min(1).max(30).optional(),
18
+ })
19
+ .strict();
20
+ export const samePmHouse = (a, b) => a.userId === b.userId &&
21
+ a.apiKeyId === b.apiKeyId &&
22
+ a.walletId === b.walletId &&
23
+ a.houseAgentId === b.houseAgentId;
24
+ export function readPmHousePolicies(raw) {
25
+ if (raw === undefined || raw === "")
26
+ return [];
27
+ const policies = z.array(pmHousePolicySchema).max(10).parse(JSON.parse(raw));
28
+ if (new Set(policies.map((p) => p.houseAgentId)).size !== policies.length ||
29
+ new Set(policies.map((p) => p.apiKeyId)).size !== policies.length ||
30
+ new Set(policies.map((p) => p.walletId)).size !== policies.length)
31
+ throw new Error("Duplicate PM house policy identity");
32
+ return policies;
33
+ }
34
+ export function selectPmHousePolicy(agent, policies = []) {
35
+ if (agent.isHouse !== true)
36
+ return undefined;
37
+ return policies.find((p) => p.houseAgentId === agent.id && p.userId === agent.ownerUserId);
38
+ }
39
+ export function pmCashUnits(value) {
40
+ if (!/^-?(0|[1-9]\d*)(\.\d{1,18})?$/.test(value) || value.length > 41)
41
+ throw new Error("Invalid exact paper cash");
42
+ const negative = value.startsWith("-");
43
+ const [whole, fraction = ""] = (negative ? value.slice(1) : value).split(".");
44
+ const units = BigInt(whole) * 10n ** 18n + BigInt(fraction.padEnd(18, "0"));
45
+ return negative ? -units : units;
46
+ }
@@ -1,4 +1,4 @@
1
- import { AgentSpec, Observation, PmResolution, RunState } from "./types.js";
1
+ import { AgentSpec, Observation, PmResolution, RunState, LastRejection, type ObjectivePrimary, type OpenPosition } from "./types.js";
2
2
  import type { DecisionActionExclusion } from "./providerCapabilities.js";
3
3
  export interface DailyRiskBudget {
4
4
  version: "coinrithm.daily-risk-budget.v1";
@@ -19,10 +19,22 @@ export interface FuturesCapacity {
19
19
  }
20
20
  export declare function buildFuturesCapacity(spec: AgentSpec, obs: Pick<Observation, "openPositions">): FuturesCapacity;
21
21
  export declare function formatPmResolutions(resolutions: PmResolution[]): string[];
22
+ export declare const OBJECTIVE_GUIDANCE: Record<ObjectivePrimary, string>;
23
+ export declare function objectiveLine(spec: Pick<AgentSpec, "objective">): string | null;
22
24
  export declare function buildSystemPrompt(spec: AgentSpec, mergedProse: string, opts?: {
23
25
  includeForecast?: boolean;
24
26
  excludeActionTypes?: readonly DecisionActionExclusion[];
25
27
  }): string;
28
+ /**
29
+ * Per-position stop-loss side of the mark for futures_set_sltp. Live
30
+ * 2026-10-08: 473 stop_loss_not_above/below_mark refusals in 24 h, nearly all
31
+ * agents moving a short's stop to its entry price or trailing it when the
32
+ * mark was already at or past that level. States only the observed-mark
33
+ * constraint the validator applies (pos.markPrice, TRIGGER_PRICE_EPS); the
34
+ * take-profit side, liquidation and every other check stay authoritative.
35
+ * Prices print unrounded so the text never contradicts the validator.
36
+ */
37
+ export declare function stopBoundLines(positions: readonly OpenPosition[]): string[];
26
38
  export declare function buildUserPrompt(obs: Observation, journal?: Array<{
27
39
  at: string;
28
40
  did: string;
@@ -31,5 +43,7 @@ export declare function buildUserPrompt(obs: Observation, journal?: Array<{
31
43
  dailyRiskBudget?: DailyRiskBudget;
32
44
  capitalSizing?: AgentSpec["capitalSizing"];
33
45
  futuresCapacity?: FuturesCapacity;
46
+ compactTables?: boolean;
34
47
  excludeActionTypes?: readonly DecisionActionExclusion[];
48
+ lastRejections?: readonly LastRejection[];
35
49
  }): string;