@geminixiang/mikan 1.1.0 → 1.2.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/CHANGELOG.md +34 -0
- package/dist/adapters/messages.d.ts +1 -0
- package/dist/adapters/messages.d.ts.map +1 -1
- package/dist/adapters/messages.js +3 -0
- package/dist/adapters/messages.js.map +1 -1
- package/dist/adapters/slack/bot.d.ts.map +1 -1
- package/dist/adapters/slack/bot.js +8 -2
- package/dist/adapters/slack/bot.js.map +1 -1
- package/dist/env-manifest.js +1 -1
- package/dist/env-manifest.js.map +1 -1
- package/dist/events/scheduler.js +1 -1
- package/dist/events/scheduler.js.map +1 -1
- package/dist/harness/jev.d.ts +12 -11
- package/dist/harness/jev.d.ts.map +1 -1
- package/dist/harness/jev.js +67 -70
- package/dist/harness/jev.js.map +1 -1
- package/dist/harness/models.d.ts.map +1 -1
- package/dist/harness/models.js +36 -7
- package/dist/harness/models.js.map +1 -1
- package/dist/harness/presenter.d.ts.map +1 -1
- package/dist/harness/presenter.js +1 -19
- package/dist/harness/presenter.js.map +1 -1
- package/dist/harness/prompt.d.ts +1 -1
- package/dist/harness/prompt.d.ts.map +1 -1
- package/dist/harness/prompt.js +7 -12
- package/dist/harness/prompt.js.map +1 -1
- package/dist/harness/runner.d.ts.map +1 -1
- package/dist/harness/runner.js +8 -1
- package/dist/harness/runner.js.map +1 -1
- package/dist/harness/tools/index.d.ts +2 -1
- package/dist/harness/tools/index.d.ts.map +1 -1
- package/dist/harness/tools/index.js +2 -2
- package/dist/harness/tools/index.js.map +1 -1
- package/dist/harness/tools/jev-browser.d.ts +2 -1
- package/dist/harness/tools/jev-browser.d.ts.map +1 -1
- package/dist/harness/tools/jev-browser.js +18 -50
- package/dist/harness/tools/jev-browser.js.map +1 -1
- package/dist/harness/tools/jev.d.ts.map +1 -1
- package/dist/harness/tools/jev.js +2 -2
- package/dist/harness/tools/jev.js.map +1 -1
- package/dist/harness/tools/react.js +1 -1
- package/dist/harness/tools/react.js.map +1 -1
- package/dist/main.js +8 -2
- package/dist/main.js.map +1 -1
- package/dist/sessions/session-store.d.ts +2 -1
- package/dist/sessions/session-store.d.ts.map +1 -1
- package/dist/sessions/session-store.js +20 -0
- package/dist/sessions/session-store.js.map +1 -1
- package/dist/sessions/types.d.ts +1 -0
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js.map +1 -1
- package/dist/settings/index.d.ts +6 -0
- package/dist/settings/index.d.ts.map +1 -1
- package/dist/settings/index.js +5 -0
- package/dist/settings/index.js.map +1 -1
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,40 @@ change in a minor release.
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [1.2.0] - 2026-10-09
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Jev can run on any service that speaks TypeSafe's System One protocol, such as an LLM gateway.
|
|
19
|
+
Set `jev` in `settings.json` to a provider and model, and declare that model in `models.json`
|
|
20
|
+
with `"type": "classifier"` and `"api": "typesafe-system-one"`; mikan sends it to
|
|
21
|
+
`<baseUrl>/systemone` with the provider's key. Without the setting Jev stays on OpenRouter.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- `jev_browser` writes text for form fields with the conversation's chat model instead of
|
|
26
|
+
`openai/gpt-4o-mini` on OpenRouter, so it no longer needs `OPENROUTER_API_KEY`.
|
|
27
|
+
- Jev decisions go through pi-ai's classifier support instead of `@geminixiang/jev`, which is
|
|
28
|
+
removed. The model, `OPENROUTER_API_KEY`, timeout, and retries stay the same; requests go to
|
|
29
|
+
OpenRouter's System One endpoint, a text state is sent as `{ "text": … }`, score answers no
|
|
30
|
+
longer carry per-level probabilities, and cost is the token count at pi-ai's catalog price.
|
|
31
|
+
- A periodic event run always posts its answer. The `[SILENT]` reply that deleted the message
|
|
32
|
+
is removed, along with the prompt rules that told the agent to use it or to react with eyes
|
|
33
|
+
instead of reporting nothing new, because a job that kept answering `[SILENT]` could stall for
|
|
34
|
+
days without anyone noticing. An event whose own text still asks for `[SILENT]` now posts that
|
|
35
|
+
text; edit the event to say what it should report instead.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- A DM task resumes after a restart at most twice in a row. Before, a task whose step crashed
|
|
40
|
+
the daemon was resumed on every restart for up to 24 hours, crashing it again each time; now
|
|
41
|
+
the third interruption stops the task and says so once in its thread.
|
|
42
|
+
- A scheduled event's reply no longer ends with two signatures. The system prompt told the agent
|
|
43
|
+
that event messages start with an `[EVENT:<file>:…]` prefix, which events stopped carrying in
|
|
44
|
+
May, so the agent signed the reply as `[event: unknown]` and mikan added the real signature.
|
|
45
|
+
An event run is now told its event file in the Event Trigger Mode instructions, and a message
|
|
46
|
+
that starts with a typed `[EVENT:` marker is no longer attributed to an event.
|
|
47
|
+
|
|
14
48
|
## [1.1.0] - 2026-10-08
|
|
15
49
|
|
|
16
50
|
### Added
|
|
@@ -6,6 +6,7 @@ export declare function formatStopping(source: PlatformSource): string;
|
|
|
6
6
|
export declare function formatStopped(source: PlatformSource): string;
|
|
7
7
|
export declare function formatRestarting(source: PlatformSource): string;
|
|
8
8
|
export declare function formatResumingTask(source: PlatformSource): string;
|
|
9
|
+
export declare function formatTaskResumesExhausted(source: PlatformSource): string;
|
|
9
10
|
export declare function formatAlreadyWorking(source: PlatformSource, stopCommand: string, options?: {
|
|
10
11
|
scope?: "thread";
|
|
11
12
|
}): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/adapters/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE/D,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC,KAAK,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,CAAC;AAoB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,EAAE,cAAc,EACtB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,QAAQ,CAAA;CAAE,GAC7B,MAAM,CAMR;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAErF"}
|
|
@@ -30,6 +30,9 @@ export function formatRestarting(source) {
|
|
|
30
30
|
export function formatResumingTask(source) {
|
|
31
31
|
return formatItalic(resolvePlatformName(source), "Restarted for an update; continuing this task.");
|
|
32
32
|
}
|
|
33
|
+
export function formatTaskResumesExhausted(source) {
|
|
34
|
+
return formatItalic(resolvePlatformName(source), "Interrupted again after two automatic restarts; not continuing this task. Ask me to continue when you are ready.");
|
|
35
|
+
}
|
|
33
36
|
export function formatAlreadyWorking(source, stopCommand, options) {
|
|
34
37
|
const platformName = resolvePlatformName(source);
|
|
35
38
|
const command = formatCode(platformName, stopCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/adapters/messages.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AAIpC,SAAS,mBAAmB,CAAC,MAAsB;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC9C,IAAI,kBAAkB,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC;IACxE,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,SAAS,sBAAsB,CAAC,YAAoB;IAClD,OAAO,YAAY,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,YAAY,CAAC,YAAoB,EAAE,IAAY;IACtD,OAAO,sBAAsB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC;AACnE,CAAC;AAED,SAAS,UAAU,CA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3E,OAAO,YAAY,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,oBAAoB,UAAU,GAAG,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { MessagingBot, MessagingInfo } from \"../types.js\";\n\nexport const PRODUCT_NAME = \"mikan\";\n\ntype PlatformSource = MessagingBot | MessagingInfo | string;\n\nfunction resolvePlatformName(source: PlatformSource): string {\n if (typeof source === \"string\") return source;\n if (\"getMessagingInfo\" in source) return source.getMessagingInfo().name;\n return source.name;\n}\n\nfunction supportsHtmlFormatting(platformName: string): boolean {\n return platformName === \"telegram\";\n}\n\nfunction formatItalic(platformName: string, text: string): string {\n return supportsHtmlFormatting(platformName) ? text : `_${text}_`;\n}\n\nfunction formatCode(platformName: string, text: string): string {\n return supportsHtmlFormatting(platformName) ? `<code>${text}</code>` : `\\`${text}\\``;\n}\n\nexport function formatNothingRunning(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Nothing running.\");\n}\n\nexport function formatStopping(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Stopping…\");\n}\n\nexport function formatStopped(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Stopped.\");\n}\n\nexport function formatRestarting(source: PlatformSource): string {\n return formatItalic(\n resolvePlatformName(source),\n \"Restarting for an update; this reply was interrupted. Please send your message again.\",\n );\n}\n\nexport function formatResumingTask(source: PlatformSource): string {\n return formatItalic(\n resolvePlatformName(source),\n \"Restarted for an update; continuing this task.\",\n );\n}\n\nexport function formatAlreadyWorking(\n source: PlatformSource,\n stopCommand: string,\n options?: { scope?: \"thread\" },\n): string {\n const platformName = resolvePlatformName(source);\n const command = formatCode(platformName, stopCommand);\n const prefix =\n options?.scope === \"thread\" ? \"Already working in this thread.\" : \"Already working.\";\n return formatItalic(platformName, `${prefix} Send ${command} to cancel.`);\n}\n\nexport function formatForceStopped(source: PlatformSource, actorLabel: string): string {\n return formatItalic(resolvePlatformName(source), `Force stopped by ${actorLabel}.`);\n}\n"]}
|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EAC3B,uFAAuF,CACxF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,OAAO,YAAY,CACjB,mBAAmB,CAAC,MAAM,CAAC,EAC3B,gDAAgD,CACjD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,MAAsB;IAC/D,OAAO,YAAY,CACjB,mBAAmB,CAAC,MAAM,CAAC,EAC3B,kHAAkH,CACnH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,MAAsB,EACtB,WAAmB,EACnB,OAA8B;IAE9B,MAAM,YAAY,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IACtD,MAAM,MAAM,GACV,OAAO,EAAE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,kBAAkB,CAAC;IACvF,OAAO,YAAY,CAAC,YAAY,EAAE,GAAG,MAAM,SAAS,OAAO,aAAa,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAsB,EAAE,UAAkB;IAC3E,OAAO,YAAY,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,oBAAoB,UAAU,GAAG,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { MessagingBot, MessagingInfo } from \"../types.js\";\n\nexport const PRODUCT_NAME = \"mikan\";\n\ntype PlatformSource = MessagingBot | MessagingInfo | string;\n\nfunction resolvePlatformName(source: PlatformSource): string {\n if (typeof source === \"string\") return source;\n if (\"getMessagingInfo\" in source) return source.getMessagingInfo().name;\n return source.name;\n}\n\nfunction supportsHtmlFormatting(platformName: string): boolean {\n return platformName === \"telegram\";\n}\n\nfunction formatItalic(platformName: string, text: string): string {\n return supportsHtmlFormatting(platformName) ? text : `_${text}_`;\n}\n\nfunction formatCode(platformName: string, text: string): string {\n return supportsHtmlFormatting(platformName) ? `<code>${text}</code>` : `\\`${text}\\``;\n}\n\nexport function formatNothingRunning(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Nothing running.\");\n}\n\nexport function formatStopping(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Stopping…\");\n}\n\nexport function formatStopped(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Stopped.\");\n}\n\nexport function formatRestarting(source: PlatformSource): string {\n return formatItalic(\n resolvePlatformName(source),\n \"Restarting for an update; this reply was interrupted. Please send your message again.\",\n );\n}\n\nexport function formatResumingTask(source: PlatformSource): string {\n return formatItalic(\n resolvePlatformName(source),\n \"Restarted for an update; continuing this task.\",\n );\n}\n\nexport function formatTaskResumesExhausted(source: PlatformSource): string {\n return formatItalic(\n resolvePlatformName(source),\n \"Interrupted again after two automatic restarts; not continuing this task. Ask me to continue when you are ready.\",\n );\n}\n\nexport function formatAlreadyWorking(\n source: PlatformSource,\n stopCommand: string,\n options?: { scope?: \"thread\" },\n): string {\n const platformName = resolvePlatformName(source);\n const command = formatCode(platformName, stopCommand);\n const prefix =\n options?.scope === \"thread\" ? \"Already working in this thread.\" : \"Already working.\";\n return formatItalic(platformName, `${prefix} Send ${command} to cancel.`);\n}\n\nexport function formatForceStopped(source: PlatformSource, actorLabel: string): string {\n return formatItalic(resolvePlatformName(source), `Force stopped by ${actorLabel}.`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../../src/adapters/slack/bot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AASxE,OAAO,KAAK,EACV,YAAY,EAEZ,iBAAiB,EACjB,qBAAqB,EAIrB,aAAa,EAGd,MAAM,gBAAgB,CAAC;AAexB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAGV,YAAY,E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BAAkB;YA0FlB,kBAAkB;IAmChC,OAAO,CAAC,mBAAmB;YAsBb,iBAAiB;YAgDjB,sBAAsB;YAqFtB,kBAAkB;YA8BlB,iBAAiB;YAmBjB,cAAc;YA0Bd,8BAA8B;YAoC9B,qBAAqB;IAiBnC,OAAO,CAAC,qBAAqB;YAaf,eAAe;YAmEf,mBAAmB;YA+BnB,UAAU;YA0BV,aAAa;CAgD5B"}
|
|
@@ -12,7 +12,7 @@ import { evaluateWithJev, JevNotConfiguredError } from "../../harness/jev.js";
|
|
|
12
12
|
import * as log from "../../log.js";
|
|
13
13
|
import { SlackSocketAgent } from "./socket-agent.js";
|
|
14
14
|
import { readTextFileNoFollowIfExists } from "../../file-guards.js";
|
|
15
|
-
import { PRODUCT_NAME, formatForceStopped, formatResumingTask } from "../messages.js";
|
|
15
|
+
import { PRODUCT_NAME, formatForceStopped, formatResumingTask, formatTaskResumesExhausted, } from "../messages.js";
|
|
16
16
|
import { MessagingEventQueue, MessagingIntakeTracker, AttachmentRejectedError, saveIncomingAttachments, writeResponseToFile, withRetry, } from "../shared.js";
|
|
17
17
|
import { matchMagicWord, processMessageIntake } from "../intake.js";
|
|
18
18
|
import { readPlatformChannelKind, recordPlatformChannelKind } from "../../office/projection.js";
|
|
@@ -31,6 +31,7 @@ import { StreamStartLimiter } from "./stream-limits.js";
|
|
|
31
31
|
import { errorMessage, isRecord } from "../../unknown-values.js";
|
|
32
32
|
const SLACK_EVENT_ANCHOR_TEXT = "Working on it...";
|
|
33
33
|
const TASK_RESUME_WINDOW_MS = 24 * 60 * 60 * 1000;
|
|
34
|
+
const MAX_TASK_RESUMES = 2;
|
|
34
35
|
function hasMessageContent(message, includeBlocks = true) {
|
|
35
36
|
const content = [message.text, message.files];
|
|
36
37
|
if (includeBlocks)
|
|
@@ -728,6 +729,11 @@ export class SlackMessagingBot {
|
|
|
728
729
|
continue;
|
|
729
730
|
for (const sessionKey of interrupted) {
|
|
730
731
|
const root = keys.get(sessionKey);
|
|
732
|
+
if ((await SessionStore.claimResume(office, sessionKey, MAX_TASK_RESUMES)) === "exhausted") {
|
|
733
|
+
log.logInfo(`Not resuming task ${sessionKey}: interrupted after ${MAX_TASK_RESUMES} resumes`);
|
|
734
|
+
await this.postInThread(channelId, root, formatTaskResumesExhausted(this));
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
731
737
|
log.logInfo(`Resuming interrupted task ${sessionKey}`);
|
|
732
738
|
await this.postInThread(channelId, root, formatResumingTask(this));
|
|
733
739
|
this.enqueueTaskRun({
|
|
@@ -1258,7 +1264,7 @@ export class SlackMessagingBot {
|
|
|
1258
1264
|
}
|
|
1259
1265
|
catch (err) {
|
|
1260
1266
|
if (err instanceof JevNotConfiguredError) {
|
|
1261
|
-
log.logWarning("Slack auto-reply jev mode
|
|
1267
|
+
log.logWarning("Slack auto-reply jev mode has no Jev model available; treating message as unaddressed", String(err));
|
|
1262
1268
|
return false;
|
|
1263
1269
|
}
|
|
1264
1270
|
reportUserFacingError(err, {
|