skillwiki 0.10.49 → 0.10.51

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.
@@ -73,6 +73,64 @@ function err(error, detail) {
73
73
  return detail === void 0 ? { ok: false, error } : { ok: false, error, detail };
74
74
  }
75
75
 
76
+ // ../shared/src/session-kind.ts
77
+ function resolveSessionKind(input = {}) {
78
+ const env = input.env ?? {};
79
+ const evidence = [];
80
+ const hasSatellite = Boolean(input.satelliteHostId || input.maintenanceMode || env.SKILLWIKI_MAINTENANCE_HOST);
81
+ if (hasSatellite) {
82
+ if (input.satelliteHostId) evidence.push(`satelliteHostId:${input.satelliteHostId}`);
83
+ if (input.maintenanceMode) evidence.push(`maintenanceMode:${input.maintenanceMode}`);
84
+ if (env.SKILLWIKI_MAINTENANCE_HOST) evidence.push("env:SKILLWIKI_MAINTENANCE_HOST");
85
+ return ok({
86
+ kind: "satellite",
87
+ mayPrompt: false,
88
+ defaultPolicy: "profile-allowed-or-fail",
89
+ defaultSourceRequired: true,
90
+ reason: "scheduled or host-scoped satellite maintenance must not prompt",
91
+ evidence
92
+ });
93
+ }
94
+ if (input.nonInteractiveGoal || input.goalContext) {
95
+ if (input.nonInteractiveGoal) evidence.push("nonInteractiveGoal");
96
+ if (input.goalContext) evidence.push("goalContext");
97
+ return ok({
98
+ kind: "goal",
99
+ mayPrompt: false,
100
+ defaultPolicy: "automation-ready-or-skip",
101
+ defaultSourceRequired: true,
102
+ reason: "/goal continuation must not prompt",
103
+ evidence
104
+ });
105
+ }
106
+ const headlessSignals = [
107
+ input.spawned ? "spawned" : "",
108
+ input.noTty ? "noTty" : "",
109
+ input.codexExec ? "codexExec" : "",
110
+ env.CI ? "env:CI" : "",
111
+ env.OPENCLAW_SESSION ? "env:OPENCLAW_SESSION" : "",
112
+ env.SPAWNED_SESSION ? "env:SPAWNED_SESSION" : ""
113
+ ].filter(Boolean);
114
+ if (headlessSignals.length > 0) {
115
+ return ok({
116
+ kind: "headless",
117
+ mayPrompt: false,
118
+ defaultPolicy: "recorded-defaults-or-fail",
119
+ defaultSourceRequired: true,
120
+ reason: "headless or spawned execution must not prompt",
121
+ evidence: headlessSignals
122
+ });
123
+ }
124
+ return ok({
125
+ kind: "interactive",
126
+ mayPrompt: true,
127
+ defaultPolicy: "prompt",
128
+ defaultSourceRequired: false,
129
+ reason: "no non-interactive evidence detected",
130
+ evidence
131
+ });
132
+ }
133
+
76
134
  // ../shared/src/schemas.ts
77
135
  import { isAbsolute } from "path";
78
136
  import { z } from "zod";
@@ -703,6 +761,7 @@ export {
703
761
  detectSchema,
704
762
  isBlockedHost,
705
763
  getErrorMessage,
764
+ resolveSessionKind,
706
765
  systemdPropertyFor,
707
766
  splitFrontmatter,
708
767
  extractFrontmatter,
@@ -3,11 +3,11 @@ import {
3
3
  ROOT_INDEX_SECTION_ORDER,
4
4
  atomicWriteText,
5
5
  buildRootIndexUniverse
6
- } from "./chunk-UHZBOOMK.js";
6
+ } from "./chunk-74OSLCXE.js";
7
7
  import {
8
8
  err,
9
9
  ok
10
- } from "./chunk-EVQASYII.js";
10
+ } from "./chunk-IJ7DD7QZ.js";
11
11
 
12
12
  // src/utils/index-projection.ts
13
13
  import { readFile } from "fs/promises";