@mmon-co/ncept-local 0.1.0 → 0.3.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.
@@ -1,17 +1,56 @@
1
- import { type LessonProgress, type Mission, type ModeEntry, type NodeId, type PatchContent, type SessionMode, type Theory } from "@mmon-co/ncept-core";
2
- import type { Host, HostChatSetup, HostConfig, HostSession, MissionReading, ModeSwitch, OpenHostOptions } from "./host.js";
1
+ import { type LessonProgress, type LessonReading, type Mission, type ModeEntry, type NodeId, type PatchContent, type SessionMode, type Theory } from "@mmon-co/ncept-core";
2
+ import type { Host, HostChatSetup, HostConfig, HostSession, MissionReading, ModeSwitch, OpenHostOptions, SessionOpening, SessionIntent } from "./host.js";
3
3
  import { Runtime, type LocalSession } from "./runtime.js";
4
+ /** Read current learning state without day processing, receipts, configuration writes or model calls. */
5
+ export declare function openLearningReader<S>(profileDir: string, theories: readonly Theory<S>[]): Promise<{
6
+ reading(): Promise<{
7
+ missions: readonly MissionReading[];
8
+ nodes: {
9
+ id: `node-${string}`;
10
+ label: string;
11
+ status: "open" | "done" | "tentative";
12
+ frontier: boolean;
13
+ }[];
14
+ edges: {
15
+ from: `node-${string}`;
16
+ to: `node-${string}`;
17
+ }[];
18
+ dueReview: {
19
+ id: `node-${string}`;
20
+ label: string;
21
+ }[];
22
+ sessions: {
23
+ title: string;
24
+ missionLabel: string | undefined;
25
+ nodes: {
26
+ id: `node-${string}`;
27
+ label: string;
28
+ }[];
29
+ surface: import("@mmon-co/ncept-core").SurfaceId;
30
+ about: readonly NodeId[];
31
+ closed: boolean;
32
+ closing?: string;
33
+ mission?: string;
34
+ parent?: string;
35
+ id: import("@mmon-co/ncept-core").SessionRef;
36
+ mode: string;
37
+ entry?: ModeEntry;
38
+ }[];
39
+ }>;
40
+ }>;
4
41
  /** Owns execution serialization; the front end owns pi's conversation and transcript writer. */
5
42
  export declare class LearningHost<S> {
6
43
  readonly runtime: Runtime<S>;
7
44
  readonly confirm: OpenHostOptions<S>["confirm"];
45
+ readonly onCloseError: (error: unknown) => void;
8
46
  private tail;
9
47
  private pendingSwitch?;
48
+ private readonly closeJobs;
10
49
  readonly drafts: Map<string, {
11
50
  base: string;
12
51
  content: PatchContent;
13
52
  }>;
14
- constructor(runtime: Runtime<S>, confirm: OpenHostOptions<S>["confirm"]);
53
+ constructor(runtime: Runtime<S>, confirm: OpenHostOptions<S>["confirm"], onCloseError?: (error: unknown) => void);
15
54
  serial<T>(operation: () => Promise<T>): Promise<T>;
16
55
  reload(): Promise<void>;
17
56
  current(session: HostSession): Promise<LocalSession>;
@@ -24,14 +63,14 @@ export declare class LearningHost<S> {
24
63
  }>;
25
64
  reviseMission(mission: Mission, create: boolean): Promise<void>;
26
65
  private closing;
27
- private closingRun;
28
- close(session: HostSession): Promise<void>;
66
+ private markClosing;
67
+ private endingRun;
68
+ end(session: HostSession): Promise<void>;
69
+ closePending(): Promise<void>;
70
+ settle(session: HostSession): Promise<ModeSwitch | undefined>;
29
71
  retireMission(id: string, outcome: "achieved" | "abandoned"): Promise<void>;
30
- open(input: {
31
- mode: string;
32
- entry?: ModeEntry;
33
- resume?: string;
34
- }): Promise<HostSession>;
72
+ begin(intent: SessionIntent): Promise<HostSession>;
73
+ open(input: SessionOpening): Promise<HostSession>;
35
74
  switchMode(session: LocalSession, to: ModeSwitch): Promise<void>;
36
75
  context(session: LocalSession): Promise<{
37
76
  missions: {
@@ -42,13 +81,13 @@ export declare class LearningHost<S> {
42
81
  targets: `node-${string}`[];
43
82
  priority: number;
44
83
  run: {
45
- next: readonly import("@mmon-co/ncept-core").LessonReading[];
84
+ next: readonly LessonReading[];
46
85
  active: import("@mmon-co/ncept-core").SessionRef | null;
86
+ past: readonly import("@mmon-co/ncept-core").PastEntry[];
47
87
  retired?: Readonly<{
48
88
  outcome: "achieved" | "abandoned";
49
89
  at: string;
50
90
  }>;
51
- past: readonly import("@mmon-co/ncept-core").PastEntry[];
52
91
  asides: readonly import("@mmon-co/ncept-core").SessionRef[];
53
92
  };
54
93
  }[];
@@ -62,6 +101,9 @@ export declare class LearningHost<S> {
62
101
  about: readonly NodeId[];
63
102
  unscopedNodes?: readonly NodeId[];
64
103
  tutorMessages?: readonly string[];
104
+ opening?: Readonly<{
105
+ latestLearnerMessage?: string;
106
+ }>;
65
107
  sessionObservations?: readonly import("@mmon-co/ncept-core").ObservationId[];
66
108
  lessonActivities?: readonly import("@mmon-co/ncept-core").LessonActivity[];
67
109
  sessionMinutes?: number;