@pasko70/pibo 2.5.0 → 2.5.2

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.
@@ -11,7 +11,7 @@
11
11
  <link rel="manifest" href="/apps/chat/manifest.webmanifest" />
12
12
  <link rel="apple-touch-icon" href="/apps/chat/assets/pwa-images/ios/180.png" />
13
13
  <title>Pibo Web Chat</title>
14
- <script type="module" crossorigin src="/apps/chat/assets/index-BW5XFgYP.js"></script>
14
+ <script type="module" crossorigin src="/apps/chat/assets/index-DsgTm1Aw.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/apps/chat/assets/dist-CqM4On9D.js">
16
16
  <link rel="modulepreload" crossorigin href="/apps/chat/assets/dist-DLJCGrGQ.js">
17
17
  <link rel="modulepreload" crossorigin href="/apps/chat/assets/dist-S3zJGntM.js">
@@ -17,6 +17,7 @@ function cloneSubagentProfile(subagent) {
17
17
  return {
18
18
  ...subagent,
19
19
  ...(subagent.model ? { model: { ...subagent.model } } : {}),
20
+ ...(subagent.runtimeOptions ? { runtimeOptions: structuredClone(subagent.runtimeOptions) } : {}),
20
21
  };
21
22
  }
22
23
  export class InitialSessionContext {
@@ -52,6 +52,12 @@ export function resolvePiboSessionInitialFastMode(session) {
52
52
  const value = session.metadata?.initialFastMode;
53
53
  return typeof value === "boolean" ? value : undefined;
54
54
  }
55
+ export function resolvePiboSessionInitialRuntimeOptions(session) {
56
+ const value = session.metadata?.initialRuntimeOptions;
57
+ return value && typeof value === "object" && !Array.isArray(value)
58
+ ? structuredClone(value)
59
+ : undefined;
60
+ }
55
61
  function hasReachedSubagentMaxDepth(subagent, depth) {
56
62
  return depth >= (subagent.maxDepth ?? DEFAULT_SUBAGENT_MAX_DEPTH);
57
63
  }
@@ -72,12 +78,14 @@ function subagentAbortError() {
72
78
  function subagentRequestEventKey(piboSessionId, eventId) {
73
79
  return `${piboSessionId}\u0000${eventId}`;
74
80
  }
75
- function profileForSession(baseProfile, runtimeInstanceId, nativeSessionId, parentNativeSessionId, subagentDepth) {
81
+ function profileForSession(baseProfile, runtimeInstanceId, nativeSessionId, parentNativeSessionId, subagentDepth, runtimeOptionsOverride) {
76
82
  const usesProfileRuntime = baseProfile.runtimeInstanceId === runtimeInstanceId;
77
83
  const options = {
78
84
  profileName: baseProfile.profileName,
79
85
  runtimeInstanceId,
80
- runtimeOptions: usesProfileRuntime ? baseProfile.runtimeOptions : {},
86
+ runtimeOptions: usesProfileRuntime
87
+ ? { ...baseProfile.runtimeOptions, ...runtimeOptionsOverride }
88
+ : {},
81
89
  sessionId: nativeSessionId,
82
90
  parentSessionId: parentNativeSessionId,
83
91
  model: usesProfileRuntime ? baseProfile.model : undefined,
@@ -700,7 +708,7 @@ export class PiboSessionRouter {
700
708
  && parentBinding.adapterId === binding.adapterId
701
709
  ? parentBinding.nativeSessionId
702
710
  : undefined;
703
- return profileForSession(createPiboProfileFromRegistryOrDefault(this.pluginRegistry, session.profile), binding.runtimeInstanceId, binding.nativeSessionId, parentNativeSessionId, this.getSubagentDepth(session.id));
711
+ return profileForSession(createPiboProfileFromRegistryOrDefault(this.pluginRegistry, session.profile), binding.runtimeInstanceId, binding.nativeSessionId, parentNativeSessionId, this.getSubagentDepth(session.id), resolvePiboSessionInitialRuntimeOptions(session));
704
712
  }
705
713
  async rebindSessionRuntime(piboSessionId, input) {
706
714
  if (this.quiescingSessions.has(piboSessionId)) {
@@ -748,7 +756,7 @@ export class PiboSessionRouter {
748
756
  }
749
757
  const workspace = session.workspace ?? this.options.cwd ?? getDefaultPiboWorkspace();
750
758
  const baseProfile = createPiboProfileFromRegistryOrDefault(this.pluginRegistry, session.profile);
751
- const targetProfile = profileForSession(baseProfile, input.runtimeInstanceId, startsNewNativeSession ? undefined : input.nativeSessionId, undefined, this.getSubagentDepth(session.id));
759
+ const targetProfile = profileForSession(baseProfile, input.runtimeInstanceId, startsNewNativeSession ? undefined : input.nativeSessionId, undefined, this.getSubagentDepth(session.id), resolvePiboSessionInitialRuntimeOptions(session));
752
760
  const targetDiagnostics = await adapter.diagnose();
753
761
  const unavailableTarget = targetDiagnostics.find((diagnostic) => diagnostic.severity === "error");
754
762
  if (unavailableTarget) {
@@ -2058,9 +2066,13 @@ export class PiboSessionRouter {
2058
2066
  const parentChatRoomId = typeof parent.metadata?.chatRoomId === "string" ? parent.metadata.chatRoomId : undefined;
2059
2067
  if (parentChatRoomId)
2060
2068
  metadata.chatRoomId = parentChatRoomId;
2061
- const newSessionMetadata = subagent.thinkingLevel
2062
- ? { ...metadata, initialThinkingLevel: subagent.thinkingLevel }
2063
- : metadata;
2069
+ const newSessionMetadata = {
2070
+ ...metadata,
2071
+ ...(subagent.thinkingLevel ? { initialThinkingLevel: subagent.thinkingLevel } : {}),
2072
+ ...(subagent.runtimeOptions && Object.keys(subagent.runtimeOptions).length > 0
2073
+ ? { initialRuntimeOptions: structuredClone(subagent.runtimeOptions) }
2074
+ : {}),
2075
+ };
2064
2076
  const existing = this.sessionStore.find({
2065
2077
  channel: "pibo.subagents",
2066
2078
  kind: "subagent",
@@ -316,6 +316,7 @@ export class PiboPluginRegistry {
316
316
  timeoutMs: subagent.timeoutMs,
317
317
  model: subagent.model ? { ...subagent.model } : undefined,
318
318
  thinkingLevel: subagent.thinkingLevel,
319
+ ...(subagent.runtimeOptions ? { runtimeOptions: structuredClone(subagent.runtimeOptions) } : {}),
319
320
  maxDepth: subagent.maxDepth,
320
321
  })),
321
322
  contextFiles: [...this.contextFiles.entries()].map(([key, contextFile]) => ({
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@pasko70/pibo",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@pasko70/pibo",
9
- "version": "2.5.0",
9
+ "version": "2.5.2",
10
10
  "workspaces": [
11
11
  "packages/workflows"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pasko70/pibo",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "packages/workflows"