@myagentroam/node 0.12.4 → 0.12.6
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/application/scheduled-execution-service.js +60 -0
- package/dist/connector.js +207 -261
- package/dist/marctl/package.json +1 -1
- package/dist/runner/claude-code-runner.js +4 -0
- package/dist/runner/codex-runner.js +11 -4
- package/dist/runner/mar-agent/agent-network-extension.js +2 -1
- package/dist/runner/opencode/opencode-server.js +37 -12
- package/dist/runner/opencode-runner.js +21 -7
- package/dist/service/agent-network-run-projection.js +60 -0
- package/dist/service/composer-message-input.js +1 -1
- package/dist/service/session-recent-activity.js +3 -3
- package/dist/service/skill-directory-service.js +10 -31
- package/dist/service/skill-node-operation-service.js +3 -5
- package/dist/session/native-session-projection-service.js +41 -6
- package/dist/session/session-catalog-service.js +11 -0
- package/dist/workspace/workspace-session-service.js +58 -8
- package/package.json +4 -4
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Prepares and submits scheduled input through existing Session/Runner owners.
|
|
2
|
+
* The scheduler retains occurrence state, admission, in-flight work and terminal settlement;
|
|
3
|
+
* this application service owns no timers or alternate execution pipeline.
|
|
4
|
+
*/
|
|
5
|
+
export class ScheduledExecutionService {
|
|
6
|
+
options;
|
|
7
|
+
constructor(options) {
|
|
8
|
+
this.options = options;
|
|
9
|
+
}
|
|
10
|
+
authorize = async (task, occurrenceId) => {
|
|
11
|
+
const session = this.options.runtime.getAgentSession(task.sessionId) ??
|
|
12
|
+
(await this.options.projection.resolveCurrent(task.sessionId));
|
|
13
|
+
if (session === undefined ||
|
|
14
|
+
session.workspaceId !== task.workspaceId ||
|
|
15
|
+
session.runner !== task.runner)
|
|
16
|
+
throw new Error('SCHEDULE_SESSION_NOT_FOUND');
|
|
17
|
+
const configured = this.options.projection.ensureResumedConfiguration(session);
|
|
18
|
+
const context = await this.options.authorization.authorize({
|
|
19
|
+
taskId: task.id,
|
|
20
|
+
revision: task.revision,
|
|
21
|
+
occurrenceId,
|
|
22
|
+
sessionId: task.sessionId,
|
|
23
|
+
workspaceId: task.workspaceId,
|
|
24
|
+
ownerUserId: task.ownerUserId,
|
|
25
|
+
runner: task.runner,
|
|
26
|
+
modelId: configured.modelId
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
...(context.gitConfiguration === undefined
|
|
30
|
+
? {}
|
|
31
|
+
: { gitConfiguration: context.gitConfiguration }),
|
|
32
|
+
secretEnvironment: context.secretEnvironment,
|
|
33
|
+
personalInstructions: context.personalInstructions,
|
|
34
|
+
usageGrant: context.usageGrant,
|
|
35
|
+
executionContext: this.options.runners.require(task.runner).prepareExecutionContext(context)
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
submit = async (task, occurrenceId, context) => {
|
|
39
|
+
const result = (await this.options.git.execute('session.message', {
|
|
40
|
+
sessionId: task.sessionId,
|
|
41
|
+
workspaceId: task.workspaceId,
|
|
42
|
+
__requestUserId: task.ownerUserId,
|
|
43
|
+
secretEnvironment: context.secretEnvironment,
|
|
44
|
+
...(context.gitConfiguration === undefined
|
|
45
|
+
? {}
|
|
46
|
+
: { gitConfiguration: context.gitConfiguration })
|
|
47
|
+
}, async (data) => this.options.messages.submitScheduled({
|
|
48
|
+
sessionId: task.sessionId,
|
|
49
|
+
occurrenceId,
|
|
50
|
+
objective: task.objective,
|
|
51
|
+
initiatedByUserId: task.ownerUserId,
|
|
52
|
+
secretEnvironment: data
|
|
53
|
+
.secretEnvironment,
|
|
54
|
+
personalInstructions: context.personalInstructions,
|
|
55
|
+
...(context.usageGrant === undefined ? {} : { usageGrant: context.usageGrant }),
|
|
56
|
+
executionContext: context.executionContext
|
|
57
|
+
})));
|
|
58
|
+
return { runId: result.run.id };
|
|
59
|
+
};
|
|
60
|
+
}
|