@otea/cli 0.0.1 → 0.1.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/LICENSE +661 -0
- package/README.es.md +151 -0
- package/README.md +251 -3
- package/THIRD_PARTY_NOTICES.md +114 -0
- package/bin/otea.mjs +28 -0
- package/dist/app/agent-detail.js +26 -0
- package/dist/app/agent-draft.js +429 -0
- package/dist/app/agent-prompts.js +52 -0
- package/dist/app/agents.js +77 -0
- package/dist/app/asking.js +43 -0
- package/dist/app/board-archive.js +243 -0
- package/dist/app/board-migration.js +272 -0
- package/dist/app/boards.js +870 -0
- package/dist/app/branch-owner.js +48 -0
- package/dist/app/brief.js +53 -0
- package/dist/app/choices.js +61 -0
- package/dist/app/collections.js +101 -0
- package/dist/app/context.js +1 -0
- package/dist/app/crop.js +56 -0
- package/dist/app/devices.js +62 -0
- package/dist/app/draft-request.js +82 -0
- package/dist/app/events.js +12 -0
- package/dist/app/evidence.js +287 -0
- package/dist/app/gates.js +610 -0
- package/dist/app/guide.js +37 -0
- package/dist/app/home.js +145 -0
- package/dist/app/init-boards.js +36 -0
- package/dist/app/intake.js +25 -0
- package/dist/app/item-search.js +141 -0
- package/dist/app/items.js +318 -0
- package/dist/app/keep-waiting.js +44 -0
- package/dist/app/land-order.js +107 -0
- package/dist/app/language.js +52 -0
- package/dist/app/launcher.js +56 -0
- package/dist/app/lease-take.js +54 -0
- package/dist/app/leases.js +86 -0
- package/dist/app/machine.js +39 -0
- package/dist/app/merged.js +89 -0
- package/dist/app/migrate.js +171 -0
- package/dist/app/next.js +1637 -0
- package/dist/app/notes.js +319 -0
- package/dist/app/notify-targets.js +113 -0
- package/dist/app/opened.js +25 -0
- package/dist/app/owner-only.js +34 -0
- package/dist/app/performance.js +28 -0
- package/dist/app/phone.js +97 -0
- package/dist/app/presence.js +596 -0
- package/dist/app/preset-views.js +25 -0
- package/dist/app/presets.js +129 -0
- package/dist/app/priority.js +156 -0
- package/dist/app/profile.js +86 -0
- package/dist/app/project.js +247 -0
- package/dist/app/proofs.js +179 -0
- package/dist/app/questions.js +215 -0
- package/dist/app/reader-filter.js +58 -0
- package/dist/app/relations.js +164 -0
- package/dist/app/relay.js +98 -0
- package/dist/app/repos.js +176 -0
- package/dist/app/restart.js +92 -0
- package/dist/app/set-aside.js +64 -0
- package/dist/app/system-locale.js +6 -0
- package/dist/app/tailscale-cli.js +77 -0
- package/dist/app/tailscale-testing.js +41 -0
- package/dist/app/tailscale.js +177 -0
- package/dist/app/tips.js +30 -0
- package/dist/app/topics-everywhere.js +53 -0
- package/dist/app/topics.js +453 -0
- package/dist/app/undo.js +52 -0
- package/dist/app/validate.js +131 -0
- package/dist/app/watch.js +48 -0
- package/dist/cli/command.js +44 -0
- package/dist/cli/commands.js +3303 -0
- package/dist/cli/exit-codes.js +70 -0
- package/dist/cli/forge.js +176 -0
- package/dist/cli/format.js +340 -0
- package/dist/cli/gh.js +17 -0
- package/dist/cli/gitrepo.js +489 -0
- package/dist/cli/help.js +101 -0
- package/dist/cli/hooks.js +232 -0
- package/dist/cli/main.js +37 -0
- package/dist/cli/merged-outside.js +58 -0
- package/dist/cli/names.js +154 -0
- package/dist/cli/opener.js +21 -0
- package/dist/cli/owner.js +154 -0
- package/dist/cli/phone.js +221 -0
- package/dist/cli/ports.js +24 -0
- package/dist/cli/probe.js +18 -0
- package/dist/cli/run.js +246 -0
- package/dist/cli/serve-file.js +21 -0
- package/dist/cli/stats.js +55 -0
- package/dist/cli/version.js +3 -0
- package/dist/core/agent-guide.js +31 -0
- package/dist/core/agent-prompts.js +139 -0
- package/dist/core/authority.js +94 -0
- package/dist/core/board/analysis.js +86 -0
- package/dist/core/board/choices.js +100 -0
- package/dist/core/board/compile.js +362 -0
- package/dist/core/board/engine.js +523 -0
- package/dist/core/board/hints.js +46 -0
- package/dist/core/board/history.js +146 -0
- package/dist/core/board/ids.js +87 -0
- package/dist/core/board/joins.js +30 -0
- package/dist/core/board/mentions.js +68 -0
- package/dist/core/board/merged.js +18 -0
- package/dist/core/board/model.js +135 -0
- package/dist/core/board/next.js +1116 -0
- package/dist/core/board/notes.js +298 -0
- package/dist/core/board/performance.js +218 -0
- package/dist/core/board/plan.js +299 -0
- package/dist/core/board/problems.js +232 -0
- package/dist/core/board/proofs.js +84 -0
- package/dist/core/board/questions.js +114 -0
- package/dist/core/board/reading.js +220 -0
- package/dist/core/board/readings.js +534 -0
- package/dist/core/board/schema.js +335 -0
- package/dist/core/board/shape-words.js +179 -0
- package/dist/core/board/template-words.js +23 -0
- package/dist/core/board/templates-catalogue.js +965 -0
- package/dist/core/board/templates-coverage.js +261 -0
- package/dist/core/board/templates-flows.js +779 -0
- package/dist/core/board/templates.js +586 -0
- package/dist/core/brief.js +93 -0
- package/dist/core/diagram.js +80 -0
- package/dist/core/errors.js +12 -0
- package/dist/core/evidence.js +33 -0
- package/dist/core/fields.js +129 -0
- package/dist/core/hierarchy.js +30 -0
- package/dist/core/icons.js +181 -0
- package/dist/core/image-crop.js +166 -0
- package/dist/core/item.js +49 -0
- package/dist/core/lease.js +31 -0
- package/dist/core/modules.js +318 -0
- package/dist/core/notify/planner.js +117 -0
- package/dist/core/notify/signals.js +66 -0
- package/dist/core/notify/text.js +60 -0
- package/dist/core/path-key.js +22 -0
- package/dist/core/placement.js +161 -0
- package/dist/core/preset-labels.js +66 -0
- package/dist/core/preset-notes.js +109 -0
- package/dist/core/preset.js +541 -0
- package/dist/core/profile.js +55 -0
- package/dist/core/project-id.js +20 -0
- package/dist/core/refusal.js +1 -0
- package/dist/core/relations.js +208 -0
- package/dist/core/repo.js +54 -0
- package/dist/core/samples.js +161 -0
- package/dist/core/search-words.js +68 -0
- package/dist/core/test-report.js +120 -0
- package/dist/core/time.js +8 -0
- package/dist/core/validation.js +60 -0
- package/dist/core/views.js +171 -0
- package/dist/core/workflow.js +51 -0
- package/dist/mcp/commands.js +101 -0
- package/dist/mcp/server.js +239 -0
- package/dist/mcp/words.js +95 -0
- package/dist/server/boards.js +232 -0
- package/dist/server/changes.js +42 -0
- package/dist/server/diff-tip.js +83 -0
- package/dist/server/drift.js +87 -0
- package/dist/server/errors.js +87 -0
- package/dist/server/evidence.js +82 -0
- package/dist/server/hosts.js +6 -0
- package/dist/server/hub.js +98 -0
- package/dist/server/lan-access.js +62 -0
- package/dist/server/lan.js +164 -0
- package/dist/server/listen.js +70 -0
- package/dist/server/notifier.js +156 -0
- package/dist/server/notify-api.js +151 -0
- package/dist/server/pairing.js +124 -0
- package/dist/server/projects.js +191 -0
- package/dist/server/push.js +199 -0
- package/dist/server/server.js +960 -0
- package/dist/server/session.js +43 -0
- package/dist/server/stream.js +36 -0
- package/dist/server/test-push.js +38 -0
- package/dist/server/token.js +37 -0
- package/dist/server/transports.js +54 -0
- package/dist/server/ui.js +44 -0
- package/dist/server/writes.js +361 -0
- package/dist/server/wrong-address.js +36 -0
- package/dist/store/boards.js +111 -0
- package/dist/store/database.js +45 -0
- package/dist/store/machine.js +77 -0
- package/dist/store/migrations.js +493 -0
- package/dist/store/queries.js +585 -0
- package/dist/store/registry.js +72 -0
- package/package.json +72 -4
- package/presets/architecture/playbook.md +69 -0
- package/presets/architecture/preset.yaml +80 -0
- package/presets/architecture/samples.yaml +23 -0
- package/presets/bug-triage/playbook.md +129 -0
- package/presets/bug-triage/preset.yaml +127 -0
- package/presets/bug-triage/samples/wall-slide-after.png +0 -0
- package/presets/bug-triage/samples/wall-slide-before.png +0 -0
- package/presets/bug-triage/samples.yaml +72 -0
- package/presets/change/playbook.md +115 -0
- package/presets/change/preset.yaml +141 -0
- package/presets/change/samples.yaml +62 -0
- package/presets/review/playbook.md +51 -0
- package/presets/review/preset.yaml +62 -0
- package/presets/review/samples.yaml +27 -0
- package/presets/tasks/playbook.md +78 -0
- package/presets/tasks/preset.yaml +61 -0
- package/presets/tasks/samples.yaml +46 -0
- package/schemas/board.schema.json +764 -0
- package/ui/dist/THIRD_PARTY_NOTICES.md +114 -0
- package/ui/dist/assets/dm-mono-latin-400-normal--0xN8mdc.woff +0 -0
- package/ui/dist/assets/dm-mono-latin-400-normal-4GdczIuU.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-500-normal-CN8Miw6E.woff +0 -0
- package/ui/dist/assets/dm-mono-latin-500-normal-DRMDZjhP.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-400-normal-1aZr6b2b.woff +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-400-normal-C2zvOubV.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-500-normal-BtRyHRi6.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-500-normal-Dw3M13d8.woff +0 -0
- package/ui/dist/assets/index-C3OzJope.js +103 -0
- package/ui/dist/assets/index-COdEjckQ.css +1 -0
- package/ui/dist/assets/newsreader-latin-ext-opsz-italic-CSPGnFdO.woff2 +0 -0
- package/ui/dist/assets/newsreader-latin-ext-opsz-normal-BQn1nviT.woff2 +0 -0
- package/ui/dist/assets/newsreader-latin-opsz-italic-kJKFiXvB.woff2 +0 -0
- package/ui/dist/assets/newsreader-latin-opsz-normal-s-izfB6B.woff2 +0 -0
- package/ui/dist/assets/newsreader-vietnamese-opsz-italic-DTr-ymY4.woff2 +0 -0
- package/ui/dist/assets/newsreader-vietnamese-opsz-normal-BjhtXyW2.woff2 +0 -0
- package/ui/dist/assets/pdf-YwugTw7Y.js +54 -0
- package/ui/dist/assets/pdf-engine-CkBopwck.js +1 -0
- package/ui/dist/assets/pdf-rELvHkft.js +56 -0
- package/ui/dist/assets/pdf.worker.min-B5Yc7dP4.mjs +27 -0
- package/ui/dist/assets/pdf.worker.min-B7U8ptvh.js +1 -0
- package/ui/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
- package/ui/dist/assets/pdf.worker.min-UqOn5EDC.js +1 -0
- package/ui/dist/assets/schibsted-grotesk-latin-ext-wght-normal-hsMS0n0O.woff2 +0 -0
- package/ui/dist/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2 +0 -0
- package/ui/dist/icons/apple-touch-icon.png +0 -0
- package/ui/dist/icons/otea-192.png +0 -0
- package/ui/dist/icons/otea-512.png +0 -0
- package/ui/dist/icons/otea-badge.png +0 -0
- package/ui/dist/icons/otea-maskable-512.png +0 -0
- package/ui/dist/index.html +25 -0
- package/ui/dist/manifest.webmanifest +24 -0
- package/ui/dist/otea-idle.svg +5 -0
- package/ui/dist/otea-working.svg +5 -0
- package/ui/dist/otea-yours-working.svg +5 -0
- package/ui/dist/otea-yours.svg +5 -0
- package/ui/dist/sw.js +1 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { authorizeRelay } from '../core/authority.js';
|
|
2
|
+
import { isClosed, positionOf, stateOf } from '../core/board/engine.js';
|
|
3
|
+
import { DROPPED, stepById } from '../core/board/model.js';
|
|
4
|
+
import { OteaError } from '../core/errors.js';
|
|
5
|
+
import { assertCanLeave } from '../core/fields.js';
|
|
6
|
+
import { activeLease } from '../core/lease.js';
|
|
7
|
+
import { transaction } from '../store/database.js';
|
|
8
|
+
import { selectEvents } from '../store/queries.js';
|
|
9
|
+
import { typeOfItem } from './collections.js';
|
|
10
|
+
import { landMove, requireWritableItem, systemClock } from './items.js';
|
|
11
|
+
import { assertMoveHandsOff, boardState, liveBoardOf, motiveByName, roundWorkersOf, } from './next.js';
|
|
12
|
+
import { assertMayEnter } from './relations.js';
|
|
13
|
+
// The human a relayed decision belongs to: the same actor the web UI records.
|
|
14
|
+
export const RELAYED_HUMAN = { kind: 'human', name: 'human' };
|
|
15
|
+
// Where a relayed decision moves the item: the state named, or, with a motive, the discard with
|
|
16
|
+
// that motive (`otea relay ERR-2 Dropped --motive Duplicado`).
|
|
17
|
+
function relayedState(ctx, collection, to, motive) {
|
|
18
|
+
const state = boardState(ctx, collection, to);
|
|
19
|
+
if (motive === undefined)
|
|
20
|
+
return state;
|
|
21
|
+
const board = liveBoardOf(ctx, collection);
|
|
22
|
+
const target = positionOf(state);
|
|
23
|
+
if (!board || !isClosed(target) || target.closed !== DROPPED)
|
|
24
|
+
throw new OteaError('invalid_fields', '--motive goes only with a discard on a board: Dropped');
|
|
25
|
+
const id = motiveByName(board.def, motive);
|
|
26
|
+
if (id === undefined) {
|
|
27
|
+
const names = board.def.drop.motives.map(({ name }) => name).join('|');
|
|
28
|
+
throw new OteaError('invalid_fields', names
|
|
29
|
+
? `${board.def.name} has no motive "${motive}": --motive "${names}"`
|
|
30
|
+
: `${board.def.name} has no motives`);
|
|
31
|
+
}
|
|
32
|
+
return stateOf({ closed: DROPPED, motive: id });
|
|
33
|
+
}
|
|
34
|
+
// A decision the human made in conversation, recorded by an agent. It is the human's, so like a
|
|
35
|
+
// move in the web UI it is not bound by another agent's lease, and it is always marked as relayed.
|
|
36
|
+
export function relayDecision(ctx, input, now = systemClock) {
|
|
37
|
+
const quote = input.quote.trim();
|
|
38
|
+
if (!quote) {
|
|
39
|
+
throw new OteaError('quote_required', 'A relayed decision needs a quote of what the human said');
|
|
40
|
+
}
|
|
41
|
+
const { db } = ctx;
|
|
42
|
+
return transaction(db, () => {
|
|
43
|
+
const item = requireWritableItem(db, input.id);
|
|
44
|
+
const type = typeOfItem(ctx, item);
|
|
45
|
+
const { workflow } = type;
|
|
46
|
+
const { reason, via, channel } = input;
|
|
47
|
+
const to = relayedState(ctx, item.collection, input.to, input.motive);
|
|
48
|
+
// On a board the engine says first: a discard the person makes only on the page, an approval
|
|
49
|
+
// whose parts are not finished.
|
|
50
|
+
const note = assertMoveHandsOff(ctx, item, to, RELAYED_HUMAN, {
|
|
51
|
+
...(reason === undefined ? {} : { reason }),
|
|
52
|
+
via: 'relay',
|
|
53
|
+
});
|
|
54
|
+
authorizeRelay(workflow, item.state, to, reason);
|
|
55
|
+
assertCanLeave(type, item.state, to, item.fields);
|
|
56
|
+
const at = now();
|
|
57
|
+
assertMayEnter(ctx, item, workflow, to, at);
|
|
58
|
+
assertNotOwnStep(ctx, item, via);
|
|
59
|
+
const board = liveBoardOf(ctx, item.collection) !== undefined;
|
|
60
|
+
const move = { to, actor: RELAYED_HUMAN, at, lease: activeLease(item.lease, at), board };
|
|
61
|
+
const data = {
|
|
62
|
+
...(reason ? { reason } : {}),
|
|
63
|
+
...(note ? { note } : {}),
|
|
64
|
+
channel,
|
|
65
|
+
quote,
|
|
66
|
+
source: 'conversation',
|
|
67
|
+
};
|
|
68
|
+
return landMove(ctx, workflow, item, move, data, { via });
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// A move the agent made itself, not one it relayed (a relayed move is the human's).
|
|
72
|
+
function movedBy(event, agent) {
|
|
73
|
+
const { type, actor } = event;
|
|
74
|
+
return type === 'transitioned' && actor.kind === 'agent' && actor.name === agent;
|
|
75
|
+
}
|
|
76
|
+
// The step `agent` did itself in the round the item is in. On a board: one of the agents that did
|
|
77
|
+
// the step in its current round (next.ts roundWorkersOf). Off a board: the state it left with the move
|
|
78
|
+
// that brought the item where it is.
|
|
79
|
+
function ownStep(ctx, item, agent) {
|
|
80
|
+
const events = selectEvents(ctx.db, item.id);
|
|
81
|
+
const board = liveBoardOf(ctx, item.collection);
|
|
82
|
+
if (!board) {
|
|
83
|
+
const last = events.findLast(({ type }) => type === 'transitioned');
|
|
84
|
+
return last && movedBy(last, agent) ? String(last.data.from) : undefined;
|
|
85
|
+
}
|
|
86
|
+
const position = positionOf(item.state);
|
|
87
|
+
if (isClosed(position) || !roundWorkersOf(ctx, item, board.def).includes(agent))
|
|
88
|
+
return undefined;
|
|
89
|
+
return stepById(board.def, position.step)?.name ?? position.step;
|
|
90
|
+
}
|
|
91
|
+
// An agent relays the human's decisions, never one on its own work: the human makes that one in
|
|
92
|
+
// the web UI, where nobody speaks for them.
|
|
93
|
+
function assertNotOwnStep(ctx, item, via) {
|
|
94
|
+
const step = ownStep(ctx, item, via);
|
|
95
|
+
if (step === undefined)
|
|
96
|
+
return;
|
|
97
|
+
throw new OteaError('forbidden', `Not relayed: ${via} did ${step} on ${item.id} in this round, so it may not relay the decision on its own work; the person makes it in the web UI.`, { kind: 'own_step', item: item.id, step, who: via });
|
|
98
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
3
|
+
import { basename, join, resolve } from 'node:path';
|
|
4
|
+
import { OteaError } from '../core/errors.js';
|
|
5
|
+
import { repoIdentity } from '../core/repo.js';
|
|
6
|
+
import { transaction } from '../store/database.js';
|
|
7
|
+
import { deleteRepo, insertRepo, markReposRead, renameRepo, selectRepos, selectReposRead, } from '../store/queries.js';
|
|
8
|
+
import { repoOfItem, sameRepo } from './gates.js';
|
|
9
|
+
import { kindOf, listProjects, repoFingerprint, withRegistry } from './home.js';
|
|
10
|
+
import { listItems } from './items.js';
|
|
11
|
+
import { liveBoards } from './next.js';
|
|
12
|
+
// A repo Otea cannot tell is one of the project's, where a gate checks: the gate refuses rather
|
|
13
|
+
// than allow what it cannot match to an item.
|
|
14
|
+
export class UnknownRepo extends Error {
|
|
15
|
+
}
|
|
16
|
+
const SKIPPED = new Set(['node_modules', '.git', '.otea']);
|
|
17
|
+
// The git repos at most two folders below a parent folder.
|
|
18
|
+
export function reposInside(folder, depth = 2) {
|
|
19
|
+
if (depth === 0)
|
|
20
|
+
return [];
|
|
21
|
+
let entries;
|
|
22
|
+
try {
|
|
23
|
+
entries = readdirSync(folder, { withFileTypes: true })
|
|
24
|
+
.filter((entry) => entry.isDirectory() && !SKIPPED.has(entry.name))
|
|
25
|
+
.map((entry) => join(folder, entry.name));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return entries.flatMap((dir) => existsSync(join(dir, '.git')) ? [dir] : reposInside(dir, depth - 1));
|
|
31
|
+
}
|
|
32
|
+
// The top folder of the git checkout at `path`; undefined outside one.
|
|
33
|
+
function checkoutTop(path) {
|
|
34
|
+
try {
|
|
35
|
+
const top = execFileSync('git', ['rev-parse', '--show-toplevel'], {
|
|
36
|
+
cwd: path,
|
|
37
|
+
encoding: 'utf8',
|
|
38
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
39
|
+
}).trim();
|
|
40
|
+
return top ? resolve(top) : undefined;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// What identifies the repo checked out at `path`; null when it has no origin and no commit.
|
|
47
|
+
export function identityAt(path) {
|
|
48
|
+
return repoIdentity(repoFingerprint(path));
|
|
49
|
+
}
|
|
50
|
+
// The folders that lead to the project, as linked in the registry, or its own folder.
|
|
51
|
+
function projectFolders(project, env) {
|
|
52
|
+
const listed = withRegistry(env, listProjects)?.find(({ id }) => id === project.identity.id);
|
|
53
|
+
if (listed)
|
|
54
|
+
return listed.paths.filter(({ missing }) => !missing);
|
|
55
|
+
return [{ path: project.root, kind: kindOf(project.root) }];
|
|
56
|
+
}
|
|
57
|
+
// The repos at a folder: the folder itself when it is a repo, or the ones below it.
|
|
58
|
+
const reposAt = ({ path, kind }) => kind === 'repo' ? [path] : reposInside(path);
|
|
59
|
+
// Registers the repos at `folders` that the project does not know yet, each under its folder's
|
|
60
|
+
// name. Where two folders hold the same repo under different names (api and a clone in api-copy),
|
|
61
|
+
// the name its items already give it wins; and a name two repos would take goes to neither. A repo
|
|
62
|
+
// left out is told apart by a gate, which refuses in it until `otea repos add` names it.
|
|
63
|
+
export function readReposIn(project, folders) {
|
|
64
|
+
const known = selectRepos(project.db);
|
|
65
|
+
const identities = new Set(known.map(({ identity }) => identity));
|
|
66
|
+
const names = new Set(known.map(({ name }) => name));
|
|
67
|
+
const found = new Map();
|
|
68
|
+
for (const folder of folders) {
|
|
69
|
+
const identity = identityAt(folder);
|
|
70
|
+
if (identity === null || identities.has(identity))
|
|
71
|
+
continue;
|
|
72
|
+
const named = found.get(identity) ?? new Set();
|
|
73
|
+
named.add(basename(folder));
|
|
74
|
+
found.set(identity, named);
|
|
75
|
+
}
|
|
76
|
+
if (found.size === 0)
|
|
77
|
+
return [];
|
|
78
|
+
const used = itemRepoNames(project);
|
|
79
|
+
const chosen = [];
|
|
80
|
+
for (const [identity, named] of found) {
|
|
81
|
+
const candidates = [...named];
|
|
82
|
+
const pick = candidates.length === 1 ? candidates : candidates.filter((n) => used.has(n));
|
|
83
|
+
if (pick.length === 1 && pick[0] !== undefined)
|
|
84
|
+
chosen.push({ name: pick[0], identity });
|
|
85
|
+
}
|
|
86
|
+
const taken = (name) => chosen.filter((repo) => repo.name === name).length > 1;
|
|
87
|
+
const added = chosen.filter(({ name }) => !names.has(name) && !taken(name));
|
|
88
|
+
transaction(project.db, () => {
|
|
89
|
+
for (const repo of added)
|
|
90
|
+
insertRepo(project.db, repo);
|
|
91
|
+
});
|
|
92
|
+
return added;
|
|
93
|
+
}
|
|
94
|
+
function itemRepoNames(project) {
|
|
95
|
+
const boards = liveBoards(project);
|
|
96
|
+
const names = listItems(project).map((item) => repoOfItem(project, item, boards));
|
|
97
|
+
return new Set(names.filter((name) => typeof name === 'string'));
|
|
98
|
+
}
|
|
99
|
+
// The project's repos. The first time, the repos at its folders are read in (readReposIn).
|
|
100
|
+
export function listRepos(project, env = process.env) {
|
|
101
|
+
if (!selectReposRead(project.db)) {
|
|
102
|
+
readReposIn(project, projectFolders(project, env).flatMap(reposAt));
|
|
103
|
+
markReposRead(project.db);
|
|
104
|
+
}
|
|
105
|
+
return selectRepos(project.db);
|
|
106
|
+
}
|
|
107
|
+
// The checkouts of the repo the project names `name` (in any case) in the project's folders (the
|
|
108
|
+
// folders linked to it, or the repos below them); none for a name the project does not know.
|
|
109
|
+
export function checkoutsOf(project, name, env = process.env) {
|
|
110
|
+
const repo = listRepos(project, env).find((each) => sameRepo(each.name, name));
|
|
111
|
+
if (!repo)
|
|
112
|
+
return [];
|
|
113
|
+
const folders = projectFolders(project, env).flatMap(reposAt);
|
|
114
|
+
return [...new Set(folders)].filter((folder) => identityAt(folder) === repo.identity);
|
|
115
|
+
}
|
|
116
|
+
// Registers the repos at a folder just linked to the project (the folder, or the repos below it),
|
|
117
|
+
// after the first read of the others, so a clone never takes the name of the repo it is a clone of.
|
|
118
|
+
export function readReposAtFolder(project, path, env = process.env) {
|
|
119
|
+
const before = new Set(selectRepos(project.db).map(({ identity }) => identity));
|
|
120
|
+
listRepos(project, env);
|
|
121
|
+
readReposIn(project, reposAt({ path, kind: kindOf(path) }));
|
|
122
|
+
return selectRepos(project.db).filter(({ identity }) => !before.has(identity));
|
|
123
|
+
}
|
|
124
|
+
// The name the project gives the repo checked out at `cwd`. Throws a plain error outside a git
|
|
125
|
+
// checkout (nothing to check), and UnknownRepo for a checkout the project does not know.
|
|
126
|
+
export function repoNameAt(project, cwd, env = process.env) {
|
|
127
|
+
const top = checkoutTop(cwd);
|
|
128
|
+
if (top === undefined)
|
|
129
|
+
throw new Error(`${cwd} is not in a git checkout`);
|
|
130
|
+
const identity = identityAt(top);
|
|
131
|
+
const repo = identity && listRepos(project, env).find((each) => each.identity === identity);
|
|
132
|
+
if (repo)
|
|
133
|
+
return repo.name;
|
|
134
|
+
const why = identity === null
|
|
135
|
+
? 'it has no origin remote and no commit to tell it by'
|
|
136
|
+
: `it is not one of the repos of ${project.identity.name}`;
|
|
137
|
+
throw new UnknownRepo(`cannot tell which repo ${top} is (${why}); name it with otea repos add --name <repo>`);
|
|
138
|
+
}
|
|
139
|
+
// Registers the repo checked out at `path`, under `name` or its folder's name; a repo already
|
|
140
|
+
// registered keeps its name unless `name` renames it. Every clone of a repo is the same repo.
|
|
141
|
+
export function addRepo(project, path, name, env = process.env) {
|
|
142
|
+
const top = checkoutTop(path);
|
|
143
|
+
if (top === undefined)
|
|
144
|
+
throw new OteaError('not_found', `${path} is not in a git checkout`);
|
|
145
|
+
const identity = identityAt(top);
|
|
146
|
+
if (identity === null) {
|
|
147
|
+
throw new OteaError('invalid_name', `${top} has no origin remote and no commit to tell it by; add a remote or commit first`);
|
|
148
|
+
}
|
|
149
|
+
const label = (name ?? '').trim();
|
|
150
|
+
if (name !== undefined && label === '')
|
|
151
|
+
throw new OteaError('invalid_name', 'Give the repo a name');
|
|
152
|
+
const repos = listRepos(project, env);
|
|
153
|
+
const existing = repos.find((repo) => repo.identity === identity);
|
|
154
|
+
const wanted = label || existing?.name || basename(top);
|
|
155
|
+
if (existing?.name === wanted)
|
|
156
|
+
return existing;
|
|
157
|
+
// A gate check matches repo names whatever their case, so a case apart is the same name.
|
|
158
|
+
const holder = repos.find((repo) => repo.identity !== identity && sameRepo(repo.name, wanted));
|
|
159
|
+
if (holder) {
|
|
160
|
+
throw new OteaError('already_exists', `"${holder.name}" already names another repo (${holder.identity}); give this one another name with --name`);
|
|
161
|
+
}
|
|
162
|
+
const repo = { name: wanted, identity };
|
|
163
|
+
if (existing)
|
|
164
|
+
renameRepo(project.db, identity, wanted);
|
|
165
|
+
else
|
|
166
|
+
insertRepo(project.db, repo);
|
|
167
|
+
return repo;
|
|
168
|
+
}
|
|
169
|
+
// Forgets a repo by name; its items keep their values.
|
|
170
|
+
export function removeRepo(project, name, env = process.env) {
|
|
171
|
+
const repo = listRepos(project, env).find((each) => sameRepo(each.name, name));
|
|
172
|
+
if (!repo)
|
|
173
|
+
throw new OteaError('not_found', `No repo named "${name}"; run otea repos`);
|
|
174
|
+
deleteRepo(project.db, repo.name);
|
|
175
|
+
return repo;
|
|
176
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { OteaError } from '../core/errors.js';
|
|
2
|
+
import { assertAgentName } from '../core/item.js';
|
|
3
|
+
import { transaction } from '../store/database.js';
|
|
4
|
+
import { appendEvent, clearLease, selectEvents, takeLease, } from '../store/queries.js';
|
|
5
|
+
import { present, requireWritableItem, systemClock, workflowOf, } from './items.js';
|
|
6
|
+
import { liftSetAside } from './set-aside.js';
|
|
7
|
+
import { UNDO_WINDOW_MS } from './undo.js';
|
|
8
|
+
export const RELEASE_CAUSES = ['restart', 'reassign'];
|
|
9
|
+
function releaseStuck(ctx, input, data, now) {
|
|
10
|
+
const { db } = ctx;
|
|
11
|
+
return transaction(db, () => {
|
|
12
|
+
const item = requireWritableItem(db, input.id);
|
|
13
|
+
const at = now();
|
|
14
|
+
const ran = stuckLease(item);
|
|
15
|
+
clearLease(db, item.id);
|
|
16
|
+
appendEvent(db, {
|
|
17
|
+
itemId: item.id,
|
|
18
|
+
type: 'released',
|
|
19
|
+
actor: input.actor,
|
|
20
|
+
at,
|
|
21
|
+
data: { holder: ran.holder, expiresAt: ran.expiresAt, ...data, channel: input.channel },
|
|
22
|
+
});
|
|
23
|
+
return present({ ...item, lease: null }, workflowOf(ctx, item), at);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
// The lease the person frees: one that ran out (Atasco), or a live one, since the person leads (a
|
|
27
|
+
// subagent that ended still holding it). The agent that held it claims it again before it writes
|
|
28
|
+
// (assertMayWriteItem).
|
|
29
|
+
function stuckLease(item) {
|
|
30
|
+
if (!item.lease)
|
|
31
|
+
throw new OteaError('not_stuck', `${item.id} has no lease to free`, {
|
|
32
|
+
kind: 'not_stuck',
|
|
33
|
+
item: item.id,
|
|
34
|
+
});
|
|
35
|
+
return item.lease;
|
|
36
|
+
}
|
|
37
|
+
export function restartItem(ctx, input, now = systemClock) {
|
|
38
|
+
return releaseStuck(ctx, input, { cause: 'restart' }, now);
|
|
39
|
+
}
|
|
40
|
+
export function reassignItem(ctx, input, now = systemClock) {
|
|
41
|
+
assertAgentName(input.agent);
|
|
42
|
+
return releaseStuck(ctx, input, { cause: 'reassign', next: input.agent }, now);
|
|
43
|
+
}
|
|
44
|
+
// «Retomar» on an item an agent set aside for later (P7-R3-1): the person takes it up again, so
|
|
45
|
+
// next and wait offer it to the agents once more. Refused on one nobody set aside.
|
|
46
|
+
export function resumeItem(ctx, input, now = systemClock) {
|
|
47
|
+
const { db } = ctx;
|
|
48
|
+
return transaction(db, () => {
|
|
49
|
+
const item = requireWritableItem(db, input.id);
|
|
50
|
+
const at = now();
|
|
51
|
+
const lift = { id: item.id, actor: input.actor, at, cause: 'resume' };
|
|
52
|
+
if (!liftSetAside(db, lift, { channel: input.channel }))
|
|
53
|
+
throw new OteaError('invalid_transition', `${item.id} is not set aside: there is nothing to take up again`, { kind: 'not_set_aside', item: item.id });
|
|
54
|
+
return present(item, workflowOf(ctx, item), at);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export function undoRelease(ctx, input, now = systemClock) {
|
|
58
|
+
const { db } = ctx;
|
|
59
|
+
return transaction(db, () => {
|
|
60
|
+
const item = requireWritableItem(db, input.id);
|
|
61
|
+
const at = now();
|
|
62
|
+
const refuse = (why, text) => {
|
|
63
|
+
throw new OteaError('not_undoable', `${item.id}: ${text}`, {
|
|
64
|
+
kind: 'undo_release',
|
|
65
|
+
item: item.id,
|
|
66
|
+
why,
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
const last = selectEvents(db, item.id).at(-1);
|
|
70
|
+
const causes = RELEASE_CAUSES;
|
|
71
|
+
if (last?.type !== 'released' || !causes.includes(last.data.cause))
|
|
72
|
+
return refuse('not_release', 'its last change is not a restart or a reassign');
|
|
73
|
+
if (last.actor.kind !== input.actor.kind || last.actor.name !== input.actor.name)
|
|
74
|
+
return refuse('not_yours', 'its last restart is not yours');
|
|
75
|
+
if (Date.parse(at) - Date.parse(last.at) > UNDO_WINDOW_MS)
|
|
76
|
+
return refuse('too_old', 'the restart is too old to take back');
|
|
77
|
+
const { holder, expiresAt } = last.data;
|
|
78
|
+
if (typeof holder !== 'string' || typeof expiresAt !== 'string' || item.lease)
|
|
79
|
+
return refuse('lost', 'its lease cannot be given back');
|
|
80
|
+
const lease = { holder, expiresAt };
|
|
81
|
+
if (!takeLease(db, item.id, lease, at))
|
|
82
|
+
return refuse('lost', 'its lease cannot be given back');
|
|
83
|
+
appendEvent(db, {
|
|
84
|
+
itemId: item.id,
|
|
85
|
+
type: 'claimed',
|
|
86
|
+
actor: input.actor,
|
|
87
|
+
at,
|
|
88
|
+
data: { ...lease, undoes: last.id, channel: input.channel },
|
|
89
|
+
});
|
|
90
|
+
return present({ ...item, lease }, workflowOf(ctx, item), at);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { timeText } from '../core/time.js';
|
|
2
|
+
import { appendEvent, selectEvents } from '../store/queries.js';
|
|
3
|
+
// An item set aside for later (otea release --later, P3C-R2-4): next and wait leave it out until
|
|
4
|
+
// it moves, an agent claims it, or the set-aside lifts (P7-R3-1). It lifts on its own once the item
|
|
5
|
+
// is agent work again after waiting (what it waited for closed), and whenever the person acts on
|
|
6
|
+
// it: a note, an answer, picking it in the Matrix order, putting it on top, or Retomar. The lift is
|
|
7
|
+
// an event of its own, saying why, so the timeline tells why the item came back.
|
|
8
|
+
export const SET_ASIDE_LIFTED = 'set_aside_lifted';
|
|
9
|
+
// The events that end or start who has the item: the last of them says whether it stands aside.
|
|
10
|
+
const LEASE_EVENTS = ['claimed', 'released', 'transitioned', SET_ASIDE_LIFTED];
|
|
11
|
+
// The agent that set the item aside and when, while nothing lifted it since; undefined otherwise.
|
|
12
|
+
export function setAsideOf(events) {
|
|
13
|
+
const last = events.findLast(({ type }) => LEASE_EVENTS.includes(type));
|
|
14
|
+
if (last?.type !== 'released' || last.actor.kind !== 'agent' || last.data.cause !== 'later')
|
|
15
|
+
return undefined;
|
|
16
|
+
return { by: last.actor.name, at: last.at };
|
|
17
|
+
}
|
|
18
|
+
// What the person did to take an item up again: a note, an answer, picking it in the order,
|
|
19
|
+
// putting it on top, or Retomar (the lifts closing a part or a blocker are no wish of theirs).
|
|
20
|
+
const PERSON_LIFTS = ['note', 'answer', 'order', 'pin', 'resume'];
|
|
21
|
+
// The person took the item up again (P7-R3-8): their act lifted an agent's set-aside, and since
|
|
22
|
+
// then the item has not moved nor been set aside again (by an agent relaying their newer words).
|
|
23
|
+
// Undefined otherwise.
|
|
24
|
+
export function retakeOf(events) {
|
|
25
|
+
const last = events.findLast(({ type, data }) => type === 'transitioned' ||
|
|
26
|
+
type === SET_ASIDE_LIFTED ||
|
|
27
|
+
(type === 'released' && data.cause === 'later'));
|
|
28
|
+
if (last?.type !== SET_ASIDE_LIFTED || !PERSON_LIFTS.includes(String(last.data.cause)))
|
|
29
|
+
return undefined;
|
|
30
|
+
const { by, cause, note } = last.data;
|
|
31
|
+
return {
|
|
32
|
+
by: String(by),
|
|
33
|
+
cause: cause,
|
|
34
|
+
at: last.at,
|
|
35
|
+
...(typeof note === 'number' ? { note } : {}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
// The retake as agents read it: "Retomar, 2026-11-19 22:38 UTC".
|
|
39
|
+
export function retakeText({ cause, at, note }) {
|
|
40
|
+
const how = {
|
|
41
|
+
note: `note ${note ?? ''}`.trim(),
|
|
42
|
+
answer: 'their answer',
|
|
43
|
+
order: 'picked in the order',
|
|
44
|
+
pin: 'put on top',
|
|
45
|
+
resume: 'Retomar',
|
|
46
|
+
parts: 'its parts closed',
|
|
47
|
+
blockers: 'what blocked it closed',
|
|
48
|
+
};
|
|
49
|
+
return `${how[cause]}, ${timeText(at)}`;
|
|
50
|
+
}
|
|
51
|
+
// Lifts the item's set-aside, if it has one, recording why; whether it had one.
|
|
52
|
+
export function liftSetAside(db, lift, data = {}) {
|
|
53
|
+
const aside = setAsideOf(selectEvents(db, lift.id));
|
|
54
|
+
if (!aside)
|
|
55
|
+
return false;
|
|
56
|
+
appendEvent(db, {
|
|
57
|
+
itemId: lift.id,
|
|
58
|
+
type: SET_ASIDE_LIFTED,
|
|
59
|
+
actor: lift.actor,
|
|
60
|
+
at: lift.at,
|
|
61
|
+
data: { by: aside.by, cause: lift.cause, ...data },
|
|
62
|
+
});
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Where the system's own locale is read from; tests replace it, so no result depends on the computer
|
|
2
|
+
// they run on. Its own module, with no imports: the test setup file loads it in every test, UI tests
|
|
3
|
+
// included, and a UI test cannot load what reaches node:sqlite (the store) on Node 22.
|
|
4
|
+
export const system = {
|
|
5
|
+
locale: () => Intl.DateTimeFormat().resolvedOptions().locale,
|
|
6
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { execFile, spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { delimiter, join } from 'node:path';
|
|
4
|
+
import { parseServeStatus, parseStatus, TailscaleFailure, } from './tailscale.js';
|
|
5
|
+
// The real tailscale CLI. Only `otea phone tailscale` and Configuración's Tailscale option reach
|
|
6
|
+
// `up` and `serve`; tests use tailscale-testing.ts instead.
|
|
7
|
+
// Where each system's installer puts the CLI, after whatever PATH finds.
|
|
8
|
+
const KNOWN = {
|
|
9
|
+
win32: ['C:\\Program Files\\Tailscale\\tailscale.exe'],
|
|
10
|
+
darwin: [
|
|
11
|
+
'/Applications/Tailscale.app/Contents/MacOS/Tailscale',
|
|
12
|
+
'/opt/homebrew/bin/tailscale',
|
|
13
|
+
'/usr/local/bin/tailscale',
|
|
14
|
+
],
|
|
15
|
+
linux: ['/usr/bin/tailscale', '/usr/local/bin/tailscale', '/usr/sbin/tailscale'],
|
|
16
|
+
};
|
|
17
|
+
export function locateTailscale({ platform = process.platform, path = process.env.PATH, exists = existsSync, } = {}) {
|
|
18
|
+
const name = platform === 'win32' ? 'tailscale.exe' : 'tailscale';
|
|
19
|
+
const separator = platform === 'win32' ? ';' : platform === process.platform ? delimiter : ':';
|
|
20
|
+
const onPath = (path ?? '')
|
|
21
|
+
.split(separator)
|
|
22
|
+
.filter((dir) => dir !== '')
|
|
23
|
+
.map((dir) => platform === 'win32' ? `${dir.replace(/[\\/]$/, '')}\\${name}` : join(dir, name));
|
|
24
|
+
return [...onPath, ...(KNOWN[platform] ?? KNOWN.linux ?? [])].find((candidate) => exists(candidate));
|
|
25
|
+
}
|
|
26
|
+
const TIMEOUT_MS = 30_000;
|
|
27
|
+
// What tailscale says when serve is not allowed for this user (Linux, without an operator).
|
|
28
|
+
const DENIED = /access denied|permission denied|operator/i;
|
|
29
|
+
const LINK = /https:\/\/login\.tailscale\.com\/\S+/;
|
|
30
|
+
function run(binary, args, timeout = TIMEOUT_MS) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
execFile(binary, args, { timeout, windowsHide: true }, (error, stdout, stderr) => {
|
|
33
|
+
if (!error) {
|
|
34
|
+
resolve(stdout);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const said = `${stderr}\n${stdout}`.trim();
|
|
38
|
+
const link = LINK.exec(said)?.[0];
|
|
39
|
+
const hint = link
|
|
40
|
+
? ` Open ${link} to allow it on your tailnet, then try again.`
|
|
41
|
+
: DENIED.test(said)
|
|
42
|
+
? ' On Linux, let your user run it once with: sudo tailscale set --operator=$USER'
|
|
43
|
+
: '';
|
|
44
|
+
reject(new TailscaleFailure(`tailscale ${args.join(' ')} failed: ${said || error.message}.${hint}`));
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function json(text) {
|
|
49
|
+
try {
|
|
50
|
+
return JSON.parse(text);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
throw new TailscaleFailure('tailscale answered something that is not JSON');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function systemTailscale(locating = {}) {
|
|
57
|
+
const binary = () => {
|
|
58
|
+
const found = locateTailscale(locating);
|
|
59
|
+
if (!found)
|
|
60
|
+
throw new TailscaleFailure('Tailscale is not installed');
|
|
61
|
+
return found;
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
locate: () => locateTailscale(locating),
|
|
65
|
+
status: async () => parseStatus(json(await run(binary(), ['status', '--json']))),
|
|
66
|
+
serveStatus: async () => parseServeStatus(json(await run(binary(), ['serve', 'status', '--json']))),
|
|
67
|
+
// Interactive: tailscale prints the login link and waits until the person logs in.
|
|
68
|
+
up: () => new Promise((resolve, reject) => {
|
|
69
|
+
const child = spawn(binary(), ['up'], { stdio: 'inherit', windowsHide: true });
|
|
70
|
+
child.once('error', reject);
|
|
71
|
+
child.once('exit', (code) => code === 0 ? resolve() : reject(new TailscaleFailure(`tailscale up exited with ${code}`)));
|
|
72
|
+
}),
|
|
73
|
+
serve: async (port) => {
|
|
74
|
+
await run(binary(), ['serve', '--bg', '--https=443', `http://127.0.0.1:${port}`]);
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const TAILNET_HOST = 'desk.tail1.ts.net';
|
|
2
|
+
export function fakeTailscale(state = {}) {
|
|
3
|
+
const fake = {
|
|
4
|
+
installed: true,
|
|
5
|
+
state: {
|
|
6
|
+
backend: 'Running',
|
|
7
|
+
dnsName: TAILNET_HOST,
|
|
8
|
+
magicDns: true,
|
|
9
|
+
https: true,
|
|
10
|
+
authUrl: null,
|
|
11
|
+
phoneOnTailnet: false,
|
|
12
|
+
phoneOnline: null,
|
|
13
|
+
...state,
|
|
14
|
+
},
|
|
15
|
+
routes: [],
|
|
16
|
+
calls: [],
|
|
17
|
+
afterUp: { backend: 'Running', authUrl: null },
|
|
18
|
+
serveError: undefined,
|
|
19
|
+
locate: () => (fake.installed ? '/usr/bin/tailscale' : undefined),
|
|
20
|
+
status: async () => {
|
|
21
|
+
fake.calls.push('status');
|
|
22
|
+
return fake.state;
|
|
23
|
+
},
|
|
24
|
+
serveStatus: async () => {
|
|
25
|
+
fake.calls.push('serve status');
|
|
26
|
+
return fake.routes;
|
|
27
|
+
},
|
|
28
|
+
up: async () => {
|
|
29
|
+
fake.calls.push('up');
|
|
30
|
+
fake.state = { ...fake.state, ...fake.afterUp };
|
|
31
|
+
},
|
|
32
|
+
serve: async (port) => {
|
|
33
|
+
fake.calls.push(`serve ${port}`);
|
|
34
|
+
if (fake.serveError)
|
|
35
|
+
throw fake.serveError;
|
|
36
|
+
const host = fake.state.dnsName ?? '';
|
|
37
|
+
fake.routes = [{ host, port: 443, path: '/', target: `http://127.0.0.1:${port}` }];
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
return fake;
|
|
41
|
+
}
|