@modelprofile.com/flexharness 10.24.0 → 10.24.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.
Files changed (69) hide show
  1. package/dist_ts/00_commitinfo_data.js +1 -1
  2. package/dist_ts/classes.flexharness.admission.d.ts +17 -0
  3. package/dist_ts/classes.flexharness.admission.js +263 -0
  4. package/dist_ts/classes.flexharness.callbacks.d.ts +38 -0
  5. package/dist_ts/classes.flexharness.callbacks.js +313 -0
  6. package/dist_ts/classes.flexharness.compaction.d.ts +25 -0
  7. package/dist_ts/classes.flexharness.compaction.js +87 -0
  8. package/dist_ts/classes.flexharness.configurations.d.ts +11 -0
  9. package/dist_ts/classes.flexharness.configurations.js +137 -0
  10. package/dist_ts/classes.flexharness.core.d.ts +143 -0
  11. package/dist_ts/classes.flexharness.core.js +1538 -0
  12. package/dist_ts/classes.flexharness.d.ts +2 -437
  13. package/dist_ts/classes.flexharness.deletion.d.ts +31 -0
  14. package/dist_ts/classes.flexharness.deletion.js +396 -0
  15. package/dist_ts/classes.flexharness.imports.d.ts +24 -0
  16. package/dist_ts/classes.flexharness.imports.js +345 -0
  17. package/dist_ts/classes.flexharness.js +119 -9776
  18. package/dist_ts/classes.flexharness.lifecycle.d.ts +47 -0
  19. package/dist_ts/classes.flexharness.lifecycle.js +625 -0
  20. package/dist_ts/classes.flexharness.permissions.d.ts +19 -0
  21. package/dist_ts/classes.flexharness.permissions.js +450 -0
  22. package/dist_ts/classes.flexharness.projects.d.ts +55 -0
  23. package/dist_ts/classes.flexharness.projects.js +575 -0
  24. package/dist_ts/classes.flexharness.prompts.d.ts +44 -0
  25. package/dist_ts/classes.flexharness.prompts.js +659 -0
  26. package/dist_ts/classes.flexharness.providers.d.ts +18 -0
  27. package/dist_ts/classes.flexharness.providers.js +267 -0
  28. package/dist_ts/classes.flexharness.results.d.ts +26 -0
  29. package/dist_ts/classes.flexharness.results.js +89 -0
  30. package/dist_ts/classes.flexharness.reversions.d.ts +52 -0
  31. package/dist_ts/classes.flexharness.reversions.js +1306 -0
  32. package/dist_ts/classes.flexharness.runs.d.ts +63 -0
  33. package/dist_ts/classes.flexharness.runs.js +1058 -0
  34. package/dist_ts/classes.flexharness.sessions.d.ts +20 -0
  35. package/dist_ts/classes.flexharness.sessions.js +381 -0
  36. package/dist_ts/classes.flexharness.slashcommands.d.ts +40 -0
  37. package/dist_ts/classes.flexharness.slashcommands.js +458 -0
  38. package/dist_ts/classes.flexharness.subagents.d.ts +31 -0
  39. package/dist_ts/classes.flexharness.subagents.js +690 -0
  40. package/dist_ts/classes.flexharness.tooldispatch.d.ts +53 -0
  41. package/dist_ts/classes.flexharness.tooldispatch.js +418 -0
  42. package/dist_ts/interfaces.flexharness.d.ts +455 -0
  43. package/dist_ts/interfaces.flexharness.js +2 -0
  44. package/dist_ts/utils.flexharness.d.ts +19 -0
  45. package/dist_ts/utils.flexharness.js +83 -0
  46. package/package.json +3 -3
  47. package/ts/00_commitinfo_data.ts +1 -1
  48. package/ts/classes.flexharness.admission.ts +331 -0
  49. package/ts/classes.flexharness.callbacks.ts +352 -0
  50. package/ts/classes.flexharness.compaction.ts +167 -0
  51. package/ts/classes.flexharness.configurations.ts +167 -0
  52. package/ts/classes.flexharness.core.ts +1830 -0
  53. package/ts/classes.flexharness.deletion.ts +616 -0
  54. package/ts/classes.flexharness.imports.ts +414 -0
  55. package/ts/classes.flexharness.lifecycle.ts +786 -0
  56. package/ts/classes.flexharness.permissions.ts +535 -0
  57. package/ts/classes.flexharness.projects.ts +1006 -0
  58. package/ts/classes.flexharness.prompts.ts +857 -0
  59. package/ts/classes.flexharness.providers.ts +322 -0
  60. package/ts/classes.flexharness.results.ts +98 -0
  61. package/ts/classes.flexharness.reversions.ts +1684 -0
  62. package/ts/classes.flexharness.runs.ts +1204 -0
  63. package/ts/classes.flexharness.sessions.ts +483 -0
  64. package/ts/classes.flexharness.slashcommands.ts +705 -0
  65. package/ts/classes.flexharness.subagents.ts +860 -0
  66. package/ts/classes.flexharness.tooldispatch.ts +475 -0
  67. package/ts/classes.flexharness.ts +147 -12567
  68. package/ts/interfaces.flexharness.ts +517 -0
  69. package/ts/utils.flexharness.ts +121 -0
