@cat-factory/server 0.30.0 → 0.32.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/dist/app.d.ts.map +1 -1
- package/dist/app.js +2 -0
- package/dist/app.js.map +1 -1
- package/dist/config/types.d.ts +1 -15
- package/dist/config/types.d.ts.map +1 -1
- package/dist/github/FetchGitHubClient.d.ts +15 -1
- package/dist/github/FetchGitHubClient.d.ts.map +1 -1
- package/dist/github/FetchGitHubClient.js +128 -7
- package/dist/github/FetchGitHubClient.js.map +1 -1
- package/dist/github/GitHubPullRequestReviewProvider.d.ts +25 -0
- package/dist/github/GitHubPullRequestReviewProvider.d.ts.map +1 -0
- package/dist/github/GitHubPullRequestReviewProvider.js +170 -0
- package/dist/github/GitHubPullRequestReviewProvider.js.map +1 -0
- package/dist/http/errorHandler.d.ts.map +1 -1
- package/dist/http/errorHandler.js +20 -0
- package/dist/http/errorHandler.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/accounts/AccountController.d.ts +4 -0
- package/dist/modules/accounts/AccountController.d.ts.map +1 -1
- package/dist/modules/accounts/AccountController.js +78 -58
- package/dist/modules/accounts/AccountController.js.map +1 -1
- package/dist/modules/agentRuns/AgentRunController.d.ts.map +1 -1
- package/dist/modules/agentRuns/AgentRunController.js +8 -6
- package/dist/modules/agentRuns/AgentRunController.js.map +1 -1
- package/dist/modules/auth/AuthController.d.ts.map +1 -1
- package/dist/modules/auth/AuthController.js +23 -23
- package/dist/modules/auth/AuthController.js.map +1 -1
- package/dist/modules/board/BoardController.d.ts.map +1 -1
- package/dist/modules/board/BoardController.js +26 -26
- package/dist/modules/board/BoardController.js.map +1 -1
- package/dist/modules/bootstrap/BootstrapController.d.ts.map +1 -1
- package/dist/modules/bootstrap/BootstrapController.js +15 -15
- package/dist/modules/bootstrap/BootstrapController.js.map +1 -1
- package/dist/modules/brainstorm/BrainstormController.d.ts +3 -2
- package/dist/modules/brainstorm/BrainstormController.d.ts.map +1 -1
- package/dist/modules/brainstorm/BrainstormController.js +36 -52
- package/dist/modules/brainstorm/BrainstormController.js.map +1 -1
- package/dist/modules/clarity/ClarityReviewController.d.ts.map +1 -1
- package/dist/modules/clarity/ClarityReviewController.js +27 -25
- package/dist/modules/clarity/ClarityReviewController.js.map +1 -1
- package/dist/modules/consensus/ConsensusController.d.ts.map +1 -1
- package/dist/modules/consensus/ConsensusController.js +6 -4
- package/dist/modules/consensus/ConsensusController.js.map +1 -1
- package/dist/modules/documents/DocumentSourceController.d.ts.map +1 -1
- package/dist/modules/documents/DocumentSourceController.js +17 -17
- package/dist/modules/documents/DocumentSourceController.js.map +1 -1
- package/dist/modules/environments/EnvironmentController.d.ts.map +1 -1
- package/dist/modules/environments/EnvironmentController.js +24 -24
- package/dist/modules/environments/EnvironmentController.js.map +1 -1
- package/dist/modules/execution/ExecutionController.d.ts.map +1 -1
- package/dist/modules/execution/ExecutionController.js +57 -45
- package/dist/modules/execution/ExecutionController.js.map +1 -1
- package/dist/modules/followUp/FollowUpController.d.ts.map +1 -1
- package/dist/modules/followUp/FollowUpController.js +21 -17
- package/dist/modules/followUp/FollowUpController.js.map +1 -1
- package/dist/modules/fragmentLibrary/FragmentLibraryController.d.ts.map +1 -1
- package/dist/modules/fragmentLibrary/FragmentLibraryController.js +26 -26
- package/dist/modules/fragmentLibrary/FragmentLibraryController.js.map +1 -1
- package/dist/modules/github/GitHubController.d.ts.map +1 -1
- package/dist/modules/github/GitHubController.js +44 -44
- package/dist/modules/github/GitHubController.js.map +1 -1
- package/dist/modules/humanReview/HumanReviewController.d.ts +11 -0
- package/dist/modules/humanReview/HumanReviewController.d.ts.map +1 -0
- package/dist/modules/humanReview/HumanReviewController.js +22 -0
- package/dist/modules/humanReview/HumanReviewController.js.map +1 -0
- package/dist/modules/humanTest/HumanTestController.d.ts.map +1 -1
- package/dist/modules/humanTest/HumanTestController.js +17 -17
- package/dist/modules/humanTest/HumanTestController.js.map +1 -1
- package/dist/modules/incidentEnrichment/IncidentEnrichmentController.d.ts.map +1 -1
- package/dist/modules/incidentEnrichment/IncidentEnrichmentController.js +7 -7
- package/dist/modules/incidentEnrichment/IncidentEnrichmentController.js.map +1 -1
- package/dist/modules/kaizen/KaizenController.d.ts.map +1 -1
- package/dist/modules/kaizen/KaizenController.js +7 -5
- package/dist/modules/kaizen/KaizenController.js.map +1 -1
- package/dist/modules/localModels/LocalModelEndpointController.d.ts.map +1 -1
- package/dist/modules/localModels/LocalModelEndpointController.js +10 -11
- package/dist/modules/localModels/LocalModelEndpointController.js.map +1 -1
- package/dist/modules/localSettings/LocalSettingsController.d.ts.map +1 -1
- package/dist/modules/localSettings/LocalSettingsController.js +6 -6
- package/dist/modules/localSettings/LocalSettingsController.js.map +1 -1
- package/dist/modules/merge/MergePresetController.d.ts.map +1 -1
- package/dist/modules/merge/MergePresetController.js +10 -10
- package/dist/modules/merge/MergePresetController.js.map +1 -1
- package/dist/modules/modelPresets/ModelPresetController.d.ts.map +1 -1
- package/dist/modules/modelPresets/ModelPresetController.js +10 -10
- package/dist/modules/modelPresets/ModelPresetController.js.map +1 -1
- package/dist/modules/models/ModelController.d.ts.map +1 -1
- package/dist/modules/models/ModelController.js +6 -4
- package/dist/modules/models/ModelController.js.map +1 -1
- package/dist/modules/notifications/NotificationController.d.ts.map +1 -1
- package/dist/modules/notifications/NotificationController.js +11 -9
- package/dist/modules/notifications/NotificationController.js.map +1 -1
- package/dist/modules/openrouter/OpenRouterCatalogController.d.ts.map +1 -1
- package/dist/modules/openrouter/OpenRouterCatalogController.js +9 -10
- package/dist/modules/openrouter/OpenRouterCatalogController.js.map +1 -1
- package/dist/modules/pipelines/PipelineController.d.ts.map +1 -1
- package/dist/modules/pipelines/PipelineController.js +17 -15
- package/dist/modules/pipelines/PipelineController.js.map +1 -1
- package/dist/modules/promptFragments/PromptFragmentController.d.ts.map +1 -1
- package/dist/modules/promptFragments/PromptFragmentController.js +4 -2
- package/dist/modules/promptFragments/PromptFragmentController.js.map +1 -1
- package/dist/modules/providers/ApiKeyController.d.ts.map +1 -1
- package/dist/modules/providers/ApiKeyController.js +12 -12
- package/dist/modules/providers/ApiKeyController.js.map +1 -1
- package/dist/modules/providers/PersonalSubscriptionController.d.ts.map +1 -1
- package/dist/modules/providers/PersonalSubscriptionController.js +7 -8
- package/dist/modules/providers/PersonalSubscriptionController.js.map +1 -1
- package/dist/modules/providers/UserSecretController.d.ts.map +1 -1
- package/dist/modules/providers/UserSecretController.js +14 -15
- package/dist/modules/providers/UserSecretController.js.map +1 -1
- package/dist/modules/providers/VendorCredentialController.d.ts.map +1 -1
- package/dist/modules/providers/VendorCredentialController.js +7 -7
- package/dist/modules/providers/VendorCredentialController.js.map +1 -1
- package/dist/modules/providers/personalCredentialGate.d.ts +2 -2
- package/dist/modules/providers/personalCredentialGate.d.ts.map +1 -1
- package/dist/modules/providers/personalCredentialGate.js.map +1 -1
- package/dist/modules/provisioningLogs/ProvisioningLogController.d.ts.map +1 -1
- package/dist/modules/provisioningLogs/ProvisioningLogController.js +4 -3
- package/dist/modules/provisioningLogs/ProvisioningLogController.js.map +1 -1
- package/dist/modules/recurring/RecurringPipelineController.d.ts.map +1 -1
- package/dist/modules/recurring/RecurringPipelineController.js +15 -15
- package/dist/modules/recurring/RecurringPipelineController.js.map +1 -1
- package/dist/modules/recurring/TrackerSettingsController.d.ts.map +1 -1
- package/dist/modules/recurring/TrackerSettingsController.js +6 -6
- package/dist/modules/recurring/TrackerSettingsController.js.map +1 -1
- package/dist/modules/releaseHealth/ReleaseHealthController.d.ts.map +1 -1
- package/dist/modules/releaseHealth/ReleaseHealthController.js +14 -14
- package/dist/modules/releaseHealth/ReleaseHealthController.js.map +1 -1
- package/dist/modules/requirements/RequirementReviewController.d.ts.map +1 -1
- package/dist/modules/requirements/RequirementReviewController.js +43 -38
- package/dist/modules/requirements/RequirementReviewController.js.map +1 -1
- package/dist/modules/runners/RunnerPoolController.d.ts.map +1 -1
- package/dist/modules/runners/RunnerPoolController.js +12 -12
- package/dist/modules/runners/RunnerPoolController.js.map +1 -1
- package/dist/modules/sandbox/SandboxController.d.ts.map +1 -1
- package/dist/modules/sandbox/SandboxController.js +35 -26
- package/dist/modules/sandbox/SandboxController.js.map +1 -1
- package/dist/modules/serviceFragmentDefaults/ServiceFragmentDefaultsController.d.ts.map +1 -1
- package/dist/modules/serviceFragmentDefaults/ServiceFragmentDefaultsController.js +6 -6
- package/dist/modules/serviceFragmentDefaults/ServiceFragmentDefaultsController.js.map +1 -1
- package/dist/modules/serviceSpec/ServiceSpecController.d.ts.map +1 -1
- package/dist/modules/serviceSpec/ServiceSpecController.js +9 -8
- package/dist/modules/serviceSpec/ServiceSpecController.js.map +1 -1
- package/dist/modules/services/ServiceMountController.d.ts.map +1 -1
- package/dist/modules/services/ServiceMountController.js +14 -14
- package/dist/modules/services/ServiceMountController.js.map +1 -1
- package/dist/modules/settings/WorkspaceSettingsController.d.ts.map +1 -1
- package/dist/modules/settings/WorkspaceSettingsController.js +6 -6
- package/dist/modules/settings/WorkspaceSettingsController.js.map +1 -1
- package/dist/modules/slack/SlackController.d.ts.map +1 -1
- package/dist/modules/slack/SlackController.js +18 -18
- package/dist/modules/slack/SlackController.js.map +1 -1
- package/dist/modules/tasks/TaskSourceController.d.ts.map +1 -1
- package/dist/modules/tasks/TaskSourceController.js +19 -19
- package/dist/modules/tasks/TaskSourceController.js.map +1 -1
- package/dist/modules/workspaces/WorkspaceController.d.ts.map +1 -1
- package/dist/modules/workspaces/WorkspaceController.js +11 -11
- package/dist/modules/workspaces/WorkspaceController.js.map +1 -1
- package/package.json +11 -9
- package/dist/http/validation.d.ts +0 -21
- package/dist/http/validation.d.ts.map +0 -1
- package/dist/http/validation.js +0 -21
- package/dist/http/validation.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/BootstrapController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"BootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/BootstrapController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,EACnC,uBAAuB,EACvB,yBAAyB,EACzB,kCAAkC,EAClC,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,oFAAoF;AACpF,SAAS,gBAAgB,CAAmB,CAAa;IACvD,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,SAAS,IAAI,IAAI,CAAA;AAC7C,CAAC;AAED,MAAM,WAAW,GAAG,CAAmB,CAAa,EAAE,OAAe,EAAE,EAAE,CACvE,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAU,CAAA;IAE9B,2EAA2E;IAE3E,cAAc,CAAC,GAAG,EAAE,kCAAkC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAClE,MAAM,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA;QACrC,IAAI,CAAC,SAAS;YAAE,OAAO,WAAW,CAAC,CAAC,EAAE,kCAAkC,CAAC,CAAA;QACzE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC,OAAO,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACjG,CAA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gBAAgB,CAAC,CAAC,CAAC,CAAA;QACrC,IAAI,CAAC,SAAS;YAAE,OAAO,WAAW,CAAC,CAAC,EAAE,kCAAkC,CAAC,CAAA;QACzE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YACpC,OAAO,WAAW,CAChB,CAAC,EACD,2FAA2F,CAC5F,CAAA;QACH,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;QAC3F,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;IAEF,8EAA8E;IAC9E,6EAA6E;IAE7E,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -6,8 +6,9 @@ import type { AppEnv } from '../../http/env.js';
|
|
|
6
6
|
* mirror of the requirements / clarity review controllers: the initial pass runs an LLM inline
|
|
7
7
|
* and returns the session; incorporation is ASYNCHRONOUS (records the intent on the parked run,
|
|
8
8
|
* signals the durable driver to fold + re-run, returns at once with the `incorporating`
|
|
9
|
-
* session). Item-level mutations are session-id scoped (the two stages share the store).
|
|
10
|
-
*
|
|
9
|
+
* session). Item-level mutations are session-id scoped (the two stages share the store). The
|
|
10
|
+
* `:stage` param is validated by the contract (an unknown stage is a shared 400), so the
|
|
11
|
+
* controller no longer hand-parses it. Mounted under `/workspaces/:workspaceId`.
|
|
11
12
|
*/
|
|
12
13
|
export declare function brainstormController(): Hono<AppEnv>;
|
|
13
14
|
//# sourceMappingURL=BrainstormController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrainstormController.d.ts","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BrainstormController.d.ts","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormController.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAW/C;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAAC,MAAM,CAAC,CA4GnD"}
|
|
@@ -1,123 +1,107 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { getBrainstormContract, incorporateBrainstormContract, proceedBrainstormContract, reReviewBrainstormContract, replyBrainstormItemContract, resolveBrainstormExceededContract, reviewBrainstormContract, updateBrainstormItemStatusContract, } from '@cat-factory/contracts';
|
|
2
|
+
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
3
3
|
import { Hono } from 'hono';
|
|
4
4
|
import { param } from '../../http/params.js';
|
|
5
|
-
import { jsonBody } from '../../http/validation.js';
|
|
6
5
|
/** Resolve the brainstorm module or send a 503, returning null when unconfigured. */
|
|
7
6
|
function requireBrainstorm(c) {
|
|
8
7
|
return c.get('container').brainstorm ?? null;
|
|
9
8
|
}
|
|
10
9
|
const unavailable = (c) => c.json({ error: { code: 'unavailable', message: 'Brainstorm is not configured' } }, 503);
|
|
11
|
-
/** Parse + validate the `:stage` path param, or null when it is not a known stage. */
|
|
12
|
-
function stageParam(c) {
|
|
13
|
-
const parsed = v.safeParse(brainstormStageSchema, param(c, 'stage'));
|
|
14
|
-
return parsed.success ? parsed.output : null;
|
|
15
|
-
}
|
|
16
|
-
const badStage = (c) => c.json({ error: { code: 'bad_request', message: 'Unknown brainstorm stage' } }, 400);
|
|
17
10
|
/**
|
|
18
11
|
* Workspace-scoped brainstorm (structured-dialogue) endpoints, STAGE-scoped: a block may have
|
|
19
12
|
* one live `requirements` session and one live `architecture` session at once. The brainstorm
|
|
20
13
|
* mirror of the requirements / clarity review controllers: the initial pass runs an LLM inline
|
|
21
14
|
* and returns the session; incorporation is ASYNCHRONOUS (records the intent on the parked run,
|
|
22
15
|
* signals the durable driver to fold + re-run, returns at once with the `incorporating`
|
|
23
|
-
* session). Item-level mutations are session-id scoped (the two stages share the store).
|
|
24
|
-
*
|
|
16
|
+
* session). Item-level mutations are session-id scoped (the two stages share the store). The
|
|
17
|
+
* `:stage` param is validated by the contract (an unknown stage is a shared 400), so the
|
|
18
|
+
* controller no longer hand-parses it. Mounted under `/workspaces/:workspaceId`.
|
|
25
19
|
*/
|
|
26
20
|
export function brainstormController() {
|
|
27
21
|
const app = new Hono();
|
|
28
22
|
// The current session for a block + stage (null when none has been run yet).
|
|
29
|
-
app
|
|
23
|
+
buildHonoRoute(app, getBrainstormContract, async (c) => {
|
|
30
24
|
const brainstorm = requireBrainstorm(c);
|
|
31
25
|
if (!brainstorm)
|
|
32
26
|
return unavailable(c);
|
|
33
|
-
const stage =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const session = await brainstorm.services[stage].getForBlock(param(c, 'workspaceId'), param(c, 'blockId'));
|
|
37
|
-
return c.json(session);
|
|
27
|
+
const { blockId, stage } = c.req.valid('param');
|
|
28
|
+
const session = await brainstorm.services[stage].getForBlock(param(c, 'workspaceId'), blockId);
|
|
29
|
+
return c.json(session, 200);
|
|
38
30
|
});
|
|
39
31
|
// Run a fresh brainstorm pass for the block + stage (replaces any prior). Routed through the
|
|
40
32
|
// execution service so the off-path surface honours the task's merge-preset knobs and threads
|
|
41
33
|
// in any upstream refined requirements, exactly like the gate.
|
|
42
|
-
app
|
|
34
|
+
buildHonoRoute(app, reviewBrainstormContract, async (c) => {
|
|
43
35
|
const brainstorm = requireBrainstorm(c);
|
|
44
36
|
if (!brainstorm)
|
|
45
37
|
return unavailable(c);
|
|
46
|
-
const stage =
|
|
47
|
-
if (!stage)
|
|
48
|
-
return badStage(c);
|
|
38
|
+
const { blockId, stage } = c.req.valid('param');
|
|
49
39
|
const session = await c
|
|
50
40
|
.get('container')
|
|
51
|
-
.executionService.reviewBrainstorm(param(c, 'workspaceId'),
|
|
41
|
+
.executionService.reviewBrainstorm(param(c, 'workspaceId'), blockId, stage);
|
|
52
42
|
return c.json(session, 201);
|
|
53
43
|
});
|
|
54
44
|
// Respond to a single option (pick / steer). Session-id scoped (stage-agnostic store).
|
|
55
|
-
app
|
|
45
|
+
buildHonoRoute(app, replyBrainstormItemContract, async (c) => {
|
|
56
46
|
const brainstorm = requireBrainstorm(c);
|
|
57
47
|
if (!brainstorm)
|
|
58
48
|
return unavailable(c);
|
|
59
|
-
const
|
|
60
|
-
|
|
49
|
+
const { sessionId, itemId } = c.req.valid('param');
|
|
50
|
+
const session = await brainstorm.services.requirements.replyToItem(param(c, 'workspaceId'), sessionId, itemId, c.req.valid('json').reply);
|
|
51
|
+
return c.json(session, 200);
|
|
61
52
|
});
|
|
62
53
|
// Set an option's status (resolve / dismiss / reopen). Session-id scoped.
|
|
63
|
-
app
|
|
54
|
+
buildHonoRoute(app, updateBrainstormItemStatusContract, async (c) => {
|
|
64
55
|
const brainstorm = requireBrainstorm(c);
|
|
65
56
|
if (!brainstorm)
|
|
66
57
|
return unavailable(c);
|
|
67
|
-
const
|
|
68
|
-
|
|
58
|
+
const { sessionId, itemId } = c.req.valid('param');
|
|
59
|
+
const session = await brainstorm.services.requirements.setItemStatus(param(c, 'workspaceId'), sessionId, itemId, c.req.valid('json').status);
|
|
60
|
+
return c.json(session, 200);
|
|
69
61
|
});
|
|
70
62
|
// Incorporate the picks ASYNCHRONOUSLY (the durable driver folds + re-runs).
|
|
71
|
-
app
|
|
63
|
+
buildHonoRoute(app, incorporateBrainstormContract, async (c) => {
|
|
72
64
|
const brainstorm = requireBrainstorm(c);
|
|
73
65
|
if (!brainstorm)
|
|
74
66
|
return unavailable(c);
|
|
75
|
-
const stage =
|
|
76
|
-
if (!stage)
|
|
77
|
-
return badStage(c);
|
|
67
|
+
const { blockId, stage } = c.req.valid('param');
|
|
78
68
|
const session = await c
|
|
79
69
|
.get('container')
|
|
80
|
-
.executionService.incorporateBrainstorm(param(c, 'workspaceId'),
|
|
81
|
-
return c.json(session);
|
|
70
|
+
.executionService.incorporateBrainstorm(param(c, 'workspaceId'), blockId, stage, c.req.valid('json').feedback);
|
|
71
|
+
return c.json(session, 200);
|
|
82
72
|
});
|
|
83
73
|
// Re-run the brainstorm against the converged direction (one more pass).
|
|
84
|
-
app
|
|
74
|
+
buildHonoRoute(app, reReviewBrainstormContract, async (c) => {
|
|
85
75
|
const brainstorm = requireBrainstorm(c);
|
|
86
76
|
if (!brainstorm)
|
|
87
77
|
return unavailable(c);
|
|
88
|
-
const stage =
|
|
89
|
-
if (!stage)
|
|
90
|
-
return badStage(c);
|
|
78
|
+
const { blockId, stage } = c.req.valid('param');
|
|
91
79
|
const session = await c
|
|
92
80
|
.get('container')
|
|
93
|
-
.executionService.reReviewBrainstorm(param(c, 'workspaceId'),
|
|
94
|
-
return c.json(session);
|
|
81
|
+
.executionService.reReviewBrainstorm(param(c, 'workspaceId'), blockId, stage);
|
|
82
|
+
return c.json(session, 200);
|
|
95
83
|
});
|
|
96
84
|
// Proceed: settle the brainstorm (last converged direction wins downstream) and advance.
|
|
97
|
-
app
|
|
85
|
+
buildHonoRoute(app, proceedBrainstormContract, async (c) => {
|
|
98
86
|
const brainstorm = requireBrainstorm(c);
|
|
99
87
|
if (!brainstorm)
|
|
100
88
|
return unavailable(c);
|
|
101
|
-
const stage =
|
|
102
|
-
if (!stage)
|
|
103
|
-
return badStage(c);
|
|
89
|
+
const { blockId, stage } = c.req.valid('param');
|
|
104
90
|
const session = await c
|
|
105
91
|
.get('container')
|
|
106
|
-
.executionService.proceedBrainstorm(param(c, 'workspaceId'),
|
|
107
|
-
return c.json(session);
|
|
92
|
+
.executionService.proceedBrainstorm(param(c, 'workspaceId'), blockId, stage);
|
|
93
|
+
return c.json(session, 200);
|
|
108
94
|
});
|
|
109
95
|
// Resolve a session that hit its iteration cap: one more round / proceed / stop-reset.
|
|
110
|
-
app
|
|
96
|
+
buildHonoRoute(app, resolveBrainstormExceededContract, async (c) => {
|
|
111
97
|
const brainstorm = requireBrainstorm(c);
|
|
112
98
|
if (!brainstorm)
|
|
113
99
|
return unavailable(c);
|
|
114
|
-
const stage =
|
|
115
|
-
if (!stage)
|
|
116
|
-
return badStage(c);
|
|
100
|
+
const { blockId, stage } = c.req.valid('param');
|
|
117
101
|
const session = await c
|
|
118
102
|
.get('container')
|
|
119
|
-
.executionService.resolveBrainstormExceeded(param(c, 'workspaceId'),
|
|
120
|
-
return c.json(session);
|
|
103
|
+
.executionService.resolveBrainstormExceeded(param(c, 'workspaceId'), blockId, stage, c.req.valid('json').choice);
|
|
104
|
+
return c.json(session, 200);
|
|
121
105
|
});
|
|
122
106
|
return app;
|
|
123
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrainstormController.js","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormController.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BrainstormController.js","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,iCAAiC,EACjC,wBAAwB,EACxB,kCAAkC,GACnC,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,qFAAqF;AACrF,SAAS,iBAAiB,CAAmB,CAAa;IACxD,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,UAAU,IAAI,IAAI,CAAA;AAC9C,CAAC;AAED,MAAM,WAAW,GAAG,CAAmB,CAAa,EAAE,EAAE,CACtD,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI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,MAAM,CAC3B,CAAA;QACH,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClarityReviewController.d.ts","sourceRoot":"","sources":["../../../src/modules/clarity/ClarityReviewController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClarityReviewController.d.ts","sourceRoot":"","sources":["../../../src/modules/clarity/ClarityReviewController.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAW/C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAAC,MAAM,CAAC,CAuGtD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getClarityReviewContract, incorporateClarityContract, proceedClarityContract, reReviewClarityContract, replyClarityItemContract, resolveClarityExceededContract, reviewClarityContract, updateClarityItemStatusContract, } from '@cat-factory/contracts';
|
|
2
|
+
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
2
3
|
import { Hono } from 'hono';
|
|
3
4
|
import { param } from '../../http/params.js';
|
|
4
|
-
import { jsonBody } from '../../http/validation.js';
|
|
5
5
|
/** Resolve the clarity module or send a 503, returning null when unconfigured. */
|
|
6
6
|
function requireClarity(c) {
|
|
7
7
|
return c.get('container').clarity ?? null;
|
|
@@ -17,80 +17,82 @@ const unavailable = (c) => c.json({ error: { code: 'unavailable', message: 'Clar
|
|
|
17
17
|
export function clarityReviewController() {
|
|
18
18
|
const app = new Hono();
|
|
19
19
|
// The current review for a block (null when none has been run yet).
|
|
20
|
-
app
|
|
20
|
+
buildHonoRoute(app, getClarityReviewContract, async (c) => {
|
|
21
21
|
const clarity = requireClarity(c);
|
|
22
22
|
if (!clarity)
|
|
23
23
|
return unavailable(c);
|
|
24
|
-
const review = await clarity.service.getForBlock(param(c, 'workspaceId'),
|
|
25
|
-
return c.json(review);
|
|
24
|
+
const review = await clarity.service.getForBlock(param(c, 'workspaceId'), c.req.valid('param').blockId);
|
|
25
|
+
return c.json(review, 200);
|
|
26
26
|
});
|
|
27
27
|
// Run a fresh triage of the block's bug report (replaces any prior). Routed through the
|
|
28
28
|
// execution service so the off-path surface honours the task's merge-preset knobs and
|
|
29
29
|
// threads in any upstream investigator output, exactly like the gate.
|
|
30
|
-
app
|
|
30
|
+
buildHonoRoute(app, reviewClarityContract, async (c) => {
|
|
31
31
|
const clarity = requireClarity(c);
|
|
32
32
|
if (!clarity)
|
|
33
33
|
return unavailable(c);
|
|
34
34
|
const review = await c
|
|
35
35
|
.get('container')
|
|
36
|
-
.executionService.reviewClarity(param(c, 'workspaceId'),
|
|
36
|
+
.executionService.reviewClarity(param(c, 'workspaceId'), c.req.valid('param').blockId);
|
|
37
37
|
return c.json(review, 201);
|
|
38
38
|
});
|
|
39
39
|
// Answer a single review item.
|
|
40
|
-
app
|
|
40
|
+
buildHonoRoute(app, replyClarityItemContract, async (c) => {
|
|
41
41
|
const clarity = requireClarity(c);
|
|
42
42
|
if (!clarity)
|
|
43
43
|
return unavailable(c);
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const { reviewId, itemId } = c.req.valid('param');
|
|
45
|
+
const review = await clarity.service.replyToItem(param(c, 'workspaceId'), reviewId, itemId, c.req.valid('json').reply);
|
|
46
|
+
return c.json(review, 200);
|
|
46
47
|
});
|
|
47
48
|
// Set a review item's status (resolve / dismiss / reopen).
|
|
48
|
-
app
|
|
49
|
+
buildHonoRoute(app, updateClarityItemStatusContract, async (c) => {
|
|
49
50
|
const clarity = requireClarity(c);
|
|
50
51
|
if (!clarity)
|
|
51
52
|
return unavailable(c);
|
|
52
|
-
const
|
|
53
|
-
|
|
53
|
+
const { reviewId, itemId } = c.req.valid('param');
|
|
54
|
+
const review = await clarity.service.setItemStatus(param(c, 'workspaceId'), reviewId, itemId, c.req.valid('json').status);
|
|
55
|
+
return c.json(review, 200);
|
|
54
56
|
});
|
|
55
57
|
// Incorporate the answers ASYNCHRONOUSLY (the durable driver folds + re-reviews).
|
|
56
|
-
app
|
|
58
|
+
buildHonoRoute(app, incorporateClarityContract, async (c) => {
|
|
57
59
|
const clarity = requireClarity(c);
|
|
58
60
|
if (!clarity)
|
|
59
61
|
return unavailable(c);
|
|
60
62
|
const review = await c
|
|
61
63
|
.get('container')
|
|
62
|
-
.executionService.incorporateClarity(param(c, 'workspaceId'),
|
|
63
|
-
return c.json(review);
|
|
64
|
+
.executionService.incorporateClarity(param(c, 'workspaceId'), c.req.valid('param').blockId, c.req.valid('json').feedback);
|
|
65
|
+
return c.json(review, 200);
|
|
64
66
|
});
|
|
65
67
|
// Re-review the clarified report (one more reviewer pass).
|
|
66
|
-
app
|
|
68
|
+
buildHonoRoute(app, reReviewClarityContract, async (c) => {
|
|
67
69
|
const clarity = requireClarity(c);
|
|
68
70
|
if (!clarity)
|
|
69
71
|
return unavailable(c);
|
|
70
72
|
const review = await c
|
|
71
73
|
.get('container')
|
|
72
|
-
.executionService.reReviewClarity(param(c, 'workspaceId'),
|
|
73
|
-
return c.json(review);
|
|
74
|
+
.executionService.reReviewClarity(param(c, 'workspaceId'), c.req.valid('param').blockId);
|
|
75
|
+
return c.json(review, 200);
|
|
74
76
|
});
|
|
75
77
|
// Proceed: settle the clarity review (last clarified report wins downstream) and advance.
|
|
76
|
-
app
|
|
78
|
+
buildHonoRoute(app, proceedClarityContract, async (c) => {
|
|
77
79
|
const clarity = requireClarity(c);
|
|
78
80
|
if (!clarity)
|
|
79
81
|
return unavailable(c);
|
|
80
82
|
const review = await c
|
|
81
83
|
.get('container')
|
|
82
|
-
.executionService.proceedClarity(param(c, 'workspaceId'),
|
|
83
|
-
return c.json(review);
|
|
84
|
+
.executionService.proceedClarity(param(c, 'workspaceId'), c.req.valid('param').blockId);
|
|
85
|
+
return c.json(review, 200);
|
|
84
86
|
});
|
|
85
87
|
// Resolve a review that hit its iteration cap: one more round / proceed / stop-reset.
|
|
86
|
-
app
|
|
88
|
+
buildHonoRoute(app, resolveClarityExceededContract, async (c) => {
|
|
87
89
|
const clarity = requireClarity(c);
|
|
88
90
|
if (!clarity)
|
|
89
91
|
return unavailable(c);
|
|
90
92
|
const review = await c
|
|
91
93
|
.get('container')
|
|
92
|
-
.executionService.resolveClarityExceeded(param(c, 'workspaceId'),
|
|
93
|
-
return c.json(review);
|
|
94
|
+
.executionService.resolveClarityExceeded(param(c, 'workspaceId'), c.req.valid('param').blockId, c.req.valid('json').choice);
|
|
95
|
+
return c.json(review, 200);
|
|
94
96
|
});
|
|
95
97
|
return app;
|
|
96
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClarityReviewController.js","sourceRoot":"","sources":["../../../src/modules/clarity/ClarityReviewController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"ClarityReviewController.js","sourceRoot":"","sources":["../../../src/modules/clarity/ClarityReviewController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,kFAAkF;AAClF,SAAS,cAAc,CAAmB,CAAa;IACrD,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,OAAO,IAAI,IAAI,CAAA;AAC3C,CAAC;AAED,MAAM,WAAW,GAAG,CAAmB,CAAa,EAAE,E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AAc,CAAC,CAAC,CAAC,CAAA;QACjC,IAAI,CAAC,OAAO;YAAE,OAAO,WAAW,CAAC,CAAC,CAAC,CAAA;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC;aACnB,GAAG,CAAC,WAAW,CAAC;aAChB,gBAAgB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAA;QACzF,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IAEF,sFAAsF;IACtF,cAAc,CAAC,GAAG,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAC9D,MAAM,OAAO,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;QACjC,IAAI,CAAC,OAAO;YAAE,OAAO,WAAW,CAAC,CAAC,CAAC,CAAA;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC;aACnB,GAAG,CAAC,WAAW,CAAC;aAChB,gBAAgB,CAAC,sBAAsB,CACtC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EACvB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAC5B,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAC3B,CAAA;QACH,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsensusController.d.ts","sourceRoot":"","sources":["../../../src/modules/consensus/ConsensusController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsensusController.d.ts","sourceRoot":"","sources":["../../../src/modules/consensus/ConsensusController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAAC,MAAM,CAAC,CAYlD"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getConsensusSessionContract } from '@cat-factory/contracts';
|
|
2
|
+
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
1
3
|
import { Hono } from 'hono';
|
|
2
4
|
import { param } from '../../http/params.js';
|
|
3
5
|
/**
|
|
@@ -11,12 +13,12 @@ import { param } from '../../http/params.js';
|
|
|
11
13
|
export function consensusController() {
|
|
12
14
|
const app = new Hono();
|
|
13
15
|
// The most recent consensus session for a block (null when none / not configured).
|
|
14
|
-
app
|
|
16
|
+
buildHonoRoute(app, getConsensusSessionContract, async (c) => {
|
|
15
17
|
const repo = c.get('container').consensusSessionRepository;
|
|
16
18
|
if (!repo)
|
|
17
|
-
return c.json({ session: null });
|
|
18
|
-
const session = await repo.getByBlock(param(c, 'workspaceId'),
|
|
19
|
-
return c.json({ session });
|
|
19
|
+
return c.json({ session: null }, 200);
|
|
20
|
+
const session = await repo.getByBlock(param(c, 'workspaceId'), c.req.valid('param').blockId);
|
|
21
|
+
return c.json({ session }, 200);
|
|
20
22
|
});
|
|
21
23
|
return app;
|
|
22
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsensusController.js","sourceRoot":"","sources":["../../../src/modules/consensus/ConsensusController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAU,CAAA;IAE9B,mFAAmF;IACnF,
|
|
1
|
+
{"version":3,"file":"ConsensusController.js","sourceRoot":"","sources":["../../../src/modules/consensus/ConsensusController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAU,CAAA;IAE9B,mFAAmF;IACnF,cAAc,CAAC,GAAG,EAAE,2BAA2B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAC3D,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,0BAA0B,CAAA;QAC1D,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,CAAA;QAChD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAA;QAC5F,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,CAAA;IACjC,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSourceController.d.ts","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentSourceController.d.ts","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAuB/C;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAAC,MAAM,CAAC,CAwHvD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { connectDocumentSourceContract, disconnectDocumentSourceContract, documentSourceKindSchema, importDocumentContract, linkDocumentContract, listDocumentConnectionsContract, listDocumentSourcesContract, listDocumentsContract, planDocumentContract, searchDocumentsContract, spawnDocumentContract, } from '@cat-factory/contracts';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
|
+
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
3
4
|
import { Hono } from 'hono';
|
|
4
5
|
import { ValidationError } from '@cat-factory/kernel';
|
|
5
6
|
import { param } from '../../http/params.js';
|
|
6
|
-
import { jsonBody } from '../../http/validation.js';
|
|
7
7
|
/** Resolve the documents module or send a 503, returning null when unconfigured. */
|
|
8
8
|
function requireDocuments(c) {
|
|
9
9
|
return c.get('container').documents ?? null;
|
|
@@ -28,28 +28,28 @@ export function documentSourceController() {
|
|
|
28
28
|
// ---- source discovery ---------------------------------------------------
|
|
29
29
|
// The configured sources + their connect/import metadata (drives the UI). A
|
|
30
30
|
// 503 here is how the frontend learns the integration is off.
|
|
31
|
-
app
|
|
31
|
+
buildHonoRoute(app, listDocumentSourcesContract, async (c) => {
|
|
32
32
|
const documents = requireDocuments(c);
|
|
33
33
|
if (!documents)
|
|
34
34
|
return unavailable(c);
|
|
35
|
-
return c.json({ sources: documents.connectionService.listSources() });
|
|
35
|
+
return c.json({ sources: documents.connectionService.listSources() }, 200);
|
|
36
36
|
});
|
|
37
37
|
// ---- connections --------------------------------------------------------
|
|
38
|
-
app
|
|
38
|
+
buildHonoRoute(app, listDocumentConnectionsContract, async (c) => {
|
|
39
39
|
const documents = requireDocuments(c);
|
|
40
40
|
if (!documents)
|
|
41
41
|
return unavailable(c);
|
|
42
42
|
const connections = await documents.connectionService.listConnections(param(c, 'workspaceId'));
|
|
43
|
-
return c.json({ connections });
|
|
43
|
+
return c.json({ connections }, 200);
|
|
44
44
|
});
|
|
45
|
-
app
|
|
45
|
+
buildHonoRoute(app, connectDocumentSourceContract, async (c) => {
|
|
46
46
|
const documents = requireDocuments(c);
|
|
47
47
|
if (!documents)
|
|
48
48
|
return unavailable(c);
|
|
49
49
|
const connection = await documents.connectionService.connect(param(c, 'workspaceId'), sourceParam(c), c.req.valid('json').credentials);
|
|
50
50
|
return c.json(connection, 201);
|
|
51
51
|
});
|
|
52
|
-
app
|
|
52
|
+
buildHonoRoute(app, disconnectDocumentSourceContract, async (c) => {
|
|
53
53
|
const documents = requireDocuments(c);
|
|
54
54
|
if (!documents)
|
|
55
55
|
return unavailable(c);
|
|
@@ -57,13 +57,13 @@ export function documentSourceController() {
|
|
|
57
57
|
return c.body(null, 204);
|
|
58
58
|
});
|
|
59
59
|
// ---- documents ----------------------------------------------------------
|
|
60
|
-
app
|
|
60
|
+
buildHonoRoute(app, listDocumentsContract, async (c) => {
|
|
61
61
|
const documents = requireDocuments(c);
|
|
62
62
|
if (!documents)
|
|
63
63
|
return unavailable(c);
|
|
64
|
-
return c.json(await documents.importService.listDocuments(param(c, 'workspaceId')));
|
|
64
|
+
return c.json(await documents.importService.listDocuments(param(c, 'workspaceId')), 200);
|
|
65
65
|
});
|
|
66
|
-
app
|
|
66
|
+
buildHonoRoute(app, importDocumentContract, async (c) => {
|
|
67
67
|
const documents = requireDocuments(c);
|
|
68
68
|
if (!documents)
|
|
69
69
|
return unavailable(c);
|
|
@@ -72,25 +72,25 @@ export function documentSourceController() {
|
|
|
72
72
|
});
|
|
73
73
|
// Search a source's catalogue by free text (title/content), returning lean hits
|
|
74
74
|
// the picker can import + link on selection.
|
|
75
|
-
app
|
|
75
|
+
buildHonoRoute(app, searchDocumentsContract, async (c) => {
|
|
76
76
|
const documents = requireDocuments(c);
|
|
77
77
|
if (!documents)
|
|
78
78
|
return unavailable(c);
|
|
79
79
|
const results = await documents.importService.search(param(c, 'workspaceId'), sourceParam(c), c.req.valid('json').query);
|
|
80
|
-
return c.json({ results });
|
|
80
|
+
return c.json({ results }, 200);
|
|
81
81
|
});
|
|
82
82
|
// ---- planning / spawning ------------------------------------------------
|
|
83
83
|
// Preview the board structure a page would expand into (no writes).
|
|
84
|
-
app
|
|
84
|
+
buildHonoRoute(app, planDocumentContract, async (c) => {
|
|
85
85
|
const documents = requireDocuments(c);
|
|
86
86
|
if (!documents)
|
|
87
87
|
return unavailable(c);
|
|
88
88
|
const workspaceId = param(c, 'workspaceId');
|
|
89
89
|
const record = await documents.importService.requireDocument(workspaceId, sourceParam(c), c.req.valid('json').externalId);
|
|
90
|
-
return c.json(await documents.plannerService.plan(record));
|
|
90
|
+
return c.json(await documents.plannerService.plan(record), 200);
|
|
91
91
|
});
|
|
92
92
|
// Apply a page's structure to the board (new frames, or into an existing one).
|
|
93
|
-
app
|
|
93
|
+
buildHonoRoute(app, spawnDocumentContract, async (c) => {
|
|
94
94
|
const documents = requireDocuments(c);
|
|
95
95
|
if (!documents)
|
|
96
96
|
return unavailable(c);
|
|
@@ -103,7 +103,7 @@ export function documentSourceController() {
|
|
|
103
103
|
});
|
|
104
104
|
// ---- context links ------------------------------------------------------
|
|
105
105
|
// Attach an imported page to a block as extra agent context.
|
|
106
|
-
app
|
|
106
|
+
buildHonoRoute(app, linkDocumentContract, async (c) => {
|
|
107
107
|
const documents = requireDocuments(c);
|
|
108
108
|
if (!documents)
|
|
109
109
|
return unavailable(c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSourceController.js","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"DocumentSourceController.js","sourceRoot":"","sources":["../../../src/modules/documents/DocumentSourceController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,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ACvB,OAAO,EACP,MAAM,EACN,UAAU,CACX,CAAA;QACD,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentController.d.ts","sourceRoot":"","sources":["../../../src/modules/environments/EnvironmentController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentController.d.ts","sourceRoot":"","sources":["../../../src/modules/environments/EnvironmentController.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAiB/C;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAAC,MAAM,CAAC,CA8GpD"}
|