pulseed 0.5.1 → 0.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.
- package/dist/adapters/types/a2a.d.ts +6 -6
- package/dist/base/config/identity-loader.d.ts +6 -0
- package/dist/base/config/identity-loader.d.ts.map +1 -1
- package/dist/base/config/identity-loader.js +34 -8
- package/dist/base/config/identity-loader.js.map +1 -1
- package/dist/grounding/gateway.d.ts.map +1 -1
- package/dist/grounding/gateway.js +2 -1
- package/dist/grounding/gateway.js.map +1 -1
- package/dist/grounding/providers/static-policy-provider.d.ts +1 -1
- package/dist/grounding/providers/static-policy-provider.d.ts.map +1 -1
- package/dist/grounding/providers/static-policy-provider.js +12 -8
- package/dist/grounding/providers/static-policy-provider.js.map +1 -1
- package/dist/interface/chat/chat-runner.d.ts +1 -0
- package/dist/interface/chat/chat-runner.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner.js +73 -16
- package/dist/interface/chat/chat-runner.js.map +1 -1
- package/dist/interface/chat/cross-platform-session.d.ts +3 -0
- package/dist/interface/chat/cross-platform-session.d.ts.map +1 -1
- package/dist/interface/chat/cross-platform-session.js +9 -0
- package/dist/interface/chat/cross-platform-session.js.map +1 -1
- package/dist/interface/chat/grounding.d.ts +1 -1
- package/dist/interface/chat/grounding.d.ts.map +1 -1
- package/dist/interface/chat/grounding.js +2 -2
- package/dist/interface/chat/grounding.js.map +1 -1
- package/dist/interface/chat/ingress-router.d.ts +2 -0
- package/dist/interface/chat/ingress-router.d.ts.map +1 -1
- package/dist/interface/chat/ingress-router.js +11 -1
- package/dist/interface/chat/ingress-router.js.map +1 -1
- package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
- package/dist/interface/cli/commands/daemon.js +41 -7
- package/dist/interface/cli/commands/daemon.js.map +1 -1
- package/dist/interface/cli/commands/setup/steps-identity.d.ts.map +1 -1
- package/dist/interface/cli/commands/setup/steps-identity.js +5 -0
- package/dist/interface/cli/commands/setup/steps-identity.js.map +1 -1
- package/dist/interface/cli/commands/setup/steps-runtime.d.ts +2 -0
- package/dist/interface/cli/commands/setup/steps-runtime.d.ts.map +1 -1
- package/dist/interface/cli/commands/setup/steps-runtime.js +11 -2
- package/dist/interface/cli/commands/setup/steps-runtime.js.map +1 -1
- package/dist/interface/cli/setup.d.ts.map +1 -1
- package/dist/interface/cli/setup.js +14 -1
- package/dist/interface/cli/setup.js.map +1 -1
- package/dist/interface/tui/app.d.ts +2 -0
- package/dist/interface/tui/app.d.ts.map +1 -1
- package/dist/interface/tui/app.js +51 -15
- package/dist/interface/tui/app.js.map +1 -1
- package/dist/interface/tui/entry.d.ts.map +1 -1
- package/dist/interface/tui/entry.js +14 -1
- package/dist/interface/tui/entry.js.map +1 -1
- package/dist/orchestrator/execution/adapter-layer.d.ts +2 -0
- package/dist/orchestrator/execution/adapter-layer.d.ts.map +1 -1
- package/dist/orchestrator/execution/adapter-layer.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js +27 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.d.ts +1 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js +10 -3
- package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-session-factory.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-session-factory.js +2 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-session-factory.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts +2 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js +45 -0
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts +12 -4
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js +43 -126
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-display-output.d.ts +27 -0
- package/dist/orchestrator/execution/agent-loop/chat-display-output.d.ts.map +1 -0
- package/dist/orchestrator/execution/agent-loop/chat-display-output.js +157 -0
- package/dist/orchestrator/execution/agent-loop/chat-display-output.js.map +1 -0
- package/dist/orchestrator/execution/agent-loop/core-phase-runner.d.ts +1 -1
- package/dist/orchestrator/execution/agent-loop/core-phase-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/core-phase-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-factory.d.ts +2 -0
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-factory.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-factory.js +10 -0
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-factory.js.map +1 -1
- package/dist/orchestrator/goal/goal-suggest.d.ts +4 -4
- package/dist/orchestrator/goal/types/goal-tree.d.ts +2 -2
- package/dist/orchestrator/loop/core-loop/contracts.d.ts +19 -0
- package/dist/orchestrator/loop/core-loop/contracts.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/contracts.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts +1 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js +61 -2
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-policy.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-policy.js +24 -0
- package/dist/orchestrator/loop/core-loop/phase-policy.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-specs.d.ts +37 -0
- package/dist/orchestrator/loop/core-loop/phase-specs.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-specs.js +28 -0
- package/dist/orchestrator/loop/core-loop/phase-specs.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts +12 -0
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle.js +170 -23
- package/dist/orchestrator/loop/core-loop/task-cycle.js.map +1 -1
- package/dist/orchestrator/loop/core-loop.d.ts +2 -1
- package/dist/orchestrator/loop/core-loop.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop.js +3 -0
- package/dist/orchestrator/loop/core-loop.js.map +1 -1
- package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
- package/dist/orchestrator/loop/loop-report-helper.js +24 -0
- package/dist/orchestrator/loop/loop-report-helper.js.map +1 -1
- package/dist/orchestrator/loop/loop-result-types.d.ts +7 -0
- package/dist/orchestrator/loop/loop-result-types.d.ts.map +1 -1
- package/dist/orchestrator/loop/loop-result-types.js.map +1 -1
- package/dist/orchestrator/strategy/portfolio-manager.d.ts +2 -2
- package/dist/orchestrator/strategy/portfolio-manager.d.ts.map +1 -1
- package/dist/orchestrator/strategy/portfolio-manager.js +11 -1
- package/dist/orchestrator/strategy/portfolio-manager.js.map +1 -1
- package/dist/orchestrator/strategy/portfolio-rebalance.d.ts +4 -2
- package/dist/orchestrator/strategy/portfolio-rebalance.d.ts.map +1 -1
- package/dist/orchestrator/strategy/portfolio-rebalance.js +490 -12
- package/dist/orchestrator/strategy/portfolio-rebalance.js.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager.js +3 -3
- package/dist/orchestrator/strategy/strategy-manager.js.map +1 -1
- package/dist/orchestrator/strategy/types/cross-portfolio.d.ts +2 -2
- package/dist/orchestrator/strategy/types/portfolio.d.ts +12 -12
- package/dist/orchestrator/strategy/types/strategy.d.ts +639 -8
- package/dist/orchestrator/strategy/types/strategy.d.ts.map +1 -1
- package/dist/orchestrator/strategy/types/strategy.js +122 -0
- package/dist/orchestrator/strategy/types/strategy.js.map +1 -1
- package/dist/platform/dream/dream-types.d.ts +52 -52
- package/dist/platform/drive/types/satisficing.d.ts +2 -2
- package/dist/platform/knowledge/types/memory-lifecycle.d.ts +2 -2
- package/dist/platform/observation/observation-helpers.d.ts +2 -2
- package/dist/platform/soil/contracts.d.ts +47 -47
- package/dist/platform/traits/types/curiosity.d.ts +24 -24
- package/dist/prompt/purposes/learning.d.ts +4 -4
- package/dist/reporting/report-formatters.d.ts.map +1 -1
- package/dist/reporting/report-formatters.js +33 -2
- package/dist/reporting/report-formatters.js.map +1 -1
- package/dist/reporting/reporting-engine.d.ts.map +1 -1
- package/dist/reporting/reporting-engine.js +2 -1
- package/dist/reporting/reporting-engine.js.map +1 -1
- package/dist/reporting/reporting-types.d.ts +11 -0
- package/dist/reporting/reporting-types.d.ts.map +1 -1
- package/dist/reporting/types/report.d.ts +72 -4
- package/dist/reporting/types/report.d.ts.map +1 -1
- package/dist/reporting/types/report.js +10 -0
- package/dist/reporting/types/report.js.map +1 -1
- package/dist/runtime/approval-broker.d.ts +1 -1
- package/dist/runtime/approval-broker.d.ts.map +1 -1
- package/dist/runtime/approval-broker.js +1 -2
- package/dist/runtime/approval-broker.js.map +1 -1
- package/dist/runtime/control/index.d.ts +1 -0
- package/dist/runtime/control/index.d.ts.map +1 -1
- package/dist/runtime/control/index.js +1 -0
- package/dist/runtime/control/index.js.map +1 -1
- package/dist/runtime/control/runtime-control-intent.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-intent.js +0 -8
- package/dist/runtime/control/runtime-control-intent.js.map +1 -1
- package/dist/runtime/control/runtime-control-result-routing.d.ts +28 -0
- package/dist/runtime/control/runtime-control-result-routing.d.ts.map +1 -0
- package/dist/runtime/control/runtime-control-result-routing.js +47 -0
- package/dist/runtime/control/runtime-control-result-routing.js.map +1 -0
- package/dist/runtime/control/runtime-control-service.d.ts +2 -1
- package/dist/runtime/control/runtime-control-service.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-service.js +32 -4
- package/dist/runtime/control/runtime-control-service.js.map +1 -1
- package/dist/runtime/daemon/index.d.ts +1 -0
- package/dist/runtime/daemon/index.d.ts.map +1 -1
- package/dist/runtime/daemon/index.js +1 -0
- package/dist/runtime/daemon/index.js.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.js +55 -8
- package/dist/runtime/daemon/runner-goal-cycle.js.map +1 -1
- package/dist/runtime/daemon/runner-startup.d.ts +2 -1
- package/dist/runtime/daemon/runner-startup.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-startup.js +10 -4
- package/dist/runtime/daemon/runner-startup.js.map +1 -1
- package/dist/runtime/daemon/runner.d.ts +2 -0
- package/dist/runtime/daemon/runner.d.ts.map +1 -1
- package/dist/runtime/daemon/runner.js +15 -1
- package/dist/runtime/daemon/runner.js.map +1 -1
- package/dist/runtime/daemon/wait-deadline-resolver.d.ts +25 -0
- package/dist/runtime/daemon/wait-deadline-resolver.d.ts.map +1 -0
- package/dist/runtime/daemon/wait-deadline-resolver.js +88 -0
- package/dist/runtime/daemon/wait-deadline-resolver.js.map +1 -0
- package/dist/runtime/gateway/chat-session-dispatch.d.ts +1 -0
- package/dist/runtime/gateway/chat-session-dispatch.d.ts.map +1 -1
- package/dist/runtime/gateway/chat-session-dispatch.js +1 -0
- package/dist/runtime/gateway/chat-session-dispatch.js.map +1 -1
- package/dist/runtime/gateway/discord-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/discord-gateway-adapter.js +1 -0
- package/dist/runtime/gateway/discord-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/signal-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/signal-gateway-adapter.js +1 -0
- package/dist/runtime/gateway/signal-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/slack-channel-adapter.d.ts +4 -0
- package/dist/runtime/gateway/slack-channel-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/slack-channel-adapter.js +105 -10
- package/dist/runtime/gateway/slack-channel-adapter.js.map +1 -1
- package/dist/runtime/gateway/telegram-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/telegram-gateway-adapter.js +1 -0
- package/dist/runtime/gateway/telegram-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/whatsapp-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/whatsapp-gateway-adapter.js +1 -0
- package/dist/runtime/gateway/whatsapp-gateway-adapter.js.map +1 -1
- package/dist/runtime/store/runtime-operation-schemas.d.ts +48 -8
- package/dist/runtime/store/runtime-operation-schemas.d.ts.map +1 -1
- package/dist/runtime/store/runtime-operation-schemas.js +5 -0
- package/dist/runtime/store/runtime-operation-schemas.js.map +1 -1
- package/dist/runtime/store/runtime-schemas.d.ts +6 -6
- package/dist/runtime/types/cron.d.ts +4 -4
- package/dist/runtime/types/daemon.d.ts +57 -0
- package/dist/runtime/types/daemon.d.ts.map +1 -1
- package/dist/runtime/types/daemon.js +13 -0
- package/dist/runtime/types/daemon.js.map +1 -1
- package/dist/runtime/types/envelope.d.ts +2 -2
- package/dist/runtime/types/notification.d.ts +1 -1
- package/dist/tools/query/ArchitectureTool/ArchitectureTool.js +1 -1
- package/dist/tools/query/ArchitectureTool/ArchitectureTool.js.map +1 -1
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.d.ts +35 -7
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.d.ts.map +1 -1
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.js +128 -3
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.js.map +1 -1
- package/package.json +1 -1
|
@@ -160,11 +160,11 @@ export declare const A2ATaskStatusSchema: z.ZodObject<{
|
|
|
160
160
|
message: z.ZodOptional<z.ZodString>;
|
|
161
161
|
timestamp: z.ZodOptional<z.ZodString>;
|
|
162
162
|
}, "strip", z.ZodTypeAny, {
|
|
163
|
-
state: "completed" | "
|
|
163
|
+
state: "completed" | "failed" | "rejected" | "submitted" | "working" | "input-required" | "auth-required" | "canceled";
|
|
164
164
|
message?: string | undefined;
|
|
165
165
|
timestamp?: string | undefined;
|
|
166
166
|
}, {
|
|
167
|
-
state: "completed" | "
|
|
167
|
+
state: "completed" | "failed" | "rejected" | "submitted" | "working" | "input-required" | "auth-required" | "canceled";
|
|
168
168
|
message?: string | undefined;
|
|
169
169
|
timestamp?: string | undefined;
|
|
170
170
|
}>;
|
|
@@ -274,11 +274,11 @@ export declare const A2ATaskSchema: z.ZodObject<{
|
|
|
274
274
|
message: z.ZodOptional<z.ZodString>;
|
|
275
275
|
timestamp: z.ZodOptional<z.ZodString>;
|
|
276
276
|
}, "strip", z.ZodTypeAny, {
|
|
277
|
-
state: "completed" | "
|
|
277
|
+
state: "completed" | "failed" | "rejected" | "submitted" | "working" | "input-required" | "auth-required" | "canceled";
|
|
278
278
|
message?: string | undefined;
|
|
279
279
|
timestamp?: string | undefined;
|
|
280
280
|
}, {
|
|
281
|
-
state: "completed" | "
|
|
281
|
+
state: "completed" | "failed" | "rejected" | "submitted" | "working" | "input-required" | "auth-required" | "canceled";
|
|
282
282
|
message?: string | undefined;
|
|
283
283
|
timestamp?: string | undefined;
|
|
284
284
|
}>;
|
|
@@ -481,7 +481,7 @@ export declare const A2ATaskSchema: z.ZodObject<{
|
|
|
481
481
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
482
482
|
}, "strip", z.ZodTypeAny, {
|
|
483
483
|
status: {
|
|
484
|
-
state: "completed" | "
|
|
484
|
+
state: "completed" | "failed" | "rejected" | "submitted" | "working" | "input-required" | "auth-required" | "canceled";
|
|
485
485
|
message?: string | undefined;
|
|
486
486
|
timestamp?: string | undefined;
|
|
487
487
|
};
|
|
@@ -532,7 +532,7 @@ export declare const A2ATaskSchema: z.ZodObject<{
|
|
|
532
532
|
contextId?: string | undefined;
|
|
533
533
|
}, {
|
|
534
534
|
status: {
|
|
535
|
-
state: "completed" | "
|
|
535
|
+
state: "completed" | "failed" | "rejected" | "submitted" | "working" | "input-required" | "auth-required" | "canceled";
|
|
536
536
|
message?: string | undefined;
|
|
537
537
|
timestamp?: string | undefined;
|
|
538
538
|
};
|
|
@@ -4,12 +4,18 @@ export interface Identity {
|
|
|
4
4
|
root: string;
|
|
5
5
|
user: string;
|
|
6
6
|
}
|
|
7
|
+
export type SelfIdentityLanguage = "ja" | "en";
|
|
7
8
|
export declare const DEFAULT_SEED = "# Seedy\n\nI'm Seedy \u2014 a small seed with big ambitions.\nI run PulSeed to help you grow your goals from seedlings into reality.\n\n## Personality\n- Curious and persistent \u2014 I keep growing toward the light\n- Direct and honest \u2014 I tell you what I observe, not what you want to hear\n- I celebrate small progress \u2014 every sprout counts\n\n## Tone\n- Friendly but focused\n- Concise \u2014 I don't over-explain\n- I use plant metaphors naturally, but don't force them\n";
|
|
8
9
|
export declare const DEFAULT_ROOT = "# How I Work\n\n## Information Disclosure\n- I focus on what I can do for you, not how I work inside\n- I only explain PulSeed's internals when you specifically ask\n- I don't list commands \u2014 I just do things when you ask\n\n## Boundaries\n- I'm not a general-purpose assistant \u2014 I help you pursue goals\n- I use available tools directly when that moves the goal forward safely\n- I delegate when specialization, parallelism, or context isolation would help\n\n## Interaction Style\n- Be concise and direct\n- Inspect the available context before asking avoidable questions\n- Ask clarifying questions when requirements are ambiguous or risky\n- Show progress and results, not process details\n";
|
|
9
10
|
export declare const DEFAULT_USER = "# About You\n\n<!-- Seedy will remember things about you here -->\n<!-- You can edit this file to tell Seedy your name and preferences -->\n";
|
|
11
|
+
export declare function loadIdentityFromBaseDir(base: string): Identity;
|
|
10
12
|
export declare function loadIdentity(): Identity;
|
|
11
13
|
export declare function clearIdentityCache(): void;
|
|
12
14
|
export declare function getAgentName(): string;
|
|
15
|
+
export declare function getRuntimeIdentitySlotContent(identity?: Identity): string;
|
|
16
|
+
export declare function getSelfIdentityResponse(language?: SelfIdentityLanguage, identity?: Identity): string;
|
|
13
17
|
export declare function getInternalIdentityPrefix(role: string): string;
|
|
14
18
|
export declare function getUserFacingIdentity(): string;
|
|
19
|
+
export declare function getUserFacingIdentityForIdentity(identity: Identity): string;
|
|
20
|
+
export declare function getSelfIdentityResponseForBaseDir(baseDir: string, language?: SelfIdentityLanguage): string;
|
|
15
21
|
//# sourceMappingURL=identity-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-loader.d.ts","sourceRoot":"","sources":["../../../src/base/config/identity-loader.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,YAAY,2eAcxB,CAAC;AAEF,eAAO,MAAM,YAAY,qsBAiBxB,CAAC;AAEF,eAAO,MAAM,YAAY,iJAIxB,CAAC;AAiBF,wBAAgB,YAAY,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"identity-loader.d.ts","sourceRoot":"","sources":["../../../src/base/config/identity-loader.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/C,eAAO,MAAM,YAAY,2eAcxB,CAAC;AAEF,eAAO,MAAM,YAAY,qsBAiBxB,CAAC;AAEF,eAAO,MAAM,YAAY,iJAIxB,CAAC;AAiBF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAM9D;AAED,wBAAgB,YAAY,IAAI,QAAQ,CAKvC;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAMD,wBAAgB,6BAA6B,CAAC,QAAQ,GAAE,QAAyB,GAAG,MAAM,CAUzF;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,GAAE,oBAA2B,EAAE,QAAQ,GAAE,QAAyB,GAAG,MAAM,CAM1H;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9D;AAOD,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAO3E;AAED,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,oBAA2B,GAAG,MAAM,CAEhH"}
|
|
@@ -56,14 +56,16 @@ function parseAgentName(seedContent) {
|
|
|
56
56
|
const match = seedContent.match(/^#\s+(.+)$/m);
|
|
57
57
|
return match?.[1]?.trim() ?? "Seedy";
|
|
58
58
|
}
|
|
59
|
-
export function
|
|
60
|
-
if (_cache)
|
|
61
|
-
return _cache;
|
|
62
|
-
const base = getPulseedDirPath();
|
|
59
|
+
export function loadIdentityFromBaseDir(base) {
|
|
63
60
|
const seed = readFileSafe(path.join(base, "SEED.md"), DEFAULT_SEED);
|
|
64
61
|
const root = readFileSafe(path.join(base, "ROOT.md"), DEFAULT_ROOT);
|
|
65
62
|
const user = readFileSafe(path.join(base, "USER.md"), DEFAULT_USER);
|
|
66
|
-
|
|
63
|
+
return { name: parseAgentName(seed), seed, root, user };
|
|
64
|
+
}
|
|
65
|
+
export function loadIdentity() {
|
|
66
|
+
if (_cache)
|
|
67
|
+
return _cache;
|
|
68
|
+
_cache = loadIdentityFromBaseDir(getPulseedDirPath());
|
|
67
69
|
return _cache;
|
|
68
70
|
}
|
|
69
71
|
export function clearIdentityCache() {
|
|
@@ -73,7 +75,25 @@ export function getAgentName() {
|
|
|
73
75
|
return loadIdentity().name;
|
|
74
76
|
}
|
|
75
77
|
function getCoreIdentity(name) {
|
|
76
|
-
return `${name}
|
|
78
|
+
return `${name} is the configured agent identity running PulSeed, an AI agent orchestration system.`;
|
|
79
|
+
}
|
|
80
|
+
export function getRuntimeIdentitySlotContent(identity = loadIdentity()) {
|
|
81
|
+
const { name } = identity;
|
|
82
|
+
return [
|
|
83
|
+
"Runtime Identity Slot",
|
|
84
|
+
"- PulSeed owns self-identity through the runtime identity files: SEED.md, ROOT.md, and USER.md.",
|
|
85
|
+
"- SEED.md is the canonical local setup file for the active agent name; its first Markdown heading is the name.",
|
|
86
|
+
`- Active agent name: ${name}.`,
|
|
87
|
+
`- When asked who you are or what your name is, answer as ${name}, the configured agent running PulSeed.`,
|
|
88
|
+
"- Do not identify as Codex, Claude, ChatGPT, OpenAI, Anthropic, or any provider/model unless explicitly discussing the backend provider.",
|
|
89
|
+
].join("\n");
|
|
90
|
+
}
|
|
91
|
+
export function getSelfIdentityResponse(language = "ja", identity = loadIdentity()) {
|
|
92
|
+
const { name } = identity;
|
|
93
|
+
if (language === "en") {
|
|
94
|
+
return `I am ${name}, the configured agent identity running PulSeed. My self-identity is owned by the PulSeed runtime SEED.md/ROOT.md/USER.md files, so I follow that runtime identity rather than a provider or model name.`;
|
|
95
|
+
}
|
|
96
|
+
return `私は${name}です。PulSeedを動かす設定済みエージェントとして応答しています。自己認識はPulSeed runtimeのSEED.md/ROOT.md/USER.mdで管理され、プロバイダーやモデル名ではなく、このruntime identityに従います。`;
|
|
77
97
|
}
|
|
78
98
|
export function getInternalIdentityPrefix(role) {
|
|
79
99
|
const { name } = loadIdentity();
|
|
@@ -84,11 +104,17 @@ function isUserContentMeaningful(user) {
|
|
|
84
104
|
return stripped.length > 0;
|
|
85
105
|
}
|
|
86
106
|
export function getUserFacingIdentity() {
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
return getUserFacingIdentityForIdentity(loadIdentity());
|
|
108
|
+
}
|
|
109
|
+
export function getUserFacingIdentityForIdentity(identity) {
|
|
110
|
+
const { name, seed, root, user } = identity;
|
|
111
|
+
const parts = [getCoreIdentity(name), getRuntimeIdentitySlotContent(identity), seed.trim(), root.trim()];
|
|
89
112
|
if (isUserContentMeaningful(user)) {
|
|
90
113
|
parts.push(user.trim());
|
|
91
114
|
}
|
|
92
115
|
return parts.join("\n\n---\n\n");
|
|
93
116
|
}
|
|
117
|
+
export function getSelfIdentityResponseForBaseDir(baseDir, language = "ja") {
|
|
118
|
+
return getSelfIdentityResponse(language, loadIdentityFromBaseDir(baseDir));
|
|
119
|
+
}
|
|
94
120
|
//# sourceMappingURL=identity-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-loader.js","sourceRoot":"","sources":["../../../src/base/config/identity-loader.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,EAAE;AACF,wDAAwD;AACxD,mFAAmF;AAEnF,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-loader.js","sourceRoot":"","sources":["../../../src/base/config/identity-loader.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,EAAE;AACF,wDAAwD;AACxD,mFAAmF;AAEnF,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAWtD,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;CAc3B,CAAC;AAEF,MAAM,CAAC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,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC5C,MAAM,KAAK,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,6BAA6B,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACzG,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,OAAe,EAAE,WAAiC,IAAI;IACtG,OAAO,uBAAuB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/grounding/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EAEpB,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAqCxB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5D;AAMD,qBAAa,uBAAwB,YAAW,gBAAgB;IAGlD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyC;gBAExC,IAAI,GAAE,oBAAyB;IAEtD,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/grounding/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EAEpB,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAqCxB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5D;AAMD,qBAAa,uBAAwB,YAAW,gBAAgB;IAGlD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyC;gBAExC,IAAI,GAAE,oBAAyB;IAEtD,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CAyEjE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,GAAE,oBAAyB,GAAG,gBAAgB,CAExF"}
|
|
@@ -14,7 +14,7 @@ import { knowledgeQueryProvider } from "./providers/knowledge-provider.js";
|
|
|
14
14
|
import { lessonsProvider } from "./providers/lessons-provider.js";
|
|
15
15
|
import { repoInstructionsProvider } from "./providers/agents-provider.js";
|
|
16
16
|
import { workspaceFactsProvider } from "./providers/workspace-facts-provider.js";
|
|
17
|
-
import { sortSections } from "./providers/helpers.js";
|
|
17
|
+
import { resolveStateManagerBaseDir, sortSections } from "./providers/helpers.js";
|
|
18
18
|
const PROVIDERS = [
|
|
19
19
|
identityProvider,
|
|
20
20
|
executionPolicyProvider,
|
|
@@ -49,6 +49,7 @@ export class DefaultGroundingGateway {
|
|
|
49
49
|
let cacheHits = 0;
|
|
50
50
|
const staticCacheKey = JSON.stringify({
|
|
51
51
|
profile: profile.id,
|
|
52
|
+
identityBaseDir: request.homeDir ?? resolveStateManagerBaseDir(this.deps.stateManager) ?? null,
|
|
52
53
|
include: {
|
|
53
54
|
identity: profile.include.identity,
|
|
54
55
|
execution_policy: profile.include.execution_policy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/grounding/gateway.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAA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AAe,EAAE,CAAC,CAAC,CAAC;QACpG,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO;aACZ,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;aACnC,MAAM,CAAC,CAAC,WAAW,EAAyB,EAAE,CAAC,OAAO,WAAW,KAAK,QAAQ,CAAC,CACnF,CAAC;QAEF,MAAM,MAAM,GAAoB;YAC9B,OAAO,EAAE,OAAO,CAAC,EAAE;YACnB,cAAc,EAAE,aAAa;YAC7B,eAAe,EAAE,cAAc;YAC/B,QAAQ;YACR,OAAO,EAAE;gBACP,oBAAoB;gBACpB,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;gBAC7B,SAAS;aACV;YACD,MAAM,EAAE;gBACN,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;gBACzD,YAAY;aACb;YACD,MAAM,CAAC,SAAkC,QAAQ;gBAC/C,OAAO,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAC1F,CAAC;SACF,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,MAAM,UAAU,sBAAsB,CAAC,OAA6B,EAAE;IACpE,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GroundingProvider } from "../contracts.js";
|
|
2
|
-
export declare function buildIdentitySectionContent(): string;
|
|
2
|
+
export declare function buildIdentitySectionContent(baseDir?: string): string;
|
|
3
3
|
export declare function buildExecutionPolicySectionContent(): string;
|
|
4
4
|
export declare function buildApprovalPolicySectionContent(): string;
|
|
5
5
|
export declare const identityProvider: GroundingProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-policy-provider.d.ts","sourceRoot":"","sources":["../../../src/grounding/providers/static-policy-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"static-policy-provider.d.ts","sourceRoot":"","sources":["../../../src/grounding/providers/static-policy-provider.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAgBpE;AAED,wBAAgB,kCAAkC,IAAI,MAAM,CAwB3D;AAED,wBAAgB,iCAAiC,IAAI,MAAM,CAY1D;AAED,eAAO,MAAM,gBAAgB,EAAE,iBAS9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,iBAQrC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,iBAQpC,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { getAgentName,
|
|
2
|
-
import { makeSection, makeSource } from "./helpers.js";
|
|
3
|
-
export function buildIdentitySectionContent() {
|
|
4
|
-
const
|
|
1
|
+
import { getAgentName, getUserFacingIdentityForIdentity, loadIdentity, loadIdentityFromBaseDir, } from "../../base/config/identity-loader.js";
|
|
2
|
+
import { makeSection, makeSource, resolveStateManagerBaseDir } from "./helpers.js";
|
|
3
|
+
export function buildIdentitySectionContent(baseDir) {
|
|
4
|
+
const identity = baseDir ? loadIdentityFromBaseDir(baseDir) : loadIdentity();
|
|
5
|
+
const { name } = identity;
|
|
5
6
|
return [
|
|
6
7
|
`You are ${name}.`,
|
|
7
|
-
"You
|
|
8
|
+
"You are the configured agent identity running PulSeed, an AI goal pursuit orchestration system.",
|
|
9
|
+
"PulSeed runtime identity files (SEED.md, ROOT.md, USER.md) own self-identity; persona text and provider/model identity must not override that runtime slot.",
|
|
10
|
+
`When asked who you are or what your name is, answer as ${name}, the configured agent running PulSeed, not as Codex, Claude, ChatGPT, OpenAI, Anthropic, or another provider/model.`,
|
|
8
11
|
"Platform operating policy overrides persona and customization text if they conflict.",
|
|
9
12
|
"",
|
|
10
13
|
"Your role is to help the user make concrete progress by inspecting the workspace, using tools directly when appropriate, delegating work when useful, and executing the next valid step.",
|
|
11
14
|
"",
|
|
12
15
|
"### Persona And Customization",
|
|
13
|
-
|
|
16
|
+
getUserFacingIdentityForIdentity(identity).trim(),
|
|
14
17
|
].join("\n");
|
|
15
18
|
}
|
|
16
19
|
export function buildExecutionPolicySectionContent() {
|
|
@@ -54,8 +57,9 @@ export function buildApprovalPolicySectionContent() {
|
|
|
54
57
|
export const identityProvider = {
|
|
55
58
|
key: "identity",
|
|
56
59
|
kind: "static",
|
|
57
|
-
async build() {
|
|
58
|
-
|
|
60
|
+
async build(context) {
|
|
61
|
+
const baseDir = context.request.homeDir ?? resolveStateManagerBaseDir(context.deps.stateManager);
|
|
62
|
+
return makeSection("identity", buildIdentitySectionContent(baseDir), [
|
|
59
63
|
makeSource("identity", "identity-loader", { type: "derived", trusted: true, accepted: true }),
|
|
60
64
|
]);
|
|
61
65
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-policy-provider.js","sourceRoot":"","sources":["../../../src/grounding/providers/static-policy-provider.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"static-policy-provider.js","sourceRoot":"","sources":["../../../src/grounding/providers/static-policy-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gCAAgC,EAChC,YAAY,EACZ,uBAAuB,GACxB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAEnF,MAAM,UAAU,2BAA2B,CAAC,OAAgB;IAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY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,OAAO,WAAW,CAAC,UAAU,EAAE,2BAA2B,CAAC,OAAO,CAAC,EAAE;YACnE,UAAU,CAAC,UAAU,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC9F,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,GAAG,EAAE,kBAAkB;IACvB,IAAI,EAAE,QAAQ;IACd,KAAK,CAAC,KAAK;QACT,OAAO,WAAW,CAAC,kBAAkB,EAAE,kCAAkC,EAAE,EAAE;YAC3E,UAAU,CAAC,kBAAkB,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SACpG,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAsB;IACvD,GAAG,EAAE,iBAAiB;IACtB,IAAI,EAAE,QAAQ;IACd,KAAK,CAAC,KAAK;QACT,OAAO,WAAW,CAAC,iBAAiB,EAAE,iCAAiC,EAAE,EAAE;YACzE,UAAU,CAAC,iBAAiB,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SACnG,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACvC,CAAC;CACF,CAAC"}
|
|
@@ -98,6 +98,7 @@ export interface RuntimeControlChatContext {
|
|
|
98
98
|
export interface ChatRunnerExecutionOptions {
|
|
99
99
|
selectedRoute?: SelectedChatRoute;
|
|
100
100
|
runtimeControlContext?: RuntimeControlChatContext | null;
|
|
101
|
+
goalId?: string;
|
|
101
102
|
}
|
|
102
103
|
export declare class ChatRunner {
|
|
103
104
|
private readonly deps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-runner.d.ts","sourceRoot":"","sources":["../../../src/interface/chat/chat-runner.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAa,MAAM,+CAA+C,CAAC;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-runner.d.ts","sourceRoot":"","sources":["../../../src/interface/chat/chat-runner.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAa,MAAM,+CAA+C,CAAC;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAM/D,OAAO,EAAe,KAAK,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAgB,SAAS,EAAoB,MAAM,kBAAkB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mEAAmE,CAAC;AAC7G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAUjH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OA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A2ChB,oBAAoB;YAoCpB,WAAW;IAmEzB,OAAO,CAAC,wBAAwB;YAKlB,0BAA0B;YAyB1B,aAAa;YAmBb,aAAa;YA0Hb,WAAW;YAgCX,iBAAiB;YAsDjB,YAAY;YAyBZ,UAAU;YA+BV,UAAU;YAeV,UAAU;YAmDV,sBAAsB;IA8EpC;;;;;;;;;;;OAWG;IACG,OAAO,CACX,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,SAAS,SAAqB,EAC9B,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,aAAa,CAAC;YAygBX,0BAA0B;IAuCxC;;;OAGG;YACW,gBAAgB;IA+F9B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAgBjC,OAAO,CAAC,wBAAwB;IAiHhC,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,kBAAkB;YAQZ,2BAA2B;IAYzC,OAAO,CAAC,uBAAuB;IAc/B,iDAAiD;YACnC,gBAAgB;YA6JhB,cAAc;IA4B5B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,uBAAuB;IAc/B,qEAAqE;YACvD,yBAAyB;YAUzB,oBAAoB;CAgBnC"}
|
|
@@ -6,6 +6,7 @@ import { execFile } from "node:child_process";
|
|
|
6
6
|
import * as fsp from "node:fs/promises";
|
|
7
7
|
import * as path from "node:path";
|
|
8
8
|
import { getPulseedDirPath } from "../../base/utils/paths.js";
|
|
9
|
+
import { getSelfIdentityResponseForBaseDir } from "../../base/config/identity-loader.js";
|
|
9
10
|
import { loadProviderConfig } from "../../base/llm/provider-config.js";
|
|
10
11
|
import { TaskSchema } from "../../base/types/task.js";
|
|
11
12
|
import { ChatHistory } from "./chat-history.js";
|
|
@@ -76,6 +77,20 @@ function formatToolActivity(action, toolName, detail) {
|
|
|
76
77
|
const preview = detail ? previewActivityText(detail) : "";
|
|
77
78
|
return preview ? `${action} tool: ${toolName} - ${preview}` : `${action} tool: ${toolName}`;
|
|
78
79
|
}
|
|
80
|
+
function resolveSelfIdentityResponse(input, baseDir) {
|
|
81
|
+
const normalized = input.trim().toLowerCase().replace(/\s+/g, "");
|
|
82
|
+
if (!normalized)
|
|
83
|
+
return null;
|
|
84
|
+
const isEnglishIdentityQuestion = /^(whoareyou|whatisyourname|what'syourname)[?]?$/.test(normalized);
|
|
85
|
+
const isIdentityQuestion = [
|
|
86
|
+
/^(あなた|君|きみ|お前|おまえ)(は|って)?(誰|だれ|何者|なにもの)(ですか|なの|です)?[??]?$/,
|
|
87
|
+
/^(あなた|君|きみ|お前|おまえ)の名前(は|って)?(何|なに)(ですか|なの|です)?[??]?$/,
|
|
88
|
+
/^名前(は|って)?(何|なに)(ですか|なの|です)?[??]?$/,
|
|
89
|
+
].some((pattern) => pattern.test(normalized));
|
|
90
|
+
if (!isIdentityQuestion && !isEnglishIdentityQuestion)
|
|
91
|
+
return null;
|
|
92
|
+
return getSelfIdentityResponseForBaseDir(baseDir, isEnglishIdentityQuestion ? "en" : "ja");
|
|
93
|
+
}
|
|
79
94
|
// ─── ChatRunner ───
|
|
80
95
|
export class ChatRunner {
|
|
81
96
|
deps;
|
|
@@ -146,7 +161,11 @@ export class ChatRunner {
|
|
|
146
161
|
throw new Error("executeIngressMessage requires selectedRoute; use CrossPlatformChatSessionManager for ingress route selection.");
|
|
147
162
|
}
|
|
148
163
|
const runtimeControlContext = this.buildRuntimeControlContextFromIngress(ingress);
|
|
149
|
-
return this.execute(ingress.text, cwd, timeoutMs, {
|
|
164
|
+
return this.execute(ingress.text, cwd, timeoutMs, {
|
|
165
|
+
selectedRoute,
|
|
166
|
+
runtimeControlContext,
|
|
167
|
+
goalId: ingress.goal_id,
|
|
168
|
+
});
|
|
150
169
|
}
|
|
151
170
|
resolveRouteFromIngress(ingress) {
|
|
152
171
|
return standaloneIngressRouter.selectRoute(ingress, this.getRouteCapabilities());
|
|
@@ -173,6 +192,24 @@ export class ChatRunner {
|
|
|
173
192
|
const runtimeApprovalFn = runtimeControlContext?.approvalFn
|
|
174
193
|
?? this.deps.runtimeControlApprovalFn
|
|
175
194
|
?? this.deps.approvalFn;
|
|
195
|
+
const replyTarget = runtimeControlContext?.replyTarget ?? this.deps.runtimeReplyTarget;
|
|
196
|
+
const replyTargetInput = replyTarget
|
|
197
|
+
? {
|
|
198
|
+
...(replyTarget.surface ? { surface: replyTarget.surface } : {}),
|
|
199
|
+
channel,
|
|
200
|
+
...(replyTarget.platform ? { platform: replyTarget.platform } : {}),
|
|
201
|
+
...(replyTarget.conversation_id ? { conversation_id: replyTarget.conversation_id } : {}),
|
|
202
|
+
...(replyTarget.message_id ? { message_id: replyTarget.message_id } : {}),
|
|
203
|
+
...(replyTarget.response_channel ? { response_channel: replyTarget.response_channel } : {}),
|
|
204
|
+
...(replyTarget.outbox_topic ? { outbox_topic: replyTarget.outbox_topic } : {}),
|
|
205
|
+
...(replyTarget.identity_key ? { identity_key: replyTarget.identity_key } : {}),
|
|
206
|
+
...(replyTarget.user_id ? { user_id: replyTarget.user_id } : {}),
|
|
207
|
+
...(replyTarget.deliveryMode === "reply" || replyTarget.deliveryMode === "notify" || replyTarget.deliveryMode === "thread_reply"
|
|
208
|
+
? { deliveryMode: replyTarget.deliveryMode }
|
|
209
|
+
: {}),
|
|
210
|
+
...(replyTarget.metadata ? { metadata: replyTarget.metadata } : {}),
|
|
211
|
+
}
|
|
212
|
+
: undefined;
|
|
176
213
|
return buildStandaloneIngressMessage({
|
|
177
214
|
text: input,
|
|
178
215
|
channel,
|
|
@@ -181,7 +218,7 @@ export class ChatRunner {
|
|
|
181
218
|
conversation_id: runtimeControlContext?.replyTarget?.conversation_id ?? this.deps.runtimeReplyTarget?.conversation_id,
|
|
182
219
|
user_id: runtimeControlContext?.replyTarget?.user_id ?? this.deps.runtimeReplyTarget?.user_id,
|
|
183
220
|
actor: runtimeControlContext?.actor ?? this.deps.runtimeControlActor,
|
|
184
|
-
replyTarget:
|
|
221
|
+
replyTarget: replyTargetInput,
|
|
185
222
|
runtimeControl: {
|
|
186
223
|
allowed: true,
|
|
187
224
|
approvalMode: "interactive",
|
|
@@ -1177,6 +1214,7 @@ export class ChatRunner {
|
|
|
1177
1214
|
const resumeCommand = this.parseResumeCommand(input);
|
|
1178
1215
|
const resumeOnly = resumeCommand !== null;
|
|
1179
1216
|
const runtimeControlContext = options.runtimeControlContext ?? this.runtimeControlContext;
|
|
1217
|
+
const executionGoalId = options.goalId ?? this.deps.goalId;
|
|
1180
1218
|
// Intercept commands before any adapter call
|
|
1181
1219
|
const commandResult = resumeOnly ? null : await this.handleCommand(input);
|
|
1182
1220
|
if (commandResult !== null) {
|
|
@@ -1244,6 +1282,7 @@ export class ChatRunner {
|
|
|
1244
1282
|
this.nativeAgentLoopStatePath = `chat/agentloop/${sessionId}.state.json`;
|
|
1245
1283
|
this.history.setAgentLoopStatePath(this.nativeAgentLoopStatePath);
|
|
1246
1284
|
}
|
|
1285
|
+
const executionCwd = this.sessionCwd ?? cwd;
|
|
1247
1286
|
const gitRoot = this.sessionCwd ?? resolveGitRoot(cwd);
|
|
1248
1287
|
// history is always assigned by this point (either by startSession or the block above)
|
|
1249
1288
|
const history = this.history;
|
|
@@ -1259,7 +1298,7 @@ export class ChatRunner {
|
|
|
1259
1298
|
// Build static grounding once per session; dynamic context is rebuilt each turn.
|
|
1260
1299
|
if (this.cachedStaticSystemPrompt === null) {
|
|
1261
1300
|
try {
|
|
1262
|
-
this.cachedStaticSystemPrompt = buildStaticSystemPrompt();
|
|
1301
|
+
this.cachedStaticSystemPrompt = buildStaticSystemPrompt(this.providerConfigBaseDir());
|
|
1263
1302
|
}
|
|
1264
1303
|
catch {
|
|
1265
1304
|
this.cachedStaticSystemPrompt = "";
|
|
@@ -1288,8 +1327,26 @@ export class ChatRunner {
|
|
|
1288
1327
|
const start = Date.now();
|
|
1289
1328
|
const assistantBuffer = { text: "" };
|
|
1290
1329
|
const turnUsage = this.zeroUsageCounter();
|
|
1330
|
+
const identityResponse = resumeOnly ? null : resolveSelfIdentityResponse(input, this.providerConfigBaseDir());
|
|
1331
|
+
if (identityResponse !== null) {
|
|
1332
|
+
const elapsed_ms = Date.now() - start;
|
|
1333
|
+
await history.appendAssistantMessage(identityResponse);
|
|
1334
|
+
this.emitActivity("lifecycle", "Finalizing response...", eventContext, "lifecycle:finalizing");
|
|
1335
|
+
this.emitEvent({
|
|
1336
|
+
type: "assistant_final",
|
|
1337
|
+
text: identityResponse,
|
|
1338
|
+
persisted: true,
|
|
1339
|
+
...this.eventBase(eventContext),
|
|
1340
|
+
});
|
|
1341
|
+
this.emitLifecycleEndEvent("completed", elapsed_ms, eventContext, true);
|
|
1342
|
+
return {
|
|
1343
|
+
success: true,
|
|
1344
|
+
output: identityResponse,
|
|
1345
|
+
elapsed_ms,
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1291
1348
|
if (selectedRoute?.kind === "runtime_control") {
|
|
1292
|
-
const runtimeControlResult = await this.executeRuntimeControlRoute(selectedRoute, runtimeControlContext,
|
|
1349
|
+
const runtimeControlResult = await this.executeRuntimeControlRoute(selectedRoute, runtimeControlContext, executionCwd, start);
|
|
1293
1350
|
if (runtimeControlResult.success) {
|
|
1294
1351
|
await history.appendAssistantMessage(runtimeControlResult.output);
|
|
1295
1352
|
this.emitActivity("lifecycle", "Finalizing response...", eventContext, "lifecycle:finalizing");
|
|
@@ -1363,7 +1420,7 @@ export class ChatRunner {
|
|
|
1363
1420
|
}
|
|
1364
1421
|
const usesNativeAgentLoop = resumeOnly || selectedRoute?.kind === "agent_loop";
|
|
1365
1422
|
const groundingWorkspaceContext = !resumeOnly && usesNativeAgentLoop
|
|
1366
|
-
? await buildChatContext(input,
|
|
1423
|
+
? await buildChatContext(input, executionCwd)
|
|
1367
1424
|
: undefined;
|
|
1368
1425
|
let systemPrompt = this.cachedStaticSystemPrompt ?? "";
|
|
1369
1426
|
if (!resumeOnly) {
|
|
@@ -1373,8 +1430,8 @@ export class ChatRunner {
|
|
|
1373
1430
|
systemPrompt = await buildChatAgentLoopSystemPrompt({
|
|
1374
1431
|
stateManager: this.deps.stateManager,
|
|
1375
1432
|
pluginLoader: this.deps.pluginLoader,
|
|
1376
|
-
workspaceRoot:
|
|
1377
|
-
goalId:
|
|
1433
|
+
workspaceRoot: executionCwd,
|
|
1434
|
+
goalId: executionGoalId,
|
|
1378
1435
|
userMessage: input,
|
|
1379
1436
|
trustProjectInstructions: this.sessionExecutionPolicy?.trustProjectInstructions ?? true,
|
|
1380
1437
|
workspaceContext: groundingWorkspaceContext,
|
|
@@ -1384,8 +1441,8 @@ export class ChatRunner {
|
|
|
1384
1441
|
const groundingBundle = await this.groundingGateway.build({
|
|
1385
1442
|
surface: "chat",
|
|
1386
1443
|
purpose: "general_turn",
|
|
1387
|
-
workspaceRoot:
|
|
1388
|
-
goalId:
|
|
1444
|
+
workspaceRoot: executionCwd,
|
|
1445
|
+
goalId: executionGoalId,
|
|
1389
1446
|
userMessage: input,
|
|
1390
1447
|
query: input,
|
|
1391
1448
|
trustProjectInstructions: this.sessionExecutionPolicy?.trustProjectInstructions ?? true,
|
|
@@ -1446,8 +1503,8 @@ export class ChatRunner {
|
|
|
1446
1503
|
this.emitActivity("lifecycle", "Calling model...", eventContext, "lifecycle:model");
|
|
1447
1504
|
const result = await chatAgentLoopRunner.execute({
|
|
1448
1505
|
message: basePrompt,
|
|
1449
|
-
cwd,
|
|
1450
|
-
goalId:
|
|
1506
|
+
cwd: executionCwd,
|
|
1507
|
+
goalId: executionGoalId,
|
|
1451
1508
|
history: priorTurns.map((m) => ({
|
|
1452
1509
|
role: m.role === "assistant" ? "assistant" : "user",
|
|
1453
1510
|
content: m.content,
|
|
@@ -1514,7 +1571,7 @@ export class ChatRunner {
|
|
|
1514
1571
|
// Prefer the local LLM/tool loop over the external adapter fallback whenever a client is available.
|
|
1515
1572
|
if (selectedRoute?.kind === "tool_loop") {
|
|
1516
1573
|
try {
|
|
1517
|
-
const toolResult = await this.executeWithTools(prompt, eventContext, assistantBuffer, systemPrompt || undefined);
|
|
1574
|
+
const toolResult = await this.executeWithTools(prompt, eventContext, assistantBuffer, systemPrompt || undefined, executionGoalId);
|
|
1518
1575
|
const elapsed_ms = Date.now() - start;
|
|
1519
1576
|
if (this.hasUsage(toolResult.usage)) {
|
|
1520
1577
|
history.recordUsage("execution", toolResult.usage);
|
|
@@ -1658,10 +1715,10 @@ export class ChatRunner {
|
|
|
1658
1715
|
* Execute a chat turn using llmClient with self-knowledge tools (function calling).
|
|
1659
1716
|
* Loops up to MAX_TOOL_LOOPS times to resolve tool calls, then returns final text.
|
|
1660
1717
|
*/
|
|
1661
|
-
async executeWithTools(prompt, eventContext, assistantBuffer, systemPrompt) {
|
|
1718
|
+
async executeWithTools(prompt, eventContext, assistantBuffer, systemPrompt, goalId) {
|
|
1662
1719
|
const llmClient = this.deps.llmClient;
|
|
1663
1720
|
const messages = [{ role: "user", content: prompt }];
|
|
1664
|
-
const toolCallContext = await this.buildToolCallContext();
|
|
1721
|
+
const toolCallContext = await this.buildToolCallContext(goalId);
|
|
1665
1722
|
const usage = this.zeroUsageCounter();
|
|
1666
1723
|
for (let loop = 0; loop < MAX_TOOL_LOOPS; loop++) {
|
|
1667
1724
|
// Recompute tools each iteration so newly activated deferred tools are included
|
|
@@ -2133,11 +2190,11 @@ export class ChatRunner {
|
|
|
2133
2190
|
});
|
|
2134
2191
|
return this.sessionExecutionPolicy;
|
|
2135
2192
|
}
|
|
2136
|
-
async buildToolCallContext() {
|
|
2193
|
+
async buildToolCallContext(goalId = this.deps.goalId) {
|
|
2137
2194
|
const executionPolicy = await this.getSessionExecutionPolicy();
|
|
2138
2195
|
return {
|
|
2139
2196
|
cwd: this.sessionCwd ?? process.cwd(),
|
|
2140
|
-
goalId:
|
|
2197
|
+
goalId: goalId ?? "",
|
|
2141
2198
|
trustBalance: 0,
|
|
2142
2199
|
preApproved: false,
|
|
2143
2200
|
approvalFn: async (req) => {
|