@@ -0,0 +1,63 @@
1
+ import * as plugins from './plugins.js';
2
+ import { FlexHarnessAbortError } from './errors.js';
3
+ import { type IFlexAgentContextInvocation, type IFlexMessage, type IFlexPromptOptions, type IFlexPromptResult, type IFlexTerminalProjection, type TFlexAgentToolSet } from './interfaces.js';
4
+ import type { INormalizedFlexPrompt } from './utils.prompt.js';
5
+ import type { IStoredSessionState, IStorageState, IActiveRun, IRunSteering, IRunSteeringOutcome, IQueuedPrompt } from './interfaces.flexharness.js';
6
+ import type { FlexHarnessCore } from './classes.flexharness.core.js';
7
+ /** The run execution engine: generations, terminal outcomes, steering and cancellation. */
8
+ export declare class FlexHarnessRuns<TScope> {
9
+ private readonly core;
10
+ constructor(core: FlexHarnessCore<TScope>);
11
+ abort(scopeId: string, sessionId: string): Promise<boolean>;
12
+ createActiveRun(queued: IQueuedPrompt): IActiveRun;
13
+ executeRun(run: IActiveRun, generation: Promise<plugins.IAgentGenerateResult>): Promise<IFlexPromptResult>;
14
+ private finishFailedRun;
15
+ prepareGeneration(run: IActiveRun, options: IFlexPromptOptions, signal: AbortSignal): Promise<plugins.IAgentGenerationLease>;
16
+ enabledBuiltInToolNames(run: IActiveRun): Set<string>;
17
+ assertNoBuiltInToolCollisions(run: IActiveRun, tools: TFlexAgentToolSet): void;
18
+ private createBuiltInTools;
19
+ private createRenameSessionTool;
20
+ abortExactRun(state: IStorageState, sessionId: string, runId: string, reason: unknown): boolean;
21
+ createReservation(run: IActiveRun, prompt: INormalizedFlexPrompt): {
22
+ userMessage: IFlexMessage;
23
+ assistantMessage: IFlexMessage;
24
+ };
25
+ private userMessageParts;
26
+ /**
27
+ * Ends steering intake once the run's generation has settled and fixes what became of its
28
+ * steers. A run that stays in the model context reports the steers its generation did not
29
+ * record; a run that does not, because it failed, was stopped before any model output or its
30
+ * outcome could not be established, reports every steer it accepted, since the model context
31
+ * of later turns holds none of them. The bytes of the steers not taken in are released.
32
+ */
33
+ closeRunSteering(steering: IRunSteering): IRunSteeringOutcome;
34
+ /**
35
+ * Projects a steer the run's generation took in as a user message of the run. The assistant
36
+ * message that answered before it is completed and the run answers on in a new one; a steer
37
+ * taken in before the run answered anything is placed before its still empty assistant message.
38
+ */
39
+ applyRunSteer(run: IActiveRun, applied: plugins.IAgentAppliedInput): Promise<void>;
40
+ private buildTerminal;
41
+ private promoteCompletedTerminal;
42
+ private publishFailedTerminal;
43
+ private replaceStagedTerminal;
44
+ /**
45
+ * Puts a run's terminal messages in place of their projected versions: its prompt, and its last
46
+ * assistant message. The steers a run took in, and the assistant messages it completed before
47
+ * them, stay where they are. A terminal message that is not projected yet is added: the prompt
48
+ * before the run's other messages, the assistant message after them.
49
+ */
50
+ replaceVisibleRun(stored: IStoredSessionState, terminal: IFlexTerminalProjection): void;
51
+ private emitTerminalProjection;
52
+ /**
53
+ * Ends a run that fails without publishing a terminal projection, because its namespace was
54
+ * fenced or retired or its durable outcome could not be established: listeners still receive
55
+ * its terminal message events and its one `run.finished`. Nothing here is persisted; the next
56
+ * load of the namespace repairs the stored projection from the canonical outcome.
57
+ */
58
+ private emitUnpublishedRunFinish;
59
+ private emitFinalRunEvent;
60
+ cancelRun(run: IActiveRun, reason: FlexHarnessAbortError, context?: IFlexAgentContextInvocation<TScope>): void;
61
+ abortRunInternally(run: IActiveRun, error: unknown, context?: IFlexAgentContextInvocation<TScope>): void;
62
+ rollbackAdmission(run: IActiveRun, projectionReserved: boolean, originalError: Error): Promise<unknown[]>;
63
+ }