@gencode/shared 0.1.2 → 0.2.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.
- package/CHANGELOG.md +19 -0
- package/dist/agent-progress.d.ts +18 -1
- package/dist/agent-progress.d.ts.map +1 -1
- package/dist/agent-progress.js.map +1 -1
- package/dist/goal.d.ts +50 -0
- package/dist/goal.d.ts.map +1 -0
- package/dist/goal.js +11 -0
- package/dist/goal.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/session.d.ts +9 -0
- package/dist/session.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @gencode/shared
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ace4220: Add thread goal audit events, live goal status updates, and objective-change steering across the goal control flow.
|
|
8
|
+
- 7cd5fcc: Add persisted thread goals with CLI controls, automatic continuation, and goal status reporting across sessions.
|
|
9
|
+
|
|
10
|
+
## Unreleased
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Add `AgentModelRequestEvent` (`type: "model_request"`) to shared progress event types and re-export it from package index.
|
|
15
|
+
|
|
16
|
+
## 0.1.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Align the package changelog with the current published version after versioning.
|
|
21
|
+
|
|
3
22
|
## 0.1.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/agent-progress.d.ts
CHANGED
|
@@ -11,6 +11,18 @@ export type AgentCustomProgressEvent = AgentProgressEventBase & {
|
|
|
11
11
|
label?: string;
|
|
12
12
|
data?: Record<string, unknown>;
|
|
13
13
|
};
|
|
14
|
+
export type AgentModelRequestEvent = AgentProgressEventBase & {
|
|
15
|
+
type: "model_request";
|
|
16
|
+
model: string;
|
|
17
|
+
provider: string;
|
|
18
|
+
systemPrompt: string;
|
|
19
|
+
tools: Array<{
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
parameters?: unknown;
|
|
23
|
+
}>;
|
|
24
|
+
requestJson: unknown;
|
|
25
|
+
};
|
|
14
26
|
export type AgentDiagnosticLevel = "info" | "warn" | "error";
|
|
15
27
|
export type AgentDiagnosticScope = "runner" | "session" | "plugin" | "skill" | "memory" | "tool";
|
|
16
28
|
export type AgentDiagnosticEvent = AgentProgressEventBase & {
|
|
@@ -71,7 +83,7 @@ export type AgentProgressEvent = (AgentProgressEventBase & {
|
|
|
71
83
|
skillName: string;
|
|
72
84
|
agent: string;
|
|
73
85
|
taskId: string;
|
|
74
|
-
}) | AgentCustomProgressEvent | (AgentProgressEventBase & {
|
|
86
|
+
}) | AgentCustomProgressEvent | AgentModelRequestEvent | (AgentProgressEventBase & {
|
|
75
87
|
type: "error";
|
|
76
88
|
message: string;
|
|
77
89
|
}) | (AgentProgressEventBase & {
|
|
@@ -102,6 +114,11 @@ export type AgentProgressEvent = (AgentProgressEventBase & {
|
|
|
102
114
|
}) | (AgentProgressEventBase & {
|
|
103
115
|
type: "title_updated";
|
|
104
116
|
title: string;
|
|
117
|
+
}) | (AgentProgressEventBase & {
|
|
118
|
+
type: "goal_updated";
|
|
119
|
+
action: string;
|
|
120
|
+
goalId?: string;
|
|
121
|
+
goalStatus: import("./goal.js").GoalStatus | null;
|
|
105
122
|
}) | (AgentProgressEventBase & {
|
|
106
123
|
type: "ui_tool_request";
|
|
107
124
|
request: import("./ui-tool.js").UiToolRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-progress.d.ts","sourceRoot":"","sources":["../src/agent-progress.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,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CAAC,sBAAsB,GAAG;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,OAAO,cAAc,EAAE,aAAa,CAAC;CAC/C,CAAC,GACA,CAAC,sBAAsB,GAAG;IAC1B,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC,GACA,oBAAoB,CAAC;AAEzB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,IAAI,oBAAoB,CAE/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-progress.js","sourceRoot":"","sources":["../src/agent-progress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-progress.js","sourceRoot":"","sources":["../src/agent-progress.ts"],"names":[],"mappings":"AA8IA,MAAM,UAAU,sBAAsB,CAAC,KAAyB;IAC9D,OAAO,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;AACrC,CAAC"}
|
package/dist/goal.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thread Goal types for @gencode/shared.
|
|
3
|
+
*
|
|
4
|
+
* Defines the cross-package contract for the lightweight thread goal system.
|
|
5
|
+
* See source/执行约束.md and artifacts/实现计划.md for design rationale.
|
|
6
|
+
*/
|
|
7
|
+
/** Maximum characters for inline objective in goal.json */
|
|
8
|
+
export declare const MAX_GOAL_OBJECTIVE_CHARS = 4000;
|
|
9
|
+
/** Maximum continuations per single runAgent call */
|
|
10
|
+
export declare const MAX_GOAL_CONTINUATIONS_PER_RUN = 3;
|
|
11
|
+
/**
|
|
12
|
+
* Goal status enumeration.
|
|
13
|
+
*
|
|
14
|
+
* - `active`: Being pursued; continuation turns are eligible.
|
|
15
|
+
* - `paused`: Suspended by user or system (e.g. interrupt, limit reached).
|
|
16
|
+
* - `budget_limited`: Token budget exhausted; system-steered wrap-up.
|
|
17
|
+
* - `complete`: Declared finished via model `update_goal(status=complete)`.
|
|
18
|
+
*/
|
|
19
|
+
export type GoalStatus = "active" | "paused" | "budget_limited" | "complete";
|
|
20
|
+
/**
|
|
21
|
+
* Persisted thread goal record.
|
|
22
|
+
*
|
|
23
|
+
* Stored as `{sessionDir}/goal.json`. The `objective` field is the canonical
|
|
24
|
+
* source of truth for what the model is asked to pursue. When the objective
|
|
25
|
+
* exceeds MAX_GOAL_OBJECTIVE_CHARS, the full text is stored in an adjacent
|
|
26
|
+
* `goal-objective.md` file and `objectiveRef` points to it.
|
|
27
|
+
*/
|
|
28
|
+
export interface ThreadGoal {
|
|
29
|
+
/** UUID v4; replaced on each set or replace. */
|
|
30
|
+
goalId: string;
|
|
31
|
+
/** Inline objective text (≤4000 chars) or summary when objectiveRef is set. */
|
|
32
|
+
objective: string;
|
|
33
|
+
/** Relative path to `goal-objective.md` for objectives > MAX_GOAL_OBJECTIVE_CHARS. */
|
|
34
|
+
objectiveRef?: string;
|
|
35
|
+
/** Current status. */
|
|
36
|
+
status: GoalStatus;
|
|
37
|
+
/** Optional positive token budget; null means unlimited. */
|
|
38
|
+
tokenBudget: number | null;
|
|
39
|
+
/** Cumulative token consumption (non-cached input + output). */
|
|
40
|
+
tokensUsed: number;
|
|
41
|
+
/** Cumulative wall-clock seconds since goal creation (best-effort). */
|
|
42
|
+
timeUsedSeconds: number;
|
|
43
|
+
/** ISO 8601 creation timestamp. */
|
|
44
|
+
createdAt: string;
|
|
45
|
+
/** ISO 8601 last-updated timestamp. */
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
/** When true, runner injects one objective-updated steering turn then clears. */
|
|
48
|
+
pendingObjectiveUpdatedNotice?: boolean;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=goal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal.d.ts","sourceRoot":"","sources":["../src/goal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,eAAe,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC"}
|
package/dist/goal.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thread Goal types for @gencode/shared.
|
|
3
|
+
*
|
|
4
|
+
* Defines the cross-package contract for the lightweight thread goal system.
|
|
5
|
+
* See source/执行约束.md and artifacts/实现计划.md for design rationale.
|
|
6
|
+
*/
|
|
7
|
+
/** Maximum characters for inline objective in goal.json */
|
|
8
|
+
export const MAX_GOAL_OBJECTIVE_CHARS = 4000;
|
|
9
|
+
/** Maximum continuations per single runAgent call */
|
|
10
|
+
export const MAX_GOAL_CONTINUATIONS_PER_RUN = 3;
|
|
11
|
+
//# sourceMappingURL=goal.js.map
|
package/dist/goal.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal.js","sourceRoot":"","sources":["../src/goal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,qDAAqD;AACrD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { isAgentDiagnosticEvent } from "./agent-progress.js";
|
|
5
5
|
export { formatTaskForDisplay } from "./task-display.js";
|
|
6
|
-
export type { AgentCustomProgressEvent, AgentDiagnosticEvent, AgentDiagnosticLevel, AgentDiagnosticScope, AgentProgressEvent, AgentProgressEventBase, } from "./agent-progress.js";
|
|
6
|
+
export type { AgentCustomProgressEvent, AgentModelRequestEvent, AgentDiagnosticEvent, AgentDiagnosticLevel, AgentDiagnosticScope, AgentProgressEvent, AgentProgressEventBase, } from "./agent-progress.js";
|
|
7
7
|
export type { CallbackEventPayload, Channel, RunResultPayload, StreamEnvelope, StreamEventName, } from "./run-events.js";
|
|
8
8
|
export type { SessionMetadata, SessionSummary } from "./session.js";
|
|
9
9
|
export type { CollapseSpan, CompressionLayer, ContextCompactionState, ModelUsageCheckpoint, ReadStateRecord, SessionMemorySnapshot, SessionContextSnapshot, SnipRecord, ToolResultReference, ToolResultBudgetRecord, } from "./context-protocol.js";
|
|
10
|
+
export { MAX_GOAL_OBJECTIVE_CHARS, MAX_GOAL_CONTINUATIONS_PER_RUN } from "./goal.js";
|
|
11
|
+
export type { GoalStatus, ThreadGoal } from "./goal.js";
|
|
10
12
|
export { isHitlPending, isHitlResolved, isHitlExpired, isHitlTool, HITL_TOOL_NAMES, parseMatchedTextToResolution, parseTextToResolution, } from "./hitl.js";
|
|
11
13
|
export type { HitlKind, HitlChoice, HitlChoiceInput, HitlTextInput, HitlFormInput, HitlInputSchema, HitlPreview, HitlPolicy, HitlRequest, HitlResolution, HitlCheckpointPhase, HitlCheckpoint, HitlToolContext, HitlStatus, PausedRunState, HitlHistoryEntry, } from "./hitl.js";
|
|
12
14
|
export { validateUiToolResult } from "./ui-tool.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,oBAAoB,EACpB,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,QAAQ,EACR,UAAU,EACV,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,UAAU,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,WAAW,EACX,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,oBAAoB,EACpB,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,QAAQ,EACR,UAAU,EACV,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,UAAU,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,WAAW,EACX,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { isAgentDiagnosticEvent } from "./agent-progress.js";
|
|
5
5
|
export { formatTaskForDisplay } from "./task-display.js";
|
|
6
|
+
// Goal types — thread goal data model
|
|
7
|
+
export { MAX_GOAL_OBJECTIVE_CHARS, MAX_GOAL_CONTINUATIONS_PER_RUN } from "./goal.js";
|
|
6
8
|
// HITL protocol types
|
|
7
9
|
export { isHitlPending, isHitlResolved, isHitlExpired, isHitlTool, HITL_TOOL_NAMES, parseMatchedTextToResolution, parseTextToResolution, } from "./hitl.js";
|
|
8
10
|
// UI Tool protocol types
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AA+BzD,sCAAsC;AACtC,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAGrF,sBAAsB;AACtB,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,eAAe,EACf,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,WAAW,CAAC;AAoBnB,yBAAyB;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/session.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { Channel } from "./run-events.js";
|
|
2
|
+
import type { GoalStatus } from "./goal.js";
|
|
2
3
|
/**
|
|
3
4
|
* Stable cross-package session summary shape.
|
|
4
5
|
*
|
|
5
6
|
* This type is intended for list / query / display scenarios shared across
|
|
6
7
|
* packages such as agents, cli, and future web integrations.
|
|
8
|
+
*
|
|
9
|
+
* Includes optional `goalStatus` mirror so that `sessions list` can display
|
|
10
|
+
* a GOAL column without reading every `goal.json` file.
|
|
7
11
|
*/
|
|
8
12
|
export type SessionSummary = {
|
|
9
13
|
id: string;
|
|
@@ -11,12 +15,16 @@ export type SessionSummary = {
|
|
|
11
15
|
channel: Channel;
|
|
12
16
|
createdAt: string;
|
|
13
17
|
updatedAt: string;
|
|
18
|
+
goalStatus?: GoalStatus | null;
|
|
14
19
|
};
|
|
15
20
|
/**
|
|
16
21
|
* Stable cross-package session metadata record.
|
|
17
22
|
*
|
|
18
23
|
* This type represents the canonical persisted metadata envelope for a session
|
|
19
24
|
* without including transcript, context snapshot, or export-specific payloads.
|
|
25
|
+
*
|
|
26
|
+
* The `goalStatus` field is a **mirror** (not source of truth) of the active
|
|
27
|
+
* goal status stored in `goal.json`. It is kept in sync by the goal-store.
|
|
20
28
|
*/
|
|
21
29
|
export type SessionMetadata = {
|
|
22
30
|
id: string;
|
|
@@ -24,5 +32,6 @@ export type SessionMetadata = {
|
|
|
24
32
|
channel: Channel;
|
|
25
33
|
createdAt: string;
|
|
26
34
|
updatedAt: string;
|
|
35
|
+
goalStatus?: GoalStatus | null;
|
|
27
36
|
};
|
|
28
37
|
//# sourceMappingURL=session.d.ts.map
|
package/dist/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAChC,CAAC"}
|