@mono-agent/agent-app 0.4.0 → 0.5.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/README.md +15 -5
- package/dist/adapter-send-tools-main.js +2 -2
- package/dist/adapter-send-tools-main.js.map +1 -1
- package/dist/adapter-send-tools.d.ts +72 -6
- package/dist/adapter-send-tools.d.ts.map +1 -1
- package/dist/adapter-send-tools.js +413 -38
- package/dist/adapter-send-tools.js.map +1 -1
- package/dist/app-config.d.ts +48 -11
- package/dist/app-config.d.ts.map +1 -1
- package/dist/app-config.js +98 -24
- package/dist/app-config.js.map +1 -1
- package/dist/app.d.ts +10 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +659 -48
- package/dist/app.js.map +1 -1
- package/dist/artifact-retention.d.ts +32 -0
- package/dist/artifact-retention.d.ts.map +1 -0
- package/dist/artifact-retention.js +111 -0
- package/dist/artifact-retention.js.map +1 -0
- package/dist/audit-runs.d.ts +12 -0
- package/dist/audit-runs.d.ts.map +1 -0
- package/dist/audit-runs.js +68 -0
- package/dist/audit-runs.js.map +1 -0
- package/dist/backfill.d.ts +3 -7
- package/dist/backfill.d.ts.map +1 -1
- package/dist/backfill.js +115 -11
- package/dist/backfill.js.map +1 -1
- package/dist/background.d.ts +8 -1
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +202 -4
- package/dist/background.js.map +1 -1
- package/dist/broadcast-recorder.d.ts +27 -0
- package/dist/broadcast-recorder.d.ts.map +1 -0
- package/dist/broadcast-recorder.js +82 -0
- package/dist/broadcast-recorder.js.map +1 -0
- package/dist/channel-config-view.d.ts +28 -0
- package/dist/channel-config-view.d.ts.map +1 -0
- package/dist/channel-config-view.js +79 -0
- package/dist/channel-config-view.js.map +1 -0
- package/dist/channel-gate.d.ts +22 -0
- package/dist/channel-gate.d.ts.map +1 -0
- package/dist/channel-gate.js +35 -0
- package/dist/channel-gate.js.map +1 -0
- package/dist/channel-plugins.d.ts +39 -0
- package/dist/channel-plugins.d.ts.map +1 -0
- package/dist/channel-plugins.js +372 -0
- package/dist/channel-plugins.js.map +1 -0
- package/dist/channels.d.ts +62 -73
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +833 -126
- package/dist/channels.js.map +1 -1
- package/dist/cli.d.ts +65 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +755 -30
- package/dist/cli.js.map +1 -1
- package/dist/config-reference.d.ts +24 -0
- package/dist/config-reference.d.ts.map +1 -0
- package/dist/config-reference.js +580 -0
- package/dist/config-reference.js.map +1 -0
- package/dist/configured-agent.d.ts +104 -0
- package/dist/configured-agent.d.ts.map +1 -0
- package/dist/configured-agent.js +578 -0
- package/dist/configured-agent.js.map +1 -0
- package/dist/consumer-contract.d.ts +36 -0
- package/dist/consumer-contract.d.ts.map +1 -0
- package/dist/consumer-contract.js +290 -0
- package/dist/consumer-contract.js.map +1 -0
- package/dist/doctor.d.ts +9 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +352 -55
- package/dist/doctor.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +23 -7
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +91 -26
- package/dist/init.js.map +1 -1
- package/dist/install-skill.d.ts +1 -1
- package/dist/install-skill.js +2 -2
- package/dist/install-skill.js.map +1 -1
- package/dist/interaction-bridge.d.ts +72 -0
- package/dist/interaction-bridge.d.ts.map +1 -0
- package/dist/interaction-bridge.js +354 -0
- package/dist/interaction-bridge.js.map +1 -0
- package/dist/memory-command.d.ts +10 -0
- package/dist/memory-command.d.ts.map +1 -0
- package/dist/memory-command.js +649 -0
- package/dist/memory-command.js.map +1 -0
- package/dist/memory-recall-main.js +1 -1
- package/dist/memory-recall-main.js.map +1 -1
- package/dist/memory-recall.d.ts +41 -5
- package/dist/memory-recall.d.ts.map +1 -1
- package/dist/memory-recall.js +75 -5
- package/dist/memory-recall.js.map +1 -1
- package/dist/memory-rituals.d.ts +8 -11
- package/dist/memory-rituals.d.ts.map +1 -1
- package/dist/memory-rituals.js +26 -25
- package/dist/memory-rituals.js.map +1 -1
- package/dist/metrics.d.ts +13 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +105 -0
- package/dist/metrics.js.map +1 -0
- package/dist/notify-destinations.d.ts +23 -0
- package/dist/notify-destinations.d.ts.map +1 -0
- package/dist/notify-destinations.js +79 -0
- package/dist/notify-destinations.js.map +1 -0
- package/dist/posted-message-index.d.ts +61 -0
- package/dist/posted-message-index.d.ts.map +1 -0
- package/dist/posted-message-index.js +178 -0
- package/dist/posted-message-index.js.map +1 -0
- package/dist/proactive-notify.d.ts +32 -0
- package/dist/proactive-notify.d.ts.map +1 -0
- package/dist/proactive-notify.js +62 -0
- package/dist/proactive-notify.js.map +1 -0
- package/dist/recipes/base.d.ts +15 -0
- package/dist/recipes/base.d.ts.map +1 -0
- package/dist/recipes/base.js +51 -0
- package/dist/recipes/base.js.map +1 -0
- package/dist/recipes/catalog.d.ts +4 -0
- package/dist/recipes/catalog.d.ts.map +1 -0
- package/dist/recipes/catalog.js +525 -0
- package/dist/recipes/catalog.js.map +1 -0
- package/dist/recipes/index.d.ts +11 -0
- package/dist/recipes/index.d.ts.map +1 -0
- package/dist/recipes/index.js +14 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/recipes/types.d.ts +70 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +15 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/request-model-override.d.ts +67 -0
- package/dist/request-model-override.d.ts.map +1 -0
- package/dist/request-model-override.js +96 -0
- package/dist/request-model-override.js.map +1 -0
- package/dist/runs-health.d.ts +22 -0
- package/dist/runs-health.d.ts.map +1 -0
- package/dist/runs-health.js +144 -0
- package/dist/runs-health.js.map +1 -0
- package/dist/seen-conversations.d.ts +22 -0
- package/dist/seen-conversations.d.ts.map +1 -0
- package/dist/seen-conversations.js +120 -0
- package/dist/seen-conversations.js.map +1 -0
- package/dist/setup.d.ts +29 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +97 -0
- package/dist/setup.js.map +1 -0
- package/dist/trigger-overrides.d.ts +17 -0
- package/dist/trigger-overrides.d.ts.map +1 -0
- package/dist/trigger-overrides.js +30 -0
- package/dist/trigger-overrides.js.map +1 -0
- package/dist/tui-command.d.ts +56 -0
- package/dist/tui-command.d.ts.map +1 -0
- package/dist/tui-command.js +160 -0
- package/dist/tui-command.js.map +1 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +4 -0
- package/dist/ui.js.map +1 -1
- package/dist/web-command.d.ts +45 -0
- package/dist/web-command.d.ts.map +1 -0
- package/dist/web-command.js +152 -0
- package/dist/web-command.js.map +1 -0
- package/package.json +19 -18
- package/schema/mono-agent.config.schema.json +1686 -0
- package/skills/mono-agent-composer/SKILL.md +34 -9
- package/skills/mono-agent-composer/agents/openai.yaml +4 -0
- package/skills/mono-agent-composer/references/config-blueprint.md +92 -49
- package/skills/mono-agent-composer/references/discovery-questions.md +15 -17
- package/skills/mono-agent-composer/references/feature-coverage.md +22 -17
- package/skills/mono-agent-composer/references/package-map.md +19 -21
- package/skills/mono-agent-composer/references/playbooks.md +267 -0
- package/skills/mono-agent-composer/references/validation.md +9 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
export { isAppCoreConfigError, loadAppCoreConfig,
|
|
1
|
+
export { isAppCoreConfigError, loadAppCoreConfig, phoenixAppBaseUrl, resolveAppArtifactDir, resolveAppObservabilityExporters, resolveAppTraceHeartbeatMs, resolveAppTraceRegistryDir, resolveAppTraceSourceId, resolveAppTraceSourceLabel, resolveAppTraceStaleAfterMs, } from "./app-config.js";
|
|
2
2
|
export type { AppTraceDefaults, MonoAgentAppConfigInput, ResolvedExporter } from "./app-config.js";
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
3
|
+
export { createConfiguredAgentHarness, createConfiguredAgentResponder, createConfiguredAgentRuntime, createConfiguredMemory, } from "./configured-agent.js";
|
|
4
|
+
export type { ConfiguredAgentHarnessOptions, ConfiguredAgentResponderOptions, ConfiguredAgentRuntimeOptions, } from "./configured-agent.js";
|
|
5
|
+
export { createBroadcastRunRecorder } from "./broadcast-recorder.js";
|
|
6
|
+
export type { BroadcastRunContext } from "./broadcast-recorder.js";
|
|
7
|
+
export { createCronChannelDriver, createOpenAIApiChannelDriver, createSlackChannelDriver, createTelegramChannelDriver, createWebhookChannelDriver, defaultChannelDrivers, resolveChannelDrivers, } from "./channels.js";
|
|
8
|
+
export type { ChannelDriver, ChannelDriverOverrides, ChannelId, ChannelStartInput, ChannelStatus, CronChannelOverrides, MonoAgentAppLogger, OpenAIApiChannelOverrides, RunningChannel, SlackChannelOverrides, TelegramChannelOverrides, WebhookChannelOverrides, } from "./channels.js";
|
|
5
9
|
export { startMonoAgentApp } from "./app.js";
|
|
6
10
|
export type { ConfigApplyResult, ExporterStatus, MonoAgentApp, MonoAgentAppOptions, TraceabilityStatus, } from "./app.js";
|
|
7
11
|
export { initMonoAgentFolder } from "./init.js";
|
|
8
12
|
export type { InitMonoAgentFolderOptions, InitMonoAgentFolderResult } from "./init.js";
|
|
9
13
|
export { validateMonoAgentFolder } from "./doctor.js";
|
|
10
14
|
export type { ValidateMonoAgentFolderOptions, ValidationReport, ValidationSection, ValidationStatus, } from "./doctor.js";
|
|
15
|
+
export { consumerContractNames, consumerContractRunSummaryStatuses, validateConsumerContractFixture, } from "./consumer-contract.js";
|
|
16
|
+
export type { ConsumerContractFixtureOptions, ConsumerContractFixtureResult, ConsumerContractIssue, ConsumerContractName, ConsumerContractSectionStatus, } from "./consumer-contract.js";
|
|
11
17
|
export { parseCliArgs, runCli, loadCliEnvFile, ensureStartable, renderHelp, printAppStatus } from "./cli.js";
|
|
12
18
|
export type { PreflightResult } from "./cli.js";
|
|
13
19
|
export { badge, channelBadge, computeColorEnabled, healthBadge, isColorEnabled, keyValue, rule, style } from "./ui.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,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,gCAAgC,EAChC,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,aAAa,EACb,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC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export {
|
|
1
|
+
export { isAppCoreConfigError, loadAppCoreConfig, phoenixAppBaseUrl, resolveAppArtifactDir, resolveAppObservabilityExporters, resolveAppTraceHeartbeatMs, resolveAppTraceRegistryDir, resolveAppTraceSourceId, resolveAppTraceSourceLabel, resolveAppTraceStaleAfterMs, } from "./app-config.js";
|
|
2
|
+
export { createConfiguredAgentHarness, createConfiguredAgentResponder, createConfiguredAgentRuntime, createConfiguredMemory, } from "./configured-agent.js";
|
|
3
|
+
export { createBroadcastRunRecorder } from "./broadcast-recorder.js";
|
|
4
|
+
export { createCronChannelDriver, createOpenAIApiChannelDriver, createSlackChannelDriver, createTelegramChannelDriver, createWebhookChannelDriver, defaultChannelDrivers, resolveChannelDrivers, } from "./channels.js";
|
|
3
5
|
export { startMonoAgentApp } from "./app.js";
|
|
4
6
|
export { initMonoAgentFolder } from "./init.js";
|
|
5
7
|
export { validateMonoAgentFolder } from "./doctor.js";
|
|
8
|
+
export { consumerContractNames, consumerContractRunSummaryStatuses, validateConsumerContractFixture, } from "./consumer-contract.js";
|
|
6
9
|
export { parseCliArgs, runCli, loadCliEnvFile, ensureStartable, renderHelp, printAppStatus } from "./cli.js";
|
|
7
10
|
export { badge, channelBadge, computeColorEnabled, healthBadge, isColorEnabled, keyValue, rule, style } from "./ui.js";
|
|
8
11
|
export { COMPOSER_SKILL_NAME, installComposerSkill } from "./install-skill.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,gCAAgC,EAChC,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAevB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAQ7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAOtD,OAAO,EACL,qBAAqB,EACrB,kCAAkC,EAClC,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE7G,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/init.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import type { AgentRecipe, RecipeInputValues } from "./recipes/index.js";
|
|
2
|
+
/** Channels `--with` can switch on, merged onto a recipe's config. */
|
|
3
|
+
export declare const WITH_CHANNELS: readonly ["telegram", "slack", "webhook", "openaiApi", "cron"];
|
|
4
|
+
export type WithChannel = (typeof WITH_CHANNELS)[number];
|
|
5
|
+
export declare function isWithChannel(value: string): value is WithChannel;
|
|
1
6
|
export interface InitMonoAgentFolderOptions {
|
|
2
7
|
/** Folder the agent is constructed in. Defaults to process.cwd(). */
|
|
3
8
|
readonly dir?: string;
|
|
@@ -5,26 +10,37 @@ export interface InitMonoAgentFolderOptions {
|
|
|
5
10
|
readonly model?: string;
|
|
6
11
|
/** Ordered backup model references written into the config. */
|
|
7
12
|
readonly fallbackModels?: readonly string[];
|
|
8
|
-
/** Memory strategy: omitted = no memory section. */
|
|
13
|
+
/** Memory strategy: omitted = no memory section. Ignored when a recipe is given. */
|
|
9
14
|
readonly memory?: "lite" | "journal" | "bujo";
|
|
15
|
+
/** When set, the config comes from this recipe instead of the default scaffold. */
|
|
16
|
+
readonly recipe?: AgentRecipe;
|
|
17
|
+
/** Prompted non-secret values to layer onto recipe defaults. Secret recipe inputs are ignored. */
|
|
18
|
+
readonly recipeInputs?: RecipeInputValues;
|
|
19
|
+
/** Additional channels to enable on top of the (recipe or default) config. */
|
|
20
|
+
readonly withChannels?: readonly WithChannel[];
|
|
21
|
+
/** Plan the scaffold and report it without writing anything. */
|
|
22
|
+
readonly dryRun?: boolean;
|
|
10
23
|
}
|
|
11
24
|
export interface InitMonoAgentFolderResult {
|
|
12
25
|
readonly dir: string;
|
|
13
26
|
readonly configPath: string;
|
|
14
27
|
readonly identityPath: string;
|
|
15
|
-
/** Files and directories created
|
|
28
|
+
/** Files and directories created (or, with dryRun, that would be created). */
|
|
16
29
|
readonly created: readonly string[];
|
|
17
30
|
/** Files that already existed and were left untouched (absolute paths). */
|
|
18
31
|
readonly skipped: readonly string[];
|
|
19
32
|
/** Existing knowledge files the generated identity references. */
|
|
20
33
|
readonly knowledgeFiles: readonly string[];
|
|
34
|
+
/** True when nothing was written because dryRun was set. */
|
|
35
|
+
readonly dryRun: boolean;
|
|
21
36
|
}
|
|
22
37
|
/**
|
|
23
|
-
* Non-destructively scaffolds a config-first mono-agent folder: a
|
|
24
|
-
* `mono-agent.config.json` (
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* never overwritten.
|
|
38
|
+
* Non-destructively scaffolds a config-first mono-agent folder: a
|
|
39
|
+
* `mono-agent.config.json` (from the default smoke scaffold or a recipe), an
|
|
40
|
+
* `IDENTITY.md` seeded from any knowledge files already in the folder, the
|
|
41
|
+
* `.mono-agent/` working directories, and — for recipes — a `.env.example` and
|
|
42
|
+
* any recipe files. Existing files are never overwritten. With `dryRun`, nothing
|
|
43
|
+
* is written and `created` reports what would have been.
|
|
28
44
|
*/
|
|
29
45
|
export declare function initMonoAgentFolder(options?: InitMonoAgentFolderOptions): Promise<InitMonoAgentFolderResult>;
|
|
30
46
|
//# sourceMappingURL=init.d.ts.map
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGzE,sEAAsE;AACtE,eAAO,MAAM,aAAa,gEAAiE,CAAC;AAC5F,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAEjE;AAED,MAAM,WAAW,0BAA0B;IACzC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,oFAAoF;IACpF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAC9C,mFAAmF;IACnF,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAC1C,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,kEAAkE;IAClE,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAKD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,yBAAyB,CAAC,CAqDpC"}
|
package/dist/init.js
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { mkdir, stat, writeFile } from "node:fs/promises";
|
|
2
|
-
import { basename, join, resolve } from "node:path";
|
|
2
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
3
3
|
import { writeMonoAgentConfigJson } from "@mono-agent/config";
|
|
4
|
+
import { resolveRecipeInputs } from "./recipes/index.js";
|
|
5
|
+
import { monoAgentConfigWithSchema } from "./config-reference.js";
|
|
6
|
+
/** Channels `--with` can switch on, merged onto a recipe's config. */
|
|
7
|
+
export const WITH_CHANNELS = ["telegram", "slack", "webhook", "openaiApi", "cron"];
|
|
8
|
+
export function isWithChannel(value) {
|
|
9
|
+
return WITH_CHANNELS.includes(value);
|
|
10
|
+
}
|
|
4
11
|
const DEFAULT_MODEL = "claude:claude-sonnet-4-6";
|
|
5
12
|
const KNOWLEDGE_FILE_CANDIDATES = ["AGENTS.md", "CLAUDE.md", "README.md", "SOUL.md"];
|
|
6
13
|
/**
|
|
7
|
-
* Non-destructively scaffolds a config-first mono-agent folder: a
|
|
8
|
-
* `mono-agent.config.json` (
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* never overwritten.
|
|
14
|
+
* Non-destructively scaffolds a config-first mono-agent folder: a
|
|
15
|
+
* `mono-agent.config.json` (from the default smoke scaffold or a recipe), an
|
|
16
|
+
* `IDENTITY.md` seeded from any knowledge files already in the folder, the
|
|
17
|
+
* `.mono-agent/` working directories, and — for recipes — a `.env.example` and
|
|
18
|
+
* any recipe files. Existing files are never overwritten. With `dryRun`, nothing
|
|
19
|
+
* is written and `created` reports what would have been.
|
|
12
20
|
*/
|
|
13
21
|
export async function initMonoAgentFolder(options = {}) {
|
|
14
22
|
const dir = resolve(options.dir ?? process.cwd());
|
|
23
|
+
const dryRun = options.dryRun === true;
|
|
15
24
|
const created = [];
|
|
16
25
|
const skipped = [];
|
|
17
26
|
const knowledgeFiles = [];
|
|
@@ -20,33 +29,84 @@ export async function initMonoAgentFolder(options = {}) {
|
|
|
20
29
|
knowledgeFiles.push(candidate);
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
async function planFile(path, write) {
|
|
33
|
+
if (await pathExists(path)) {
|
|
34
|
+
skipped.push(path);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!dryRun) {
|
|
38
|
+
await write();
|
|
39
|
+
}
|
|
40
|
+
created.push(path);
|
|
30
41
|
}
|
|
42
|
+
const identityPath = join(dir, "IDENTITY.md");
|
|
43
|
+
await planFile(identityPath, () => writeFile(identityPath, identityTemplate(dir, knowledgeFiles), { flag: "wx" }));
|
|
31
44
|
for (const subdir of [join(dir, ".mono-agent", "artifacts"), join(dir, ".mono-agent", "workspace")]) {
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
await planFile(subdir, () => mkdir(subdir, { recursive: true }));
|
|
46
|
+
}
|
|
47
|
+
const skillsRootExists = await pathExists(join(dir, "skills"));
|
|
48
|
+
const configJson = await resolveConfigJson(dir, options, skillsRootExists);
|
|
49
|
+
const configPath = join(dir, "mono-agent.config.json");
|
|
50
|
+
await planFile(configPath, () => writeMonoAgentConfigJson({ path: configPath, patch: configJson }));
|
|
51
|
+
if (options.recipe !== undefined) {
|
|
52
|
+
const inputs = resolveRecipeInputs(options.recipe, recipeOverrides(options.recipe, options));
|
|
53
|
+
const envExample = options.recipe.envExample?.(inputs);
|
|
54
|
+
if (envExample !== undefined && envExample.trim().length > 0) {
|
|
55
|
+
const envExamplePath = join(dir, ".env.example");
|
|
56
|
+
await planFile(envExamplePath, () => writeFile(envExamplePath, envExample, { flag: "wx" }));
|
|
34
57
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
58
|
+
for (const file of options.recipe.files?.(inputs) ?? []) {
|
|
59
|
+
const filePath = join(dir, file.path);
|
|
60
|
+
await planFile(filePath, async () => {
|
|
61
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
62
|
+
await writeFile(filePath, file.contents, { flag: "wx" });
|
|
63
|
+
});
|
|
38
64
|
}
|
|
39
65
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
66
|
+
return { dir, configPath, identityPath, created, skipped, knowledgeFiles, dryRun };
|
|
67
|
+
}
|
|
68
|
+
function recipeOverrides(recipe, options) {
|
|
69
|
+
const overrides = { ...(options.recipeInputs ?? {}) };
|
|
70
|
+
for (const input of recipe.inputs) {
|
|
71
|
+
if (input.secret === true) {
|
|
72
|
+
delete overrides[input.id];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (options.model !== undefined) {
|
|
76
|
+
overrides.model = options.model;
|
|
77
|
+
}
|
|
78
|
+
return overrides;
|
|
79
|
+
}
|
|
80
|
+
async function resolveConfigJson(dir, options, skillsRootExists) {
|
|
81
|
+
if (options.recipe !== undefined) {
|
|
82
|
+
const inputs = resolveRecipeInputs(options.recipe, recipeOverrides(options.recipe, options));
|
|
83
|
+
return monoAgentConfigWithSchema(withChannels(withRuntimeOverrides(options.recipe.config(inputs), options), options.withChannels ?? []));
|
|
84
|
+
}
|
|
85
|
+
return monoAgentConfigWithSchema(withChannels(configTemplate(dir, options, skillsRootExists), options.withChannels ?? []));
|
|
86
|
+
}
|
|
87
|
+
function withRuntimeOverrides(config, options) {
|
|
88
|
+
const fallbackModels = (options.fallbackModels ?? []).filter((entry) => entry.trim().length > 0);
|
|
89
|
+
if (fallbackModels.length === 0) {
|
|
90
|
+
return config;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
...config,
|
|
94
|
+
runtime: {
|
|
95
|
+
...(config.runtime ?? {}),
|
|
96
|
+
fallbackModels,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** Switch on additional channels by merging `{ <channel>: { enabled: true } }`. */
|
|
101
|
+
function withChannels(config, channels) {
|
|
102
|
+
if (channels.length === 0) {
|
|
103
|
+
return config;
|
|
43
104
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
created.push(configPath);
|
|
105
|
+
const extra = {};
|
|
106
|
+
for (const channel of channels) {
|
|
107
|
+
extra[channel] = { enabled: true };
|
|
48
108
|
}
|
|
49
|
-
return {
|
|
109
|
+
return { ...config, ...extra };
|
|
50
110
|
}
|
|
51
111
|
function configTemplate(dir, options, skillsRootExists) {
|
|
52
112
|
const fallbackModels = (options.fallbackModels ?? []).filter((entry) => entry.trim().length > 0);
|
|
@@ -76,6 +136,11 @@ function configTemplate(dir, options, skillsRootExists) {
|
|
|
76
136
|
},
|
|
77
137
|
artifacts: {
|
|
78
138
|
dir: "./.mono-agent/artifacts",
|
|
139
|
+
retention: {
|
|
140
|
+
maxAgeDays: 365,
|
|
141
|
+
maxCount: 50000,
|
|
142
|
+
dryRun: false,
|
|
143
|
+
},
|
|
79
144
|
},
|
|
80
145
|
traceability: {
|
|
81
146
|
registryDir: "./.mono-agent/trace-sources",
|
package/dist/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,sEAAsE;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,CAAU,CAAC;AAG5F,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAmCD,MAAM,aAAa,GAAG,0BAA0B,CAAC;AACjD,MAAM,yBAAyB,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAA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AAgB,CAAC,GAAW,EAAE,cAAiC;IACtE,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,KAAK,CAAC;QAClD,CAAC,CAAC,6EAA6E;QAC/E,CAAC,CAAC;YACE,wEAAwE;YACxE,EAAE;YACF,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC;SACjD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjB,OAAO;;0CAEiC,QAAQ,CAAC,GAAG,CAAC;;;;;;;;EAQrD,gBAAgB;;;;;;;CAOjB,CAAC;AACF,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/install-skill.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface InstallSkillResult {
|
|
|
14
14
|
export declare const COMPOSER_SKILL_NAME = "mono-agent-composer";
|
|
15
15
|
/**
|
|
16
16
|
* Copies the bundled mono-agent-composer skill into the harness skill folders
|
|
17
|
-
* (~/.claude/skills and/or ~/.
|
|
17
|
+
* (~/.claude/skills and/or ~/.agents/skills) so Claude Code and Codex can use
|
|
18
18
|
* it to compose new agents.
|
|
19
19
|
*/
|
|
20
20
|
export declare function installComposerSkill(options: InstallSkillOptions): Promise<InstallSkillResult>;
|
package/dist/install-skill.js
CHANGED
|
@@ -8,11 +8,11 @@ export const COMPOSER_SKILL_NAME = "mono-agent-composer";
|
|
|
8
8
|
const BUNDLED_SKILL_DIR = fileURLToPath(new URL(`../skills/${COMPOSER_SKILL_NAME}`, import.meta.url));
|
|
9
9
|
const TARGET_HARNESS_DIRS = {
|
|
10
10
|
claude: ".claude",
|
|
11
|
-
codex: ".
|
|
11
|
+
codex: ".agents",
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Copies the bundled mono-agent-composer skill into the harness skill folders
|
|
15
|
-
* (~/.claude/skills and/or ~/.
|
|
15
|
+
* (~/.claude/skills and/or ~/.agents/skills) so Claude Code and Codex can use
|
|
16
16
|
* it to compose new agents.
|
|
17
17
|
*/
|
|
18
18
|
export async function installComposerSkill(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../src/install-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkBzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,8EAA8E;AAC9E,+EAA+E;AAC/E,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,aAAa,mBAAmB,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtG,MAAM,mBAAmB,GAAkE;IACzF,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../src/install-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkBzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,8EAA8E;AAC9E,+EAA+E;AAC/E,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAA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W,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,SAAiB;IAChD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,wCAAwC,SAAS,6BAA6B,CAAC,CAAC;IAClG,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interaction bridge: the app-owned loopback HTTP surface that lets tool child
|
|
3
|
+
* processes (adapter-send-tools, project MCP servers) interact with the human
|
|
4
|
+
* behind a channel conversation while a tool call is in flight.
|
|
5
|
+
*
|
|
6
|
+
* Two capabilities share it:
|
|
7
|
+
* - Blocking `ask_user`: POST /v1/asks registers a pending ask (question posted
|
|
8
|
+
* through the channel's sink); the tool long-polls GET /v1/asks/:id until the
|
|
9
|
+
* channel intercepts the user's next message and resolves it.
|
|
10
|
+
* - Tool progress: POST /v1/progress fans out to the channel sink's postStatus
|
|
11
|
+
* (e.g. a Telegram status message edited in place).
|
|
12
|
+
*
|
|
13
|
+
* The registry is in-memory by design: on an app restart pending asks vanish and
|
|
14
|
+
* the user's later reply simply arrives as a normal next turn (multi-turn
|
|
15
|
+
* degradation), which the ask_user tool description tells the model to expect.
|
|
16
|
+
*/
|
|
17
|
+
export interface ChannelInteractionSink {
|
|
18
|
+
/** Post a free-text question to the conversation's chat. */
|
|
19
|
+
postQuestion(conversationId: string, text: string): Promise<void>;
|
|
20
|
+
/** Post (or edit in place, per `key`) a short tool-progress status line. */
|
|
21
|
+
postStatus(conversationId: string, text: string, options: {
|
|
22
|
+
readonly key: string;
|
|
23
|
+
readonly state: "working" | "done" | "failed";
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export interface InteractionBridgeOptions {
|
|
27
|
+
readonly host?: string;
|
|
28
|
+
/** TCP port; 0 picks an ephemeral port. Default {@link DEFAULT_INTERACTION_BRIDGE_PORT}. */
|
|
29
|
+
readonly port?: number;
|
|
30
|
+
/** Default + upper bound for a single ask's wait (ms). Default 10 minutes. */
|
|
31
|
+
readonly askTimeoutMs?: number;
|
|
32
|
+
readonly logger?: {
|
|
33
|
+
warn?: (message: string, metadata?: Record<string, unknown>) => void;
|
|
34
|
+
debug?: (message: string, metadata?: Record<string, unknown>) => void;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface InteractionBridgeHandle {
|
|
38
|
+
readonly url: string;
|
|
39
|
+
readonly token: string;
|
|
40
|
+
registerSink(channelId: string, sink: ChannelInteractionSink): void;
|
|
41
|
+
/** Resolve the conversation's pending ask with the user's reply; true when consumed. */
|
|
42
|
+
tryResolveAsk(conversationId: string, answer: string): boolean;
|
|
43
|
+
/** Fail every pending ask on the conversation (user cancelled the run). */
|
|
44
|
+
cancelAsks(conversationId: string): void;
|
|
45
|
+
/** Environment consumed by tool child processes (ask_user, project MCP servers). */
|
|
46
|
+
env(): Record<string, string>;
|
|
47
|
+
stop(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
/** Default port 0 = ephemeral: consumers get the URL via env, so a fixed port only invites collisions. */
|
|
50
|
+
export declare const DEFAULT_INTERACTION_BRIDGE_PORT = 0;
|
|
51
|
+
export declare const DEFAULT_ASK_USER_TIMEOUT_MS = 600000;
|
|
52
|
+
/** Resolved `interaction` config block (JSON `interaction` key + env overrides). */
|
|
53
|
+
export interface InteractionSettings {
|
|
54
|
+
/** True when the operator explicitly configured the block (JSON or env). */
|
|
55
|
+
readonly configured: boolean;
|
|
56
|
+
readonly host: string;
|
|
57
|
+
readonly port: number;
|
|
58
|
+
readonly askTimeoutMs: number;
|
|
59
|
+
readonly progressEnabled: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Load the app-level `interaction` block from `mono-agent.config.json` with env
|
|
63
|
+
* overrides (`MONO_AGENT_INTERACTION_BRIDGE_HOST/PORT`,
|
|
64
|
+
* `MONO_AGENT_ASK_USER_TIMEOUT_MS`, `MONO_AGENT_PROGRESS_ENABLED`). Tolerant of
|
|
65
|
+
* a missing file/block: returns unconfigured defaults.
|
|
66
|
+
*/
|
|
67
|
+
export declare function loadInteractionSettings(input: {
|
|
68
|
+
readonly env: Record<string, string | undefined>;
|
|
69
|
+
readonly configPath: string;
|
|
70
|
+
}): Promise<InteractionSettings>;
|
|
71
|
+
export declare function startInteractionBridge(options?: InteractionBridgeOptions): Promise<InteractionBridgeHandle>;
|
|
72
|
+
//# sourceMappingURL=interaction-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-bridge.d.ts","sourceRoot":"","sources":["../src/interaction-bridge.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,4EAA4E;IAC5E,UAAU,CACR,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAA;KAAE,GAC/E,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,4FAA4F;IAC5F,QAAQ,